A scenario becomes harder to understand when it includes information that does not affect the rule being illustrated. Keep the details that clarify behavior; remove the ones that distract readers or make the scenario brittle. section 7.4 section 8.3.4
To decide whether a detail belongs:
- Ask whether changing it would change the behavior. If not, replace specific data with an abstract, descriptive term or remove it. section 7.6 section 8.3.4
- Keep real data when it reveals an assumption or edge case; otherwise, it may suggest a false connection to the behavior. section 7.6
- If a detail is needed to set up the system but not to understand the rule, consider placing it in the implicit context instead. section 8.3.4
A checkout scenario
The time of day, test URL, and pizza choice do not explain why a customer can pay on collection. A shorter scenario can state that the basket is not empty, the customer has chosen collection, and payment on collection is available. section 7.4 section 7.6
Listing 7.7 Sixth edit – remove inessential context
Scenario: Unauthenticated customer chooses to pay on collection Giventhe customer's basket is not emptyGiven the customer has chosen to collect their order When they proceed to payment instructions Then they should be able to choose to pay on collection
Compare this streamlined checkout scenario with earlier versions to see how removing inessential context keeps the rule clear. section 7.6
