liveBook · Manning

Incidental detail

As explained in Effective Behavior-Driven Development

Information in a scenario that is unnecessary to convey the behavior or rule being illustrated.

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
  Given the customer's basket is not empty
  Given 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

How Effective Behavior-Driven Development covers it

How deep it goes
Defines a relevance test and explains how unnecessary details burden readers and make scenarios brittle.
Examples
Uses checkout details such as time, URL, pizza choice, and basket state to distinguish relevant context from distraction.
What you can do after
Evaluate scenario details by checking whether changing them changes behavior, then remove or abstract irrelevant specifics.
How it connects
Connects scenario detail to real data, implicit context, and the BRIEF principle.

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.