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
  • Choosing an automation strategy

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 then introduce the SUITABLE mnemonic that helps teams remember our eight key principles for BDD automation, before outlining the broad decisions that need to be made when choosing a test automation strategy.

12.1 Automation proof-of-concept

12.2 Document findings as patterns

12.3 BDD execution frameworks

12.3.1 Given/When/Then execution frameworks

12.3.2 Step definitions

12.3.3 Expressions and parameters

12.3.4 Custom parameter types

12.3.5 Hooks

12.3.6 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