Here at 7digital, we see the relationship between the customer and the developer as one of the most important aspects of software development. We treat software development as more of a craft than an engineering discipline. Craftsmen back in the day would have constant communication with their customers, receiving regular visits from their customer to discuss progress and alterations as the item takes shape.

 

Over the last twenty years, the agile software movement and extreme programming in particular has championed this with its short iterations, customer showcases and active customer participation in the creation of features.

 

Processes like Behaviour Driven Development (BDD) have attempted to bridge the gap between craftsman and customer, giving developers processes to guide software development based on the desired behaviour of the system rather than through more traditional software engineering disciplines.

 

Tools, such as Cucumber, actualise this process. Cucumber (and similar, older tools such as Fit, Fitnesse and Storyteller) provides an interface between the customer and the developer by providing a human readable specification of the software that is also understood by the computer. Based on the description, the computer executes the software accordingly.  The customer can then see immediately if the software behaves according to the specification.

 

Of course, translating human text into instructions for a computer isn’t easy. While modern programming languages on the surface do read like English, and tend to use English words, it takes a certain amount of experience to appreciate what the actual behavior of a piece of software is just by reading the code. The skill in using tools like Cucumber is in translating what the customer understands into something the machine can interpret.

 

If you’ve been looking for some time for a resource that offers a good grounding in using a tool like Cucumber then you’ll be pleased to hear that one has arrived courtesy of Matt Wynne and his Cucumber School.

 

The Cucumber School is a series of video tutorials for learning and practising how to do this. Matt Wynne takes you on a journey from the initial planning session with the customer through developing an application (‘Shouty’ - a social networking app). Throughout he highlights potential pitfalls that many teams using this tooling hit the first time they try it out. He does this with wit and aplomb. The videos are lovingly animated and include advice that Matt has built up from his many years of using and contributing to Cucumber. All this advice is condensed into six 20 minute chapters and it is advice that would otherwise take you hours and hours of trawling through blog posts and talks to discover.

 

Cucumber School covers just about everything you would want to tell developers about BDD in a little over 2 hours. To get a flavour of the style of the course the first video is available for free at the Cucumber School website and in itself demonstrates the power of BDD as a communication tool.

 

At the heart of successful software development is constant communication between the development team and customers with a business problem to solve. Cucumber provides an effective way of taking these conversations and turning them into a set of automated specifications that describe the software built. Introducing Cucumber to your development process can initially seem daunting so to get you started try The Cucumber School, which will help you to get well on the way to making it a useful and valuable part of your development process.

 

 

About the author:

For nearly two decades Leon Hewitt has been creating software to solve people's problems. He has worked at 7digital since 2012. When he's not waxing lyrical about software you can hear him chat about his favourite television programme Doctor Who on the Never Cruel or Cowardly podcast. @DocLeon

 

Tag: 
Cucumber
Learning
Code Learning
Test Framework
sharri.morris@7digital.com
Thursday, September 20, 2012 - 16:14

Over the last month we've started using ServiceStack for a couple of our api endpoints. We're hosting these projects on a debian squeeze vm using nginx and mono. We ran into various problems along the way. Here's a breakdown of what we found and how we solved the issues we ran into. Hopefully you'll find this useful. (We'll cover deployment/infrastructure details in a second post.)

Overriding the defaults

Some of the defaults for ServiceStack are in my opinion not well suited to writing an api. This is probably down to the frameworks desire to be a complete web framework. Here's our current default implementation of AppHost:

 

For me, the biggest annoyance was trying to find the DefaultContentType setting. I found some of the settings unintuitive to find, but it's not like you have to do it very often!

Timing requests with StatsD

As you can see, we've added a StatsD feature which was very easy to add. It basically times how long each request took and logs it to statsD. Here's how we did it:

 

It would have been nicer if we could wrap the request handler but that kind of pipeline is foreign to the framework and as such you need to subscribe to the begin and end messages. There's probably a better way of recording the time spent but hey ho it works for us.

sharri.morris@7digital.com
Sunday, September 16, 2012 - 11:31

At 7digital we use Ajax to update our basket without needing to refresh the page. This provides a smoother experience for the user, but makes it a little more effort to automate our acceptance tests with [Watir](http://wtr.rubyforge.org/). Using timeouts is one way to wait for the basket to render, but it has two issues. If the timeout is too high, it forces all your tests to run slowly even if the underlying callback responds quickly. However if the timeout is too low, you risk intermittent fails any time the callback responds slowly. To avoid this you can use the [Watir `wait_until` method](http://wtr.rubyforge.org/rdoc/classes/Watir/Waiter.html#M000343), to poll for a situation where you know the callback has succeeded. This is more inline with how a real user will behave. ### Example

sharri.morris@7digital.com
Friday, September 14, 2012 - 13:21

At 7digital we use [Cucumber](http://cukes.info/) and [Watir](http://wtr.rubyforge.org/) for running acceptance tests on some of our websites. These tests can help greatly in spotting problems with configuration, databases, load balancing, etc that unit testing misses. But because the tests exercise the whole system, from the browser all the way through the the database, they can tend be flakier than unit tests. Then can fail one minute and work the next, which can make debugging them a nightmare. So, to make the task of spotting the cause of failing acceptance tests easier, how about we set up Cucumber to take a screenshot of the desktop (and therefore browser) any time a scenario fails. ## Install Screenshot Software The first thing we need to do is install something that can take screenshots. The simplest solution I found is a tiny little windows app called [SnapIt](http://90kts.com/blog/2008/capturing-screenshots-in-watir/). It takes a single screenshot of the primary screen and saves it to a location of your choice. No more, no less. * [Download SnapIt](http://90kts.com/blog/wp-content/uploads/2008/06/snapit.exe) and save it a known location (e.g.

sharri.morris@7digital.com
Monday, September 3, 2012 - 11:51

[TeamCity](http://www.jetbrains.com/teamcity/) is a great continuous integration server, and has brilliant built in support for running [NUnit](http://www.nunit.org/) tests. The web interface updates automatically as each test is run, and gives immediate feedback on which tests have failed without waiting for the entire suite to finish. It also keeps track of tests over multiple builds, showing you exactly when each test first failed, how often they fail etc. If like me you are using [Cucumber](http://cukes.info/) to run your acceptance tests, wouldn't it be great to get the same level of TeamCity integration for every Cucumber test. Well now you can, using the `TeamCity::Cucumber::Formatter` from the TeamCity 5.0 EAP release. JetBrains, the makers of TeamCity, released a [blog post demostrating the Cucumber test integration](http://blogs.jetbrains.com/ruby/2009/08/testing-rubymine-with-cucumber/), but without any details in how to set it up yourself. So I'll take you through it here.