liveBook · Manning

What you will learn in Effective Behavior-Driven Development

by Gáspár Nagy and Seb Rose · Manning Early Access Program (MEAP)

Chapter by chapter

Chapter 1: What is BDD?

This introduction presents BDD as a way to turn an evolving conversation about business needs into a guide for development, while clarifying that BDD is not primarily about testing.

1.1 The missing links between business needs and software delivery · 1.1.1 Insufficient requirements · 1.1.2 Unreliable documentation · 1.1.3 Slow feedback · 1.2 Origins of BDD · 1.3 How BDD works · 1.3.1 Start with a user story · 1.3.2 Discovery · 1.3.3 Formulation · 1.3.4 Automation · 1.3.5 Testing · 1.3.6 BDD is a bridge · 1.4 Common challenges when adopting BDD · 1.4.1 Naming is hard · 1.4.2 BDD without the business · 1.4.3 Automation in isolation · 1.4.4 Unreadable documentation · 1.4.5 Unmaintainable automation · 1.5 Will AI make BDD irrelevant? · 1.6 How to begin implementing BDD · 1.6.1 Evolution, not revolution · 1.6.2 Collaboration · 1.6.3 Opinions have context · 1.6.4 Free lunch or silver bullet? · 1.7 Summary

What you learn in chapter 1 →

Chapter 2: Structured Conversation

This chapter introduces its plan to show how a software product team uses structured conversations in requirements workshops to discover a feature’s expected behavior.

2.1 Where is my pizza? · 2.2 A useful meeting · 2.3 Collecting examples · 2.4 Deliberate discovery · 2.5 Example Mapping in a nutshell · 2.6 How to establish structured conversations · 2.6.1 Collaborative · 2.6.2 Diverse perspectives · 2.6.3 Short · 2.6.4 Progressive focus · 2.6.5 Consensus · 2.6.6 Facilitation tips · 2.7 Summary

What you learn in chapter 2 →

Chapter 3: What is an Example?

Introduces the chapter’s questions about whether examples can specify a story and how many examples are needed, while previewing the topics to come.

3.1 How hard is concrete? · 3.2 Is all that concrete essential? · 3.3 Do we need more examples? · 3.4 Why stop now? · 3.5 Rules vs. examples · 3.6 My example illustrates multiple rules! · 3.7 Summary

What you learn in chapter 3 →

Chapter 4: Who does what and when

This introduction explains that teams should adapt BDD to their local development context rather than follow a fixed process.

4.1 The BDD approach · 4.2 BDD in Scrum · 4.2.1 Discovery · 4.2.2 Formulate · 4.2.3 Aligning tasks to scenarios · 4.3 BDD in Lean/Kanban · 4.4 BDD in distributed teams · 4.5 BDD in agentic software development · 4.6 BDD in fixed-scope projects · 4.7 BDD in regulated environments · 4.8 Summary

What you learn in chapter 4 →

Chapter 5: How to get the business involved

This introduction explains why business participation matters to BDD and why teams must demonstrate the value of collaboration in their own context.

5.1 Learn from your peers · 5.2 The one where the business is not involved · 5.3 BDD is for solving problems · 5.3.1 The product owner is overloaded · 5.3.2 Production issues are common · 5.3.3 It is hard to get the product to a deliverable state · 5.3.4 It is hard to get customers engaged with the product · 5.3.5 Deadlines are often missed · 5.3.6 Hard to get a good overview of the progress · 5.3.7 Introduction of new features causing unwanted side-effects · 5.3.8 Not being able to react fast enough to market changes · 5.3.9 “Bug vs. feature” debates within the team · 5.3.10 Changes regularly requested at the Sprint/feature reviews · 5.3.11 But my product owner never reads the scenarios · 5.4 Summary

What you learn in chapter 5 →

Chapter 6: What is formulation?

This introduction defines formulation as turning shared understanding of system behavior into a business-readable specification.

6.1 Shared understanding · 6.2 Many formats · 6.3 Gherkin overview · 6.4 Living documentation · 6.5 Scenario granularity · 6.6 Summary

What you learn in chapter 6 →

Chapter 7: Cleaning up an old scenario

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

7.1 The old scenario · 7.2 Keep your scenarios BRIEF · 7.2.1 The goals · 7.2.2 The principles · 7.3 Using example maps to provide focus · 7.4 Document the essence of the behavior · 7.5 Scenarios should read like a specification · 7.6 Use real data when it provides clarity · 7.7 Communication, not testing · 7.8 Illustrative scenarios · 7.9 Summary

What you learn in chapter 7 →

Chapter 8: Formulating a feature

