FaceBook LinkedIn Twitter Flickr Interop Blog
|

Archive



Blog Categories


Getting to know Cukes

Is Behavior-Driven Development just syntactic sugar for integration testing? That's the question I have been asking more than once recently. There's RSpec, and there's Cucumber - if you are a Ruby developer you'd have heard about those. But why should you do BDD? Because BDD tests cover something Unit Tests don't? That's not the case - in terms of code coverage, BDD doesn't add anything.

(Take a Rails application for example. You can test model integrity with unit tests; application logic with functional tests; and user-app interaction flow with integration tests. That's complete coverage).

Having these doubts about BDD I was eager to sit in on the Cucumber session with Aslak Hellesöy. Things were a bit more involved than I thought. Firstly, it became obvious that Cucumber (or Gharkin, the DSL that powers it) parses human-readable text into strings into which regular expressions can be inserted at runtime.

(Ample amounts of human-readable text is what flashes in the eye when first viewing BDD code. It's easy to think of BDD as something only non-techies can read, but there's more to the picture).

Another interesting detail is that Cucumber follows a well-defined convention for testing. You are Given something, and When you do something else Then something third happens. That's a nice coupling of syntax and semantics. Function follows form. Otherwise it'd be easy to get an impression that nearly everything goes into a Cucumber test spec.

Upon asking Aslak what exactly is Cucumber for: is it mainly for stakeholder - developer communication or is it a superior testing tool aimed at the developer, I received the following answer:

"Cucumber is a stakeholder-team communication tool designed to add more value to the client, however it is also a good developer tool that is capable of providing project documentation at all stages of development: before-coding, during-coding, and after-coding".

A good and exhaustive answer. Now, is Cucumber for you?

by Oredev in Day 3 - Permalink - 0 comment

Name


Header




If You have five oranges and three lemons, how many fruits do You have?
(Please answer with numbers!)




telephone: +46-(0)40-602 3134 | fax: +46 (0)40 - 127276 | email: info@oredev.org

Founders

Welcome!

On the 2009 website, you can look at the program and watch the videos of the past 2009 Conference.

On the 2010 website you can submit your sessions to our call for papers, read about the partner opportunities for 2010 and find a link to the videos from 2009.


2009 2010