Get Started With Behaviour-Driven Development Focusing on the Domain Instead of on the Database
BDD lets developers focus on user stories and behaviour in the business domain when building up logic and tests and is often used to define acceptance criteria during discussions with clients, Julie, a Microsoft MVP since 2003, working as a consultant and mentor on the .NET platform, explains. New to BDD, Julie has implemented a small working example using Visual Studio, C# and SpecFlow.
SpecFlow is an open source tool for BDD on the .NET platform and part of the Cucumber family supporting other platforms. They describe a user story with scenarios using Gherkin, a language based on keywords, the most important being Given, When and Then. Julie gives a small example of a scenario:
Given a user has entered information about a customer
When she completes entering more information
Then that customer should be stored in the system
SpecFlow integrates with Visual Studio and can generate and execute tests in order to validate the rules in these scenarios. Starting from a simple user story, Julie uses these tools to create a test project and walks through the steps needed to create and run the tests for the scenarios that describe the user story.
Julies sees herself as a data geek but cares very much about working with clients and understanding their businesses. She therefore believes that Domain Driven Design (DDD) and Behaviour Driven Development are important principles to follow.
More Getting Started guides and documentation can be found on the SpecFlow site.
BDD was developed around 2006 by Dan North who has written both an introduction and about stories from a BDD perspective.
Specification by Example is way of defining requirements closely related to BDD.