Introduces feature files as Gherkin’s way of grouping related scenarios into readable documentation.

8.1 A sample feature file · 8.2 Gherkin basics · 8.2.1 Keywords · 8.2.2 Non-English language support · 8.2.3 Strict reading of the text · 8.3 The structure and syntax of a feature file · 8.3.1 Rules · 8.3.2 Scenario structure · 8.3.3 Multiple contexts · 8.3.4 Keeping context essential · 8.3.5 Is it a Given or a When? · 8.3.6 Multiple outcomes · 8.4 Gherkin tables · 8.4.1 Data tables · 8.4.2 Scenario outlines and examples tables · 8.4.3 Data variations · 8.4.4 Similar wording · 8.4.5 Keep tables readable · 8.5 Readable blocks of text · 8.6 Summary

What you learn in chapter 8 →

Chapter 9: A new user story

The chapter introduces a pay-on-collection requirement that the team will use as it formulates examples into scenarios.

9.1 Write it upwards · 9.2 Too many cooks · 9.2.1 Why not formulate during the discovery session? · 9.2.2 Shouldn’t the whole team formulate together? · 9.2.3 Don’t the product owners (POs)/business analysts (BAs) own the specifications? · 9.2.4 Shouldn’t the developers/testers focus on the implementation? · 9.2.5 Isn’t it more efficient for one person to do it? · 9.2.6 Should the same people always do the formulation? · 9.3 Quotation marks · 9.4 There’s no “I” in “Persona” · 9.5 Does repetition matter? · 9.6 Moving shared context into a background · 9.7 Unformulated examples · 9.8 Commenting in feature files · 9.9 Setting the context · 9.10 Stay focused on illustrating the rule · 9.11 Formulation gets faster · 9.12 Incremental specification · 9.13 Documenting with a tag · 9.14 Who does what and when · 9.15 Summary

What you learn in chapter 9 →

Chapter 10: Organizing the documentation

The introduction explains why long-lived Gherkin feature files should stay focused and be organized before a growing collection becomes difficult to maintain.

10.1 User stories are not the same as features · 10.2 Separation of concerns · 10.3 Documentation evolves · 10.4 Documenting the domain · 10.5 Tags are documentation too · 10.5.1 Tracking scenario automation lifecycle with tags · 10.5.2 Tagging scenarios with external identifiers · 10.5.3 Tagging scenarios with automation details · 10.6 Journey scenarios · 10.7 Structuring the living documentation · 10.7.1 Navigation · 10.7.2 Zooming in and out · 10.8 Documenting shared features · 10.9 Targeted documentation · 10.10 Summary

What you learn in chapter 10 →

Chapter 11: Coping with legacy

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

11.1 BDD on legacy projects · 11.2 Incremental documentation · 11.2.1 New behaviors · 11.2.2 The 80/20 rule · 11.2.3 Probability of change · 11.3 Making use of manual test scripts · 11.3.1 Conflicting goals · 11.3.2 Not all journeys are informative · 11.3.3 Shortcuts don’t always save time · 11.3.4 Ask the tester, not the test script · 11.4 Summary

What you learn in chapter 11 →

Chapter 12: Getting ready for scenario automation

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.

12.1 Automation proof-of-concept · 12.2 Document findings as patterns · 12.3 Scenario automation tools · 12.3.1 Given/When/Then scenario automation tools · 12.3.2 Step definitions · 12.3.3 Expressions and parameters · 12.3.4 Custom parameter types · 12.3.5 Matching steps to step definitions · 12.3.6 Hooks · 12.3.7 Organizing glue code · 12.4 Key principles for “SUITABLE” scenario 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 with fast feedback · 12.5 Automation strategies · 12.6 Summary

What you learn in chapter 12 →

Chapter 13: Spotlight patterns for automating narrative flow

This introduction explains why automated scenario steps should work together to preserve a focused business narrative.

13.1 Local Scenario Context pattern: learning to remember · 13.2 Shareable Scenario Context pattern: sharing data between step definitions in different classes · 13.3 Introduce and Refer pattern: separating introduction and reference · 13.3.1 What about “they”? · 13.3.2 Referring to more than one entity? · 13.4 Entity Selector pattern: selecting entities by phrases · 13.5 Summary

What you learn in chapter 13 →

Chapter 14: Prop cupboard patterns for managing input test data

This introduction explains why scenario automation needs ways to supply input test data without cluttering scenarios with incidental details.

14.1 Domain Default pattern for managing default test data · 14.2 Default Instance pattern: use defaults, but… · 14.3 Object Mother pattern: generate complicated test data structures · 14.4 Terminology Promotion pattern: expressing domain-specific data · 14.5 Data Table Accessor pattern: handling data table parameters · 14.6 Data Table Assertion pattern: asserting with data tables · 14.7 Validation Tester pattern: specifying and automating data validation · 14.8 Summary

What you learn in chapter 14 →

Chapter 15: Mise-en-scène patterns for layering the automation codebase

The introduction explains why a growing scenario-automation codebase needs clear responsibilities and why the WIMP team adds some REST API scenarios to its direct-code tests.

15.1 Automating though an outer interface · 15.2 Test Driver pattern: separating automation logic · 15.3 Infrastructure Layer pattern: separate infrastructure code · 15.4 Test Action pattern: simplified management of test actions · 15.5 Attempt Action pattern: when failure is allowed · 15.6 Polymorphic Driver pattern: reuse driver interfaces · 15.7 Stub Dependency pattern: stubbing an external service · 15.8 Related patterns · 15.8.1 Hexagonal Architecture pattern · 15.8.2 Screenplay pattern · 15.9 Summary

What you learn in chapter 15 →

Chapter 16: Outline patterns that support higher-level steps

The introduction explains the tension between keeping scenarios concise and automating the mechanical details needed for complex behavior.

16.1 Scenario Resource pattern: managing test resources · 16.2 Context Shortcut pattern: bring the application to the expected state · 16.3 Ensure pattern: managing implicit dependencies · 16.4 Approved Outcome pattern: atomic handling of complex assertions · 16.5 Summary

What you learn in chapter 16 →

Chapter 17: Dramatis personae patterns for clear naming of concepts

The introduction explains why clear, domain-based names for business concepts make scenarios easier to read and discuss.

17.1 Personas · 17.2 In-place Persona pattern: persona definitions in feature files · 17.3 Message Persona pattern: asserting user messages · 17.4 External Persona pattern: load test data from external sources · 17.5 Templated Persona pattern: customizing external data sets · 17.6 Summary

What you learn in chapter 17 →

Chapter 18: Dress rehearsal patterns for building confidence

The introduction explains why teams should regularly run scenarios against real services as well as stubs, while recognizing the feedback and reliability challenges this creates.

18.1 Challenges of using real databases for test execution · 18.2 Reset Before pattern: reset database before scenario execution · 18.3 Clean Start pattern: start each scenario with an empty database · 18.4 Seeded Data pattern: share common data across scenario executions · 18.5 Skippable Reset pattern: do not reset database after read-only scenario executions · 18.6 Patterns for snapshot databases · 18.6.1 Undo Changes pattern: only reset modified data · 18.6.2 Entity Finder pattern: find suitable data instead of creating it · 18.7 Summary

What you learn in chapter 18 →

Chapter 19: Technical note patterns for quick error recovery

The introduction explains why failing BDD scenarios need early, context-rich error reporting to make failures in a CI/CD pipeline quicker to diagnose.

19.1 Descriptive Assertion pattern: including context information in the error message · 19.2 Supplementary Attachment pattern: attaching execution context information to the test result · 19.3 Test Log pattern: recording scenario execution details · 19.4 Embedded Application Log pattern: including the application log with the test log · 19.5 Corroboration Check pattern: monitoring the application’s health indicators · 19.6 Fail-fast Check pattern: ensure that the preconditions have been met · 19.7 Summary

What you learn in chapter 19 →

Chapter 20: Staging patterns for adapting test execution

The chapter introduction explains why scenario execution must accommodate the different external services and customized deployments a system supports.

20.1 Test Configuration · 20.2 Test Configuration Provider pattern: provide uniform access to configuration settings · 20.3 Parameterized Execution pattern: extend the coverage of BDD scenarios · 20.4 Parameterized Scenario pattern: specify and verify requirement variations · 20.5 Summary

What you learn in chapter 20 →

Chapter 21: Stagecraft patterns for interacting with external resources

This introduction explains why costly external resources can slow scenario tests and why sharing them complicates parallel execution.

21.1 Test Environment Initialization pattern: getting ready for test execution · 21.2 Resource Pooling pattern: leasing pooled resources to scenarios running in parallel · 21.3 Test File System pattern: handling test files in a uniform way · 21.4 Patterns for asynchronous resources · 21.4.1 Active Waiting pattern: keep polling the resource · 21.4.2 Completed Event pattern: getting a notification when the resource produced some result · 21.4.3 Synchronous Testing pattern: turning the asynchronous behavior to synchronous for testing · 21.5 Summary

What you learn in chapter 21 →

Concepts explained in this book

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.