liveBook · Manning

Chapter 12: Getting ready for scenario automation

What you will learn in chapter 12 of Effective Behavior-Driven Development

This introduction explains why scenario automation can be risky and clarifies how the book’s tool-specific examples relate to its largely language-independent patterns.

After this chapter you will be able to

What it builds on

Section by section

Introduction

This introduction explains why scenario automation can be risky and clarifies how the book’s tool-specific examples relate to its largely language-independent patterns.

Key terms: scenario automation, faster feedback, increased coverage, reduced effort, flakey automation, Cucumber family, Reqnroll, SpecFlow, pattern catalog, language/platform independent

12.1 Automation proof-of-concept

The section explains why a team might temporarily delay scenario automation and how a focused, collaborative proof-of-concept can help it establish an automation solution.

Key terms: scenario automation, quality debt, automation-first approach, proof-of-concept (POC), discovery, formulation, automation solution, pairing, ensemble, POC

12.2 Document findings as patterns

This section explains how to capture recurring scenario-automation solutions as design patterns, document and select them by context, and organize them for human and AI use.

Key terms: software design pattern, recurring challenge, context, descriptive name, challenge, tradeoffs, codebase, intent, constraints, complexity

12.3 Scenario automation tools

Scenario automation tools turn formulated scenarios into executable tests, run them at different scopes, and connect scenario text to automation code supplied by the team.

Key terms: scenarios, scenario automation tools, automation logic, executable test, scenario outlines, example row, subset of scenarios, standalone test execution tool, native test execution environment, platform

12.3.1 Given/When/Then scenario automation tools

This subsection explains that Given/When/Then automation tools share a broad approach but differ in how they register and match scenario steps.

Key terms: step definition registration, registered expression, Gherkin keyword, [StepDefinition] attribute, scenario automation tools, ports, Cucumber-JVM, Reqnroll

12.3.2 Step definitions

This section explains how reusable step definitions turn scenario steps into executable automation, how tools match steps to definitions, and what happens when matching fails.

Key terms: step definition, scenario automation tool, building blocks, suggested step keyword, text expression, undefined step, ambiguous step, method attribute, annotation

12.3.3 Expressions and parameters

This section explains how Cucumber Expressions match scenario steps to step definitions and how parameter values, docstrings, and data tables reach those definitions.

Key terms: Cucumber Expressions, step definition, parameter placeholders, {string}, {word}, optional text, alternate text, unambiguous terms, data tables, docstrings

12.3.4 Custom parameter types

This section explains how custom parameter types convert text captured by Cucumber Expressions into step-definition values, and how Reqnroll registers and extends them.

Key terms: custom parameter type, Cucumber Expressions, [StepArgumentTransformation], step definition, [Binding], Name, regular expression, capture groups, color parameter type, Color.Red

12.3.5 Matching steps to step definitions

This section explains how step definition expressions are matched to scenario steps, what happens when matching fails or is ambiguous, and why simple expressions are easier to maintain.

Key terms: step text, step definition expression, custom parameter types, regular expressions, undefined step exception, ambiguous step exception, step definition, step definition expressions, custom parameter type definitions, matching logic

12.3.6 Hooks

This section explains how hooks run automation logic around scenario events and how to register, order, and restrict them.

Key terms: hook, before-scenario hook, after-scenario hook, before-all, after-all, before-step, annotated method, Reqnroll, Order property, tag expression

12.3.7 Organizing glue code

This section explains what glue code is, why it is organized for reuse rather than by feature file, and how glue-class instances keep scenario data isolated.

Key terms: glue code, step definitions, hooks, custom parameter types, global scope, glue classes, StepDefinitions, Support, Given steps, When and Then steps

12.4 Key principles for “SUITABLE” scenario automation

Introduces SUITABLE, the authors’ eight principles for successful BDD scenario automation, with a brief meaning for each.

Key terms: Shortcuts, Isolated scenarios, Evolving with fast feedback, Understandable diagnostics, Test-code quality, Atomic assertions, Business terminology, Loose coupling

12.4.1 Shortcuts

This section explains how to keep scenario setup business-readable while using automation shortcuts to establish the required starting state.

Key terms: BRIEF, illustrative examples, named abstraction, Given, shortcut, starting context, step definition, test database, test API

12.4.2 Understandable diagnostics

This subsection explains why scenario automation needs clear diagnostics when new behavior causes failures.

Key terms: understandable diagnostics, error messages, test logs, cognitive load

12.4.3 Isolated scenarios

This section explains why automated scenarios need isolated execution contexts so they can run independently, in any order, or in parallel without slowing feedback.

Key terms: isolated scenarios, execution context, feedback loop, external services and resources

12.4.4 Test-code quality

This section explains why test automation code deserves the same attention to quality as production code.

Key terms: test automation code, business-readable specification, test-code quality, production code

12.4.5 Atomic assertion

This section explains why multiple assertions in one step definition can hide diagnostic information and recommends checking and reporting multiple verifications through a single atomic assertion.

Key terms: assertions, step definition, atomic assertion, diagnostic message

12.4.6 Business terminology

This section recommends using business-domain terminology consistently throughout a system to make its behavior and design easier to reason about.

Key terms: abstractions, business domain terminology, Ubiquitous Language

12.4.7 Loose coupling

Loose coupling lets scenario automation choose how to exercise behavior and replace dependencies, improving feedback speed and test coverage.

Key terms: loose coupling, well-defined interfaces, dependencies, speed of feedback

12.4.8 Evolving with fast feedback

This section explains how BDD advances in small scenario-driven steps and why fast feedback makes those steps practical.

Key terms: iterative and incremental, scenario, automated scenarios, fast, frequent feedback, build process, stakeholders, full test suite, every commit

12.5 Automation strategies

This section explains how to choose a context-dependent scenario automation strategy that balances fast feedback with confidence in the application’s behavior.

Key terms: BDD, automation strategy, scenario automation tools, business-readable specification steps, inner, outer, outer technical, UI, integration error, external infrastructure

12.6 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 11: Coping with legacy Chapter 13: Spotlight patterns for automating narrative flow →

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.