Software Testing

Intermediate path · lesson 6 of 19

IntermediateTest design5 min readPublished November 12, 2026

Use case and scenario-based testing

Users don't use features one at a time. They pursue goals, get interrupted and take detours. Use case testing covers every path to a goal; scenario testing tells realistic stories that combine them.

On this page

Key takeaways

  • A use case describes how an actor reaches a goal: a main success flow, plus alternative and exception flows. Each flow is a test.
  • Scenario testing goes further: realistic, end-to-end stories that combine features the way real people do.
  • Both find what technique-by-technique testing misses: bugs between features, in the order real users actually do things.

Where this picks up

At the system test level, you test complete flows, not single fields. Decision tables and state models check rules inside a feature. Use cases and scenarios check whether a person can get something done, across features, with real-life detours.

Anatomy of a use case

The format was popularised by Alistair Cockburn's Writing Effective Use Cases (2000). A shortened example:

Use case: Book cinema tickets

Actor: Registered customer · Goal: Have valid tickets for a showing

Preconditions: Customer is logged in; the showing has free seats.

Main success flow:

  1. Customer chooses a film and a showing.
  2. System shows the seat map.
  3. Customer selects seats and ticket types.
  4. System holds the seats for 10 minutes and shows the total.
  5. Customer pays.
  6. System confirms and emails the tickets.

Alternative flows:

  • 3a. Customer applies a discount code.
  • 5a. Customer pays with a saved card.

Exception flows:

  • 4a. Selected seat was taken a moment earlier: system asks to choose again.
  • 5b. Payment declined: seats stay held; customer may retry.
  • 5c. Hold expires before payment: seats are released.

Postconditions: Seats are sold; tickets sent; payment recorded.

Deriving tests from a use case

The minimum is one test per flow: the main flow, plus each alternative and exception flow at least once. Here that's 1 + 2 + 3 = 6 tests.

Then strengthen them:

  • Check the postconditions, not just the screens. After a declined payment and a successful retry, is the payment recorded once? Are the seats still marked as sold?
  • Combine techniques inside steps. Step 3 has ticket types and quantities, so use partitions and boundaries there.
  • Look for missing flows. What if the customer presses Back during payment? What if the showing is cancelled during booking? Missing flows are questions for the team.

Scenario testing: telling stories

Use cases are structured and thorough. But real life mixes several use cases, odd timing and messy data. Scenario testing captures that with stories.

Cem Kaner described good test scenarios as stories that are credible (it could really happen), motivating (someone would care if it failed), complex (several features and steps) and easy to evaluate (it's clear whether it worked).

An example:

Ana books four tickets for her family on Friday evening: two adults, one child and one student. She applies a discount code from an email. Her phone battery dies during payment. She logs in on her laptop ten minutes later, finds the seats released, books again and pays with a saved card. On Saturday she cancels one ticket because her son is ill.

That one story touches ticket types, discounts, holds, timeouts, payment, sessions on two devices, cancellation and partial refunds. Each piece may work alone and still fail in this order.

Building good scenarios

  1. Start from real users. Personas, support tickets, analytics: who uses the product, and why?
  2. Pick a meaningful goal for that person, not a feature to test.
  3. Add real-life complications: interruptions, second devices, changes of mind, other users.
  4. Spread over time where the product does: today, tomorrow, after the event.
  5. Define how to judge it: what should be true at the end of the story?
Real-world exampleEvery feature worked; the weekend didn't

A hotel booking site had good coverage of booking, modifying and cancelling. Each feature passed its tests.

A tester wrote a scenario: a family books two rooms, changes one to a later date, then cancels the other because a grandparent can't come.

The result: the system cancelled the modified room, because modifying a booking had created a new booking ID that the cancellation screen didn't expect. Each feature was correct alone. The bug lived in the sequence.

Lesson: scenarios find bugs in how features combine over time, which is how customers actually use them.

Do

Write scenarios from real support tickets and user research. Real stories reveal paths nobody designed for.

Don't

Write "scenarios" that are only the main flow with a name added. Without complications, a scenario finds nothing a simple test wouldn't.

Check yourself

A use case has a main flow, 2 alternative flows and 4 exception flows. What's the minimum number of tests for full flow coverage, and what else would you check in each test?

Show answer

At least 7 tests: one for the main flow and one for each of the 6 other flows. In each test, check the postconditions too: data saved, money taken (once), notifications sent, and resources released when the flow ends in an exception.