liveBook · Manning

Chapter 7: Cleaning up an old scenario

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

The introduction explains why cleaning up long, complex, unreadable scenarios is worthwhile.

After this chapter you will be able to

What it builds on

Section by section

Introduction

The introduction explains why cleaning up long, complex, unreadable scenarios is worthwhile.

Key terms: shared understanding, maintenance efforts, domain

7.1 The old scenario

The section introduces an old customer-collection scenario and explains why its test-focused, hard-to-read form makes it a poor aid to collaboration.

Key terms: scenario, rule, customer-collection, Given, When, Then, And, automated regression test

7.2 Keep your scenarios BRIEF

This introduction distinguishes how easy Gherkin is to learn from the practice needed to write scenarios well.

Key terms: Gherkin, scenarios

7.2.1 The goals

This section sets three goals for scenarios: clarify expected behavior, support collaboration, and remain useful as the product evolves.

Key terms: documentation, expected behavior, descriptive, not exhaustive, collaboration, business and delivery, evolution of the product, specific behavior, unrelated behavior

7.2.2 The principles

This section explains six BRIEF principles for writing scenarios that communicate business behavior clearly and concisely.

Key terms: Business language, business domain, Real data, boundary conditions, underlying assumptions, Intention revealing, intent, mechanics, Essential, incidental

7.3 Using example maps to provide focus

The section shows how an example map helps a team rediscover existing behavior and refocus an old scenario on one clearly named rule and outcome.

Key terms: example map, customer collections, lift and shift, intention revealing, business language, authenticated, unauthenticated, pay-on-collection rule, expected outcome, Then

7.4 Document the essence of the behavior

The team trims an old scenario to highlight the pay-on-collection rule and prioritizes clear documentation over preserving its existing automation.

Key terms: Essential, Brief, incidental details, pay-on-collection rule, existing automation, essence of the expected behavior

7.5 Scenarios should read like a specification

The section shows how to make a scenario read like a specification by replacing implementation details with business language and descriptions of user intent.

Key terms: business language, solution domain, problem domain, BasketItemCount, intention revealing, click, UI, pay-on-collection rule

7.6 Use real data when it provides clarity

The section shows how to make a scenario clearer by replacing irrelevant real data and removing context already implied by the remaining steps.

Key terms: real data, actual data, abstract, descriptive term, payment instructions, pay-on-collection rule, implicit statement, Given

7.7 Communication, not testing

The team revises a customer-collection scenario to communicate the behavior it illustrates without specifying an authentication status that does not affect that behavior.

Key terms: scenario, document behavior, authenticated customer, unauthenticated customer, customer, automation code

7.8 Illustrative scenarios

The section explains how illustrative scenarios support stakeholder collaboration and learning, and how to keep them focused and maintainable while using AI as an aid rather than a substitute for human formulation.

Key terms: natural language, stakeholders, scenario automation tools, concrete example, single rule, illustrative scenarios, brevity, business domain abstractions, implementation details, AI

7.9 Summary

Where this is used later

Concepts explained in this chapter

← Chapter 6: What is formulation? Chapter 8: Formulating a feature →

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.