3 BDD—the whirlwind tour

 

This chapter covers

  • An end-to-end walkthrough of BDD practices in action
  • Discovering features and describing them through stories and examples
  • Using executable specifications to specify features in detail
  • Using low-level BDD to implement features
  • Using BDD test results as living documentation
  • Using living documentation to support ongoing maintenance

In this chapter, we’ll look at a concrete example of how BDD might work on a real-world project. As you saw in the previous chapter, BDD involves the development team engaging in conversations with the customer throughout the project, using examples to build up a more concrete and less ambiguous understanding of what the business really needs. You write specifications in an executable form that you can use to define software requirements, drive their implementation, and verify the product you deliver. You can also apply these techniques during more high-level requirements analysis, helping you focus on the capabilities and features of the application that will genuinely add value to the business.

3.1 The BDD Flow

3.2 Speculate: identifying business value and features

3.2.1 Identifying business objectives

3.2.2 Discovering capabilities and features

3.2.3 Describing features

3.3 Illustrate: exploring a feature with examples

3.3.1 Discovering the feature

3.3.2 Slicing the Feature into User Stories

3.4 Formulate: from examples to executable specifications

3.5 Automate: from executable specifications to automated tests

3.5.1 Setting up a project with Maven and Cucumber

3.5.2 Recording the executable specifications in Cucumber

3.5.3 Automating the executable specifications

3.5.4 Implementing the glue code

3.6 Demonstrate: tests as living documentation

3.7 BDD reduces maintenance costs

3.8 Summary

sitemap