White Box Testing
Test your code
   Home      Behavior Driven Development
 

Behavior Driven Development

Behavior Driven Development is software development practices emerged from Test Driven development and developed by Dan North.
 
Working with Agile and TDD Dan North faced many issues that he overcomes by BDD by rethinking unit testing and acceptance testing.
 
North and others developed the BDD framework as a communication and collaboration framework/tools for developers, QA and non-technical or business stakeholders in a software project. Dan North gave the following description of BDD:
“BDD is a second-generation, outside-in, pull-based, multiple-stakeholder, multiple-scale, high-automation, agile methodology. It describes a cycle of interactions with well-defined outputs, resulting in the delivery of working, tested software that matters.”
 
He proposes
  • Test method name should be sentences
  • Unit test names should be whole sentences starting with the word "should" and should be written in order of business value.
  • An expressive test name is helpful when a test fails
  • “Behavior” is a more useful word than “test”
  • Requirements are behavior too
  • BDD provides a “ubiquitous language” for analysis.
Initially came with tests should be written using the standard agile framework of a User story:
As a [role]
I want [feature]
so that [benefit]
 
Finally came with acceptance criteria should be written in terms of scenarios and implemented as classes: 
Given [initial context]
when [event occurs]
then [ensure some outcomes]
 
Dan North created the first ever BDD framework, JBehave followed by a story-level BDD framework for Ruby called RBehave which was later integrated into the RSpec project. He also worked with David Chelimsky, Aslak Hellesoy and others to develop RSpec and also to write "The RSpec Book: Behaviour Driven Development with RSpec, Cucumber, and Friends". The first story-based framework in RSpec was later replaced by Cucumber mainly developed by Aslak Hellesoy