making bdd fun with ruby and cucumber
DESCRIPTION
Making BDD fun with Ruby and Cucumber. Andrei Marfievici. Content. What is BDD? Why Ruby and Cucumber Live Demo Conclusions. What is BDD?. Inspired from TDD and complements DDD It’s NOT unit testing where: Unit test tools are written mainly for developers Tests are methods names - PowerPoint PPT PresentationTRANSCRIPT
Making BDD fun with Ruby and Cucumber
Andrei Marfievici
ContentWhat is BDD?
Why Ruby and Cucumber
Live Demo
Conclusions
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
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
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
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
Why Ruby and Cucumber?Wrap code inside steps
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
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