chapter twelve

12 Getting ready for BDD automation

 

This chapter covers

  • Taking the risk out of BDD automation
  • An overview of software design patterns
  • An overview of BDD execution framework features
  • Key principles of BDD automation and the SUITABLE mnemonic

Almost all software teams aspire to automate as much of their testing as possible. In practice, we have found that many test automation initiatives fail to deliver the expected benefits – faster feedback; increased coverage; reduced effort – and sometimes make matters worse by introducing new overheads, such as daily debugging of flakey automation. In this chapter we will see the WIMP team mitigate the risk of adopting BDD automation by treating it as a series of experiments.

There will always be some foundational learning needed when adopting a new way of working, which is why this chapter provides a whirlwind introduction to design patterns and BDD execution framework features. We also introduce the SUITABLE mnemonic that helps teams remember our eight key principles for BDD automation.

12.1 Proof-of-concept

The Where Is My Pizza (WIMP) team feels comfortable with their adoption of the Discovery and Formulation practices – and they are already seeing the benefits in their requirements and specifications. However, the team doesn’t yet feel confident enough to automate every scenario that they formulate.

It is not unusual for teams to feel this way. Common challenges that we have observed include:

12.2 Document findings as patterns

12.3 BDD execution frameworks

12.3.1 Step definitions

12.3.2 Expressions and parameters

12.3.3 Custom parameter types

12.3.4 Hooks

12.3.5 Organizing glue code

12.4 Key principles for “SUITABLE” BDD automation

12.4.1 Shortcuts

12.4.2 Understandable diagnostics

12.4.3 Isolated scenarios

12.4.4 Test-code quality

12.4.5 Atomic assertion

12.4.6 Business terminology

12.4.7 Loose coupling

12.4.8 Evolving

12.5 Automation strategies

12.6 Summary