Behavior Driven Development with Cucumber


Reading Time: 1 minute


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.

Sign up for a free Codeship Account

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:

Subscribe via Email

Over 60,000 people from companies like Netflix, Apple, Spotify and O'Reilly are reading our articles.
Subscribe to receive a weekly newsletter with articles around Continuous Integration, Docker, and software development best practices.

We promise that we won't spam you. You can unsubscribe any time.

Join the Discussion

Leave us some comments on what you think about this topic or if you like to add something.

  • 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:

    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?


  • 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 ;)