Behavior-Driven Development (BDD) is a process that gives examples of how software should behave in various scenarios. This behavior is written in a format that is easily understood, tested, and integrated.
Understanding Behavior-Driven Development
During the software development process, there are often one or more disconnects present:
- The business is unable to define the desired outcome(s).
- The developer has little understanding of what needs to be built. In other words, the needs of the business.
- The business, in turn, has little understanding of the technical challenges associated with building the product.
Fundamentally, the disconnect is caused by a lack of communication. BDD seeks to bridge the communication gap between the business and the developer, resulting in products that deliver value, meet goals, and fulfill expectations.
In the next section, we will take a closer look at how this is achieved.
Implementing BDD practices
BDD is an approach that incorporates elements of Test Driven Development (TDD) and Acceptance Test-Driven Development (ATDD).
Indeed, developers who use BDD write acceptance criteria in a standard format that promotes clarity, easy integration, and automated testing. These criteria consist of vocabulary that stakeholders, experts, and engineers can all understand and agree upon.
Acceptance tests should be written using common templates such as the “Given-When-Then” formula or the “Role-Feature-Reason” matrix.
Each test in turn should be based on a user story using ubiquitous language. For example, software that processes loan applications should ideally have classes such as LoanApplication and Customer.
To further simplify the process, BDD incorporates domain-specific language (DSL) which uses English-like sentences to express both behaviors and desired outcomes.
Advantages and disadvantages Behavior-Driven Development
A business that is planning to implement BDD should be aware of the list of potential advantages and disadvantages to its software team.
- Better communication. This is perhaps the most obvious benefit of BDD, but extremely important in delivering value and increasing process efficiency.
- Shorter learning curve. Since BDD uses simple language, the learning time is naturally reduced.
- Increased reach. Another benefit of simple language is that it can reach a wider audience. This promotes stakeholder engagement and fosters a sense of collaborative work toward a shared vision.
- Discovery workshops. At the beginning of a project, BDD discovery workshops unearth additional capabilities and complexities. Specifications are detailed and described in terms of application behavior, so edge cases and many of the finer details are identified early. Ultimately, being aware of more scenarios initially leads to less rework during the later stages of the project.
- Prior experience. Although the focus of BDD is on simplicity, it does assume that practitioners have some experience in Test Driven Development.
- Incompatibility. The BDD methodology is incompatible with linear project management approaches such as the waterfall model.
- Reliance on the Three Amigos. A critical component of BDD is the regular and collaborative nature of communication between the developer, tester, and business. When one or more of the amigos is unwilling to devote the time or effort to communicate, the validity of user stories is compromised.
- Behavior-Driven Development is a means of increasing the collaboration between business people and technical people during agile software development.
- Behavior-Driven Development encourages teams to use simple language and concepts to formalize a shared understanding of how an application should behave.
- If implemented successfully, Behavior-Driven Development increases collaboration, communication, and increased reach. However, it does rely heavily on total commitment from each of the Three Amigos.
Main Free Guides: