BDD (Behaviour-driven Development)

BDD is a specific form of test-driven development which focuses on behavioural specification.

It was created by Dan North.

“Behavior Driven Development is all about focusing the development effort on discovering and delivering the features that will provide business value.” BDD in Action

BDD was essentially to begin with a refactoring of test-driven development. One of the big refactorings was a change in the wording of the test names so they read more like specifications than tests. This language was formalised into a DSL for writing specifications, which can be linked to a layer of test code.

They are a form of executable specifications, which both validate the software and provide automatically updated technical and functional documentation.

  • Only build features that deliver business value
  • Work together to specify features
  • Embrace uncertainty
  • Illustrate features with concrete examples
  • Examples play a primary role in BDD
  • Don’t write automated tests, write executable specifications

Acceptance criteria give the team a way to objectively judge whether a feature has been implemented correctly or not. Wherever feasible, teams turn these acceptance criteria into automated acceptance tests, or, more precisely, into executable specifications.

  • Deliver living documentation

  • Benefits of BDD

    • reduced waste
    • reduced costs
    • easier and safer changes

“Automated regression tests frees up testers to perform exploratory testing, which is what they’re best at.” BDD in Action

“BDD is first and foremost about conversation.” BDD in Action

“One of the key goals of Behavior Driven Development is to help everyone to have a clear understanding of what a project is trying to deliver, and of the underlying business objectives of the project.” BDD In Action

Example high level business goals for ARC Dashboard. “Improve performance by quickly alerting managers to issues.” Essential features “Display key performance indicators in easy to understand format”

In order to improve the quality of my hosts
As a manager (facilitator)
I want to see key performance indicators that I can easily understand

Given there is a host where mentors have not been allocated to students When I view the dashboard Then I should be alerted that this host exists

“Make it easy to act upon any issues”

In order to improve the quality of my hosts
As a manager (facilitator)
I want to be able to easily act upon and identified issues

“Make it easy to alter values of each indicator” (this is more of an ARC stakeholder requirement…)

In order to provide useful key performance indicators
As a supervisor
I want to be able to easily amend the values displayed in the indicators

Stories might refine features further – still in ‘In order/As a/I want’ format) Then scenarios are concrete exmples of a story.

“Acceptance tests typically use a full or near-full application stack, whereas unit tests concentrate on individual components in isolation.” BDD In Action

We flip between acceptance tests and unit tests.

“Feature Injection takes BDD beyond scenarios and stories, and helps us discover what features we really need to satisfy the underlying business goals of a project.” BDD In Action

“Impact Mapping helps identify and visualize the relationship between business goals, stakeholders and features.” BDD In Action

“The aim of Feature Injection is to drive out the minimum set of features that will provide the most benefit to stakeholders” BDD In Action

“Capabilities give users or stakeholders the ability to realize some business goal or perform some useful task. A capability represents the ability to be able to do something: it does not depend on a particular implementation. For example, “the ability to book a flight” is a capability. Features represent software functionalities that we build to support these capabilities. “Book a flight online” would be a feature.” BDD In Action