by 27 Aug 2015
Still building products that don’t meet business needs? Use Behaviour Driven Development
share on

Still building products that don’t meet business needs? Use Behaviour Driven Development

Let’s run an experiment involving two couples, one old and the other young.

The first couple has dated a few times while the second couple is married with children and grandchildren.

Both the women ask their partners to select a pastry for them.

Which guy would have the greater chance of getting his choice right, the younger guy who has just meet the girl or the older man who has been living with his wife for fifty years?

The grandfather would likely ace the test. He knows his wife’s favorite type of pastry. He will walk into a bakery, place the order and leave immediately. The younger guy would pick a pastry and hope his choice was right.

Solving the communication gap in software development

Software development has a problem similar to what the younger guy faces.

Too often there is a huge communication gap between business and engineers. The former expects too many features without having a firm grasp of the technical limitations and the latter has trouble understanding what business wants.

This results in waste of time and overwork as both the business side and the engineering side are often at cross purposes, and the final product that emerges is complex and barely functional.

Behavior Driven Development is an Agile development methodology that aims to change this state of affairs.

There are several benefits of BDD:

The guts of Behavior Driven Development

In the words of Dan North, BDD’s originator it is “an “outside-in” methodology. It starts at the outside by identifying business outcomes, and then drills down into the feature set that will achieve those outcomes. Each feature is captured as a “story”, which defines the scope of the feature along with its acceptance criteria. 

There are two parts to BDD:

A typical BDD project would have the following elements in it:

1. Setting up SMART goals

Most software development process hits snags when business outcomes like “increase in revenue and decrease in operating costs” are not specific enough to be of help in writing software.

BDD solves this problem by having a business goal which has to be SMART (Specific, Measurable, Attainable, Relevant and Time Bound).

2. Impact Mapping

After SMART goals, the Impact Map is designed which helps the team lay out all the ways in which the specific goal can be reached.

An Impact Map is a mindmap that has four levels and looks like this (source)

Impact Map is an Agile requirement gathering technique that provides a visual overview of what steps should be taken to achieve a goal.

BDD Impact map

“Why” is the goal, and “Who” are the actors (customers or internal teams) who can help achieve the goal. The “How “denotes the ways in which their specific behavior can be impacted, and the “What” lists the steps that the stakeholders need to implement to have the desired impact.

3. Setting priorities

In every project it’s imperative to set priorities so that business gets the most critical features first. This is decided in BDD by using two techniques called value analysis and complexity analysis.

Value analysis lets the stakeholders pick up low cost high value features and complexity analysis is used for picking the right development and collaboration approach to the entire project as well as to individual features.

These techniques can be implemented using a number of different frameworks.

4. Using stories in planning

Because Agile has a very short development cycle there is always the danger that engineers might build something that business doesn’t want, and their entire work might be wasted.

BDD uses stories in ubiquitous language to make everything unambiguous. Every story has a fixed template and looks like this:

Title (one line describing the story)
Narrative:
As a [role]
I want [feature]
So that [benefit]
Acceptance Criteria: (presented as Scenarios)
Scenario 1: Title
Given [context]
And [some more context]...
When  [event]
Then  [outcome]
And [another outcome]...
Scenario 2: ...
Here is an example of stories in action and how they can be used directly in development:
Story: Account Holder withdraws cash
As an Account Holder
I want to withdraw cash from an ATM
So that I can get money when the bank is closed

Scenario 1: Account has sufficient funds
Given the account balance is \$100
And the card is valid
And the machine contains enough money
When the Account Holder requests \$20
Then the ATM should dispense \$20
And the account balance should be \$80
And the card should be returned
Scenario 2: Account has insufficient funds
Given the account balance is \$10
And the card is valid
And the machine contains enough money
When the Account Holder requests \$20
Then the ATM should not dispense any money
And the ATM should say there are insufficient funds
And the account balance should be \$20
And the card should be returned
Scenario 3: …

Business can now write stories around features and have the assurance that there would be no ambiguity.

Conclusion

BDD is a methodology that’s highly collaborative in nature. It assumes that no single person has the answers to all the problems, and it seeks to develop a framework that can streamline collaboration in fast paced Agile environments.

BDD has a simple role: moving the business analysts, developers and testers on the same page so that features that business needs can be delivered without the minimum of delay.

Recent Posts

get in touch

We're here to help!

Terms of use
Privacy Policy
Site Map
2015 IT Exchange, Inc