Testing Tuesday #3: Behavior-Driven Development with Cucumber

Vote on Hacker News

This is the third episode of our new Testing Tuesday series and our first screencast. Every week we will share our insights and opinions on the software testing space. Drop by every Tuesday to learn more! Last week we talked about how to get from Test-Driven Development to Behavior-Driven Development.

Set up Continuous Integration and Deployment for your Ruby on Rails projects. The Codeship supports GitHub and BitBucket projects and about any techstack you can imagine.


BDD with Cucumber

Cucumber lets you write your feature in natural language and develop them behavior-driven afterwards. It is written in Ruby, but you can also use it with several other languages, including the Java Virtual Machine, Python and PHP. Check out the Wiki to find out more. In this screencast we’re creating a new feature in our Superhero Ruby on Rails app using Cucumber. We kept it quite simple though, so it won’t be too hard to follow along if you’re not familiar with Ruby.

Up next week: Continuous Integration and Deployment with Cucumber

Next week we will dive further into Cucumber and show you how to test and deploy our Superhero app on Codeship.

Further info:



Want to build tools for other developers and join a well funded startup? Join us and bring Continuous Deployment to every software team. We are hiring!

Author: Clemens Helm

I’m a passionate web application developer and Ruby on Rails enthusiast. I love building stunning web applications and start-ups that rock. And I love boarding – on the street, on water, on snow – there’s a board for every season.

  • https://www.codeship.io/ Florian Motlik

    Great post clemens

  • Clemens Helm

    Hi Tamás,

    Thanks for your great and extensive feedback! Some of your points I have already tried to change in this week’s episode that will be out in a few minutes. Of course I would love to get your feedback again!

    I don’t agree with you in every single point – for example I usually don’t specify decoration like images, because I think it makes your scenarios fragile. For example at Codeship, some builds failed because designers changed images or texts.

    Point 4 is clearly a mistake, sorry for that.

    With most of your other points i totally agree. I took some shortcuts for the sake of simplicity and not-teaching-too-much-at-once. But maybe I’m gonna make a “Cucumber best-practices” screencast in the future. Do you have more of them? Or maybe you’ve even got a blog post written about them?

    Finally, about regular expressions: Beauty is in the eye of the beholder. ;)
    I love them in Cucumber scenarios as long as they are simple and readable. And even simple ones can be so much more powerful than placeholders.

    Let’s keep in touch and thank you again!

  • Clemens Helm

    João, muito obrigado!

    Maybe you wanna check out my last blog post: http://blog.codeship.io/2013/04/22/From-tdd-to-bdd.html

    There I’m writing about getting from TDD to BDD which is the preferable approach in my opinion. Hope it will help you as well!

  • Mustafa Gamal

    Many thanks, it was helpful.

    only one comment is, how to prepare our application to work with cucumber and capybara?
    :)

  • http://www.andreobrown.com/ André O. Brown

    This screencast was very helpful! I had been trying to get my head around Cucumber for days, but couldn’t get to writing the scenarios. After watching this screencast I wrote my first scenario with six passing steps!

    • Clemens Helm

      André, I’m glad it helped you! Good luck with Cucumber!

  • bgiobbe

    Fun video :) Very clear and helpful. Thanks for recording it and making it available!

    • Clemens Helm

      Thanks! I’m glad I could help ;)