liveBook · Manning

Chapter 11: Coping with legacy

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

Introduces why adopting BDD while working with existing code matters, using the WIMP team as an example.

After this chapter you will be able to

What it builds on

Section by section

Introduction

Introduces why adopting BDD while working with existing code matters, using the WIMP team as an example.

Key terms: legacy code, BDD practices

11.1 BDD on legacy projects

The section distinguishes recovering and testing existing behavior from BDD that drives development, explains the costs of documenting behavior late, and describes a limited role for AI in modernizing legacy systems.

Key terms: Behavior Driven Development, discovery, formulation, Gherkin scenarios, Cucumber, example mapping, illustrative scenarios, current behavior, failing scenarios and tests, tightly coupled architectures

11.2 Incremental documentation

This section recommends a risk-based, incremental approach to documenting a legacy codebase rather than applying discovery and formulation to all of it at once.

Key terms: discovery, formulation, legacy codebase, risk-based, incremental strategy

11.2.1 New behaviors

This section explains how a team can begin using BDD in a legacy codebase by documenting existing behavior in an area it is about to change, then using BDD to guide implementation.

Key terms: discovery, formulation, example map, business readable documentation, automation

11.2.2 The 80/20 rule

The section recommends documenting a small set of core behaviors for broad coverage of a legacy system while limiting journey scenarios to avoid maintenance costs.

Key terms: 80/20 rule, Pareto Principle, domain experts, core behaviors, focused behaviors, journey scenarios, maintenance burden

11.2.3 Probability of change

Prioritize documenting frequently changed parts of a legacy system, and recognize that starting BDD later can still help stabilize releases.

Key terms: source control system, documenting, change frequently, BDD, legacy system, well selected scenarios

11.3 Making use of manual test scripts

The section introduces the question of what to do with existing manual test scripts on a team adopting BDD.

11.3.1 Conflicting goals

The section contrasts the goals of illustrative scenarios and manual test scripts, then explains why directly converting manual scripts into automated scenarios is usually a poor choice.

Key terms: illustrative scenarios, BRIEF, manual test scenarios, manual test scripts, formulate, maintenance burden

11.3.2 Not all journeys are informative

Explains why manual test scripts should be analyzed rather than automatically turned into journey scenarios.

Key terms: journey scenario, illustrative scenarios, manual test scripts, big picture

11.3.3 Shortcuts don’t always save time

This subsection explains why old manual test scripts are more useful as prompts for discovering behavior than as documents to analyze exhaustively.

Key terms: manual test scripts, automated illustrative scenario, example mapping, knowledge recovery

11.3.4 Ask the tester, not the test script

Use the knowledge behind legacy test scripts—especially testers’ expertise—to recover implemented requirements, while treating AI-generated scenarios as suggestions to review.

Key terms: test scripts, example mapping, domain knowledge, testers, manual test scripts, business intent, AI agents, illustrative scenarios, rules

11.4 Summary

Concepts explained in this chapter

← Chapter 10: Organizing the documentation Chapter 12: Getting ready for scenario automation →

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.