"Fast" Is Not a Requirement: Quality Scenarios

Almost every requirements document contains a sentence like this: "The system must be fast, scalable, secure and user-friendly." Nobody disagrees with it. Nobody can test it either. And when the system turns out to be slow, everybody discovers they meant something different by "fast".

A quality scenario replaces the adjective with a short, concrete story: something happens, under certain conditions, and the system responds in a way you can measure. It is the most practical tool there is for making quality goals real, and it fits in one sentence.

Anatomy of a Quality Scenario

A scenario has six parts. The format comes from Bass, Clements and Kazman's Software Architecture in Practice.

  1. Sourcewho or what triggers it
  2. Stimuluswhat happens
  3. Environmentunder which conditions
  4. Artifactwhich part of the system
  5. Responsewhat the system does
  6. Response measurehow we know it worked
PartRoarline example
Source50,000 fans
Stimulusarrive within one minute of a sale opening
Environmentduring normal operation with the waiting room active
Artifactthe checkout
Responsegives admitted fans a seat decision
Response measurewithin 3 seconds for 99% of admitted fans

Read together: "When 50,000 fans arrive within one minute of a sale opening, during normal operation with the waiting room active, the checkout gives admitted fans a seat decision within 3 seconds for 99% of admitted fans." That is something a load test can pass or fail.

Try It: Fix a Vague Requirement

The builder starts with the kind of requirement most projects begin with. Rewrite each part until all three checks turn green, or switch quality and look at how Roarline did it.

Scenario builder

Not testable yet

Quality

Your scenario

Testable?

    Feedback

      Roarline's Quality Tree

      One scenario is a good start; a system needs a handful. A quality tree (in Software Architecture in Practice called a utility tree) organises them: qualities at the top, refinements below (which aspect of the quality), concrete scenarios at the leaves. Each scenario gets two ratings: how important it is to the business and how difficult it is to achieve. Scenarios rated high on both are the ones that shape the architecture.

      Ratings: importance to the business, then difficulty to achieve. H = high, M = medium, L = low.

      The two (H, H) scenarios explain most of Roarline's architecture on their own: the waiting room, strong consistency for seat reservations, and the decision to scale the application ahead of announced sales.

      From Scenario to Test

      A scenario you never check is a wish. The best scenarios turn into automated checks that run regularly, sometimes called fitness functions: tests for the architecture, not for a single feature.

      Roarline scenarioHow it is checked
      50,000 fans in one minuteA load test against a production-like environment before every announced sale
      Two fans, one seatA concurrency test in the build: 1,000 parallel buyers, one seat, exactly one sale
      Charged exactly onceFault injection: drop and delay payment responses, count the charges (see the idempotency simulation)
      Scanning without networkThe scanner app's test suite runs in flight mode for a simulated evening
      Payment changes stay in PaymentsArchitecture tests fail the build if any module other than Payments depends on payment-provider code. The 10-day limit itself is reviewed after each such change

      Common Mistakes

      Where Scenarios Live

      In arc42, the top three to five quality goals go into section 1, and the quality tree with its scenarios goes into section 10. ADRs can then name the scenario a decision serves, which makes the reasoning easy to check later: "We chose a waiting room because of the 50,000-fans scenario."

      Key Takeaways

      Further Reading

      Case study: RoarlineThe fictional ticketing platform behind these scenarios, with its goals, decisions and incidents.