liveBook · Manning

Scenario

As explained in Effective Behavior-Driven Development

A business-readable description of an example system behavior and its expected outcome.

A scenario is a business-readable description of one example of expected system behavior. A team discovers examples while discussing a user story, then formulates selected examples as scenarios. The result helps stakeholders check that the team understood the requirement and gives developers a precise behavior to implement. section 1.3.3 section 1.3

A customer chooses to collect an order

Scenario: Unauthenticated customer chooses to collect order Given the customer is unauthenticated When they choose to collect their order Then they should be asked to supply contact details The Given states the relevant context, the When identifies the action, and the Then states the expected outcome. The name tells readers which behavior the example illustrates. section 8.3.2

A scenario is not a transcript of every click needed to reach an outcome. An old pay-on-collection scenario mixed searching, basket changes, checkout, payment, and confirmation into one long script. It was difficult to read and hard to diagnose when it failed. Focusing instead on the pay-on-collection rule makes the expected behavior easier to discuss and maintain. section 7.1 section 7.4

Keep the reader’s question—“What behavior does this illustrate?”—in view:

  • Use business language and concrete data that reveal the intention, rather than interface mechanics. section 7.9
  • Focus on one rule. Remove details that do not help explain it; aim for a short scenario, ideally five steps or fewer. section 7.9
  • State unusual context explicitly, such as a restricted customer. Leave ordinary assumptions implicit when stating them would only obscure the difference that matters. section 9.9
  • Choose wording for human clarity. A pronoun may avoid repetition, but it should not leave readers unsure which person acts or receives the outcome. section 9.5

Formulation is usually a delivery-team task, often done by a developer and tester after discovery; the product owner or business stakeholders then review the scenarios. A reviewed scenario can be automated with a tool such as Cucumber or Reqnroll. Its automation checks behavior and provides feedback, but its first job remains communicating the specification—not replacing collaboration with a test script. section 4.2.2 section 1.3.4

How Effective Behavior-Driven Development covers it

How deep it goes
Explains formulation, Given/When/Then structure, and readability principles, while deferring automation implementation details.
Examples
Uses customer-collection and pay-on-collection orders, restricted customers, and an electric kettle to distinguish relevant from implicit context.
What it assumes
Assumes an example discovered from a user story, but introduces scenario steps through their context, action, and outcome.
What you can do after
Practice/perform formulation and review of focused scenarios that communicate expected behavior and can guide implementation.
How it connects
Connects user stories, discovery, formulation, Gherkin, example mapping, and automated tests.

Also explained in

Compare how 7 books explain scenario →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Effective Behavior-Driven Development. The section links point to the parts of the book it draws on.