Transcript
Page 1: Making BDD fun  with Ruby and Cucumber

Making BDD fun with Ruby and Cucumber

Andrei Marfievici

Page 2: Making BDD fun  with Ruby and Cucumber

ContentWhat is BDD?

Why Ruby and Cucumber

Live Demo

Conclusions

Page 3: Making BDD fun  with Ruby and Cucumber

What is BDD?Inspired from TDD and complements DDD

It’s NOT unit testing where:Unit test tools are written mainly for developersTests are methods namesIt does a great job for object/module testingIt takes a technical person to understand the

assertions and failuresIt takes a lot of time to gain domain knowledge

Page 4: Making BDD fun  with Ruby and Cucumber

What is BDD?Story testing approach

Complex interactions between ALL the people involved in a project

Functionalities trigger the development process

Specs Features Behavior Scenarios

DDD defines the vocabulary (the words) whilst BDD defines the sentences to put the words in

Page 5: Making BDD fun  with Ruby and Cucumber

What is BDD?A functionality describes a feature

As a RoleI request a FeatureTo gain a Benefit

Example:Feature: Search for music data

As a Last.fm user I want to be able to search data So that I can listen to my favorite music

Page 6: Making BDD fun  with Ruby and Cucumber

Why Ruby and Cucumber?Describe features in plain text through scenarios

Cucumber understands Gherkin language

GWT approach for writing scenarios:Scenario: Basic Search

Given I navigate to http://www.last.fm When I search for “ac/dc” Then I get results back

Page 7: Making BDD fun  with Ruby and Cucumber

Why Ruby and Cucumber?Wrap code inside steps

Page 8: Making BDD fun  with Ruby and Cucumber

Why Ruby and Cucumber?Can be used as a scripting languagePowerful Lightweight OOP languageSize of the projectMulti-platformEasy to integrate with CI serversGreat support on ruby gemsIRB debugging and on-the-fly developmentA minus for serialization

Page 9: Making BDD fun  with Ruby and Cucumber

ConclusionsUnified SDLC through feature filesOutside-in approach

Feature coverage

Brings people together (“help me to help you”)

The power of concrete examples creativity

Great documentation for the projectValidation comes first


Top Related