Introduction to Behaviour-driven development (BDD)

Behaviour-driven development (BDD) is a software development methodology in which an application is specified and designed by describing how its behaviour should appear to an outside observer. 

In software engineering, behavior-driven development is an Agile software development process that encourages collaboration among developers, QA and non-technical or business participants in a software project.

Many Software Project suffer from low quality communication between the domain expert and programmer on the project. Domain expert are less technical and they use their jargon and developer want to interpret things in simple way because of less domain knowledge. So, there was need for ubiquitous language which everybody can understand in team.

BDD uses examples to illustrate the behaviour of the system that are written in a readable and understandable language for everyone.

Some key points about BDD:

  • BDD is also referred to as Specification by Example.
  • BDD is Shifting from thinking in "tests" to thinking in “behaviour”
  • Behaviour Driven Development (BDD) is a software Development process that originally emerged from Test Driven Development (TDD). 
  • In BDD the behaviour represent both the specification and the test cases.
  • It provide a shared process and tools promoting communication between developers, testers, BA and other stakeholders.
  • It provide better readability and visibility.
  • BDD is about implementing the software by describing its behaviour from the perspective of its stakeholders and customers.
  • Tools which supports BDD Cucumber, Behat, Jasmin, Concordion and JBehave.
  • BDD not only helps you develop software correctly, but it ensure you develop the correct software.

Benefits of BDD:

  • Strong collaboration: With BDD, all the involved parties have a strong understanding of the project and they can all have a role in communication and actually have constructive discussions. BDD increases and improves collaboration. It enables everyone involved in the project to easily engage with the product development cycle. And by using plain language, all are able to write behavior scenarios.
  • High visibility. By using a language understood by all, everyone gets a strong visibility into the project's progression.
  • The ubiquitous language: As mentioned earlier, the ubiquitous language is understandable by all the members of the team, which reduces misconceptions and misunderstanding and makes it easier for new members to join the working process.
  • Meets user need: By focusing on the business’s needs, you get satisfied users, and that implies a happy business, of course. With BDD, as its name says, you focus on the behavior, which has a stronger impact than the implementation itself. 
  • Lower costs: By improving the quality of the code, you are basically reducing costs of maintenance and minimizing the project’s risks.

Limitations of BDD:

  • Two-fold: Because communications between the user and the developers are essential, if the user is not available, it will be difficult to work past ambiguities and questions generated by the user stories.  If your culture is one where business people and engineers do not communicate with each other at all or often enough, the transition to BDD will be difficult.
  • Dedicated Team: BDD requires complete specification before the sprint starts. The second disadvantage is the need to dedicate a team of developers to work with the client. The short response time required for the process means high levels of availability. All this upfront work could be an issue for small teams and rapid projects, and the extra effort can slow them down without paying off.
  • Insufficient budget: The transition to BDD—as with any other change to the software development lifecycle—requires not only new development and testing processes, but also a monetary investment. You need to train business people and engineers on how to communicate better, elaborate a domain-specific vocabulary and ubiquitous language, start or adjust your test automation, and implement test-driven development, and all of these new initiatives require money.

Video Tutorial: Introduction to Behaviour-driven development (BDD)