Test Scenarios

A test scenario is a one-line statement of a situation the system must handle: who does what, under which condition, and which outcome matters. "A customer cancels an order paid by card before it is out for delivery and gets a full refund" is a scenario. It says what will be tested, not how: no steps, no exact data, no screen details.

Each scenario is usually expanded later into one or more test cases. Scenarios come first because the whole team can review a short list of one-line situations in minutes.

Why it matters

The most expensive gaps are situations nobody thought of, and a pile of detailed test cases hides them. Teams that jump from a story to test cases often write many cases for the main path and none for the refund that fails or the user who changes their mind. A scenario list shows the scope at a level where such gaps stand out.

Scenarios are also the cheapest way to agree on scope: the product owner and developers can review them before anyone writes steps, and a scenario whose expected result nobody can state is a requirement question found before coding.

What a test scenario is, and what it is not

A good scenario names an actor, a situation and the outcome that matters, and traces to its source: a user story, an acceptance criterion, a step in a business flow or a risk. It does not depend on screens or concrete data, so it survives a redesign.

"Test scenario" is not a key term of the ISTQB Foundation syllabus, and teams use it in different ways. The nearest ISTQB terms are the test condition, a testable aspect of a component or system identified as a basis for testing, and the test procedure, a sequence of test cases in execution order. A scenario often combines several test conditions into one situation a user goes through from start to end. Teams that use the word for an ordered sequence of test cases mean something close to a test procedure.

  • Good: "A customer tries to cancel an order that has already gone out for delivery."
  • Too vague: "Test order cancellation." It names a feature, not a situation.
  • Too detailed: "Open order 1042, tap Cancel, tap Yes, check the message." That is a test case.

Scenario versus test case

The scenario answers "which situation do we test?"; the test case answers "exactly how, with which data, and what result?". One scenario usually expands into several test cases, one per variation of data, state, role or boundary, and each case traces back to its scenario and through it to the requirement.

  • Detail: a scenario is one line; a test case has preconditions, data, steps and an expected result.
  • Purpose: scenarios agree on scope and expose gaps; test cases make execution repeatable.
  • Readers: product owners review scenarios; test cases are for whoever executes them, a person or a tool.
  • Change: a redesigned screen changes test cases, while scenarios usually stay the same.
Scenario TS-04 names one situation, a late cancellation, in one line; its three test cases add the order status, the payment method and an exact expected result.

Test scenarioone line

Which situation do we test?

Contains:
Actor, situation, the outcome that matters, its source
Purpose:
Agree on scope, expose missing situations
Reviewed by:
Product owner, developers and testers
After a screen redesign:
Usually unchanged
  • TS-04 A customer tries to cancel an order that has already gone out for delivery

Test casesone per variation

Exactly how, with which data, and what result?

Contains:
Preconditions, test data, steps, expected result
Purpose:
Repeatable execution, unambiguous results
Reviewed by:
Testers, and whoever runs the tests: a person or a tool
After a screen redesign:
Steps and checks may need updating
  • TC-04.1 Out for delivery, paid by card: refused, reason and support link
  • TC-04.2 Out for delivery, cash on delivery: refused, same message
  • TC-04.3 Delivered, paid by card: refused, nothing changes
TS-04  A customer tries to cancel an order that has already gone out for delivery

TC-04.1  Order "Out for delivery", paid by card
         Expected: refused; the app gives the reason and a link to support;
                   order status and payment unchanged
TC-04.2  Order "Out for delivery", cash on delivery
         Expected: refused with the same message as TC-04.1; status unchanged
TC-04.3  Order "Delivered", paid by card
         Expected: refused; order status and payment unchanged

Try it: Test Scenario Generator

Deriving scenarios from stories and flows

A user story names one goal, and its acceptance criteria state the rules. Walk the flow a user follows to that goal, using the story, any flow diagram and the states the main object passes through, and ask at every step what else can happen.

Look for three kinds of flow. The main flow, often called the happy path, is the usual way to the goal. An alternative flow is another valid route with no error: another payment method, or a user who changes their mind and stops. An exception flow is what happens when something goes wrong: a rule refuses the action, a dependency such as a payment provider fails, or data changes while the user acts. Most exception flows end without reaching the goal, but some recover and rejoin the main flow.

  • Write the main flow as a few short steps from the user’s point of view.
  • At each step, ask which other choice, data, state or role is possible, and what can go wrong. Every answer that changes the outcome is a candidate scenario.
  • Make sure every acceptance criterion has a scenario.
  • Give each scenario an id, a flow type and a source. If you cannot state its expected result, write a question for the product owner.

Try it: User Story → Test Scenarios

Worked example: cancelling a grocery order

The story below comes from a grocery delivery app. Its main flow: the customer opens the order, taps Cancel and confirms; the order becomes Cancelled, a card payment is refunded and a confirmation arrives. Walking that flow gives the six scenarios under the story: one main, two alternative and three exception flows.

TS-05 and TS-06 have no expected result in the criteria: nothing says what happens when the refund fails, or which moment counts for a late cancellation, opening the dialog or confirming it. Both became questions for the product owner before anyone wrote a test case.

GRO-31  Cancel an order
As a customer, I want to cancel an order I placed,
so that I do not pay for something I no longer need.

AC1  An order can be cancelled until it is out for delivery.
AC2  Cancelling refunds the full amount paid to the card used for payment;
     a cash-on-delivery order needs no refund.
AC3  An order that is out for delivery cannot be cancelled: the app says why
     and shows a link to support.
AC4  After cancelling, the customer gets a confirmation in the app and by SMS.
Order statuses: Placed > Packed > Out for delivery > Delivered, or Cancelled

Scenarios
TS-01  main         AC1, AC2, AC4
       Cancel a card-paid order before it is out for delivery: cancelled,
       full amount back to the card, confirmation in the app and by SMS
TS-02  alternative  AC1, AC2, AC4
       Cancel a cash-on-delivery order: cancelled, no refund, confirmation sent
TS-03  alternative  no criterion (confirm step of the flow)
       Open the cancel dialog, then keep the order: the order stays as it was
TS-04  exception    AC1, AC3
       Try to cancel an order that has gone out for delivery: refused, with the
       reason and a link to support
TS-05  exception    no criterion
       The refund to the card fails at the payment provider: expected result?  Q1
TS-06  exception    AC1, AC3
       The order goes out for delivery while the cancel dialog is open:
       which moment counts, opening the dialog or confirming it?  Q2

Scenario coverage: is anything missing?

Scenario coverage asks whether every item of the test basis you chose, such as acceptance criteria, flows, states, roles or risks, is exercised by at least one scenario. Map them in a table with one row per scenario and one column per item: a simple traceability matrix. An item with no scenario is a gap in your tests; a scenario with no item is a gap in the requirement or work outside the story, and it deserves a question.

Scenario coverage for cancelling a grocery order: six scenarios exercise all four acceptance criteria, TS-03 and TS-05 trace to no criterion, and TS-05 and TS-06 end in open questions.
ScenarioAC1cancel until out for deliveryAC2full refund to the cardAC3late cancellation refusedAC4confirmation in app and SMSExpected result
TS-01main · cancel, paid by cardexercisedexercisednot exercisedexercisedstated in the criteria
TS-02alternative · cash on deliveryexercisedexercisednot exercisedexercisedstated in the criteria
TS-03alternative · keeps the ordernot exercisednot exercisednot exercisednot exercisedobvious: order unchanged
TS-04exception · out for deliveryexercisednot exercisedexercisednot exercisedstated in the criteria
TS-05exception · refund failsnot exercisednot exercisednot exercisednot exercisedopen: question Q1
TS-06exception · goes out during the dialogexercisednot exercisedexercisednot exercisedopen: question Q2
  • The scenario exercises the criterion
  • Expected result not settled: a question for the product owner

Coverage on paper: a criterion is exercised only when the test cases derived from these scenarios have run, and shown to be met only when they pass.

  • Criteria coverage: 4 of 4. AC1 is exercised by four scenarios, and AC2, AC3 and AC4 by two each.
  • Flow coverage: 6 of 6, but only for the flows on the list; a flow nobody thought of is not in the denominator.
  • Coverage counts items, not depth: AC2’s key checks, the exact amount and the same card, belong in its test cases.
  • This is coverage on paper: the criteria are exercised only when the test cases derived from the scenarios have run, and shown to be met only when those tests pass.

Try it: Requirements → Test Scenarios Try it: Requirements → Test Cases

Common mistakes

  • Writing scenarios full of clicks and data, so the list becomes too long to review and breaks with every redesign.
  • Writing scenarios so broad, like "test checkout", that nobody sees what is missing.
  • Deriving scenarios only from the main flow and the written criteria, and forgetting the alternative and exception flows.
  • Leaving out the source of each scenario, so coverage cannot be checked and changes cannot be traced.
  • Guessing an expected result the requirement does not give, instead of asking.
  • Reading 100% scenario coverage as proof that testing is complete.

The QA perspective

Draft scenarios as soon as a story is ready for refinement, and read them aloud with the product owner and a developer: business people correct a wrong scenario in seconds, and developers add exception flows they know the code handles, such as timeouts and retries. Keep the list on the story or in the test management tool.

Expand the highest-risk scenarios into test cases first, and give every open question an owner. When a criterion changes, the trace from criterion to scenario to test case shows which tests to update. Report results per scenario: stakeholders understand situations better than step counts.

Practice exercise

Derive scenarios for a delivery-slot story

Your task

Write the main flow of the story below, derive scenarios for its main, alternative and exception flows, and check that every acceptance criterion is exercised. Turn every expected result you cannot state into a question for the product owner.

Then compare your list with the one the User Story → Test Scenarios tool derives.

Material
GRO-40  Reschedule a delivery
As a customer, I want to move my delivery to another time slot,
so that someone is at home when it arrives.

AC1  A delivery can be rescheduled until 2 hours before its slot starts.
AC2  Only slots in the next 7 days that still have free capacity are offered.
AC3  The first reschedule is free; the second costs 5.00 SAR.
AC4  The new slot is shown on the order and confirmed by SMS.
Steps
  1. Write the main flow in four to six short steps.
  2. At each step, note the other choices and what can go wrong.
  3. Write each scenario as one line with an id, a flow type and sources.
  4. Map the scenarios to AC1 to AC4, then list the open questions.
Show the model answer
Model answer

Main flow: open the order, choose Change slot, pick a free slot, confirm and pay any fee, see the new slot, receive the SMS.

Scenarios: TS-01 (main) first reschedule, more than 2 hours ahead: free, new slot shown, SMS sent (AC1 to AC4). TS-02 (alternative) second reschedule: 5.00 SAR charged (AC3, AC4). TS-03 (alternative) the customer leaves without choosing. TS-04 (exception) less than 2 hours before the slot: refused (AC1). TS-05 (exception) no free slot in the next 7 days (AC2). TS-06 (exception) the chosen slot fills up before confirming. TS-07 (exception) the fee payment fails. TS-08 (flow type depends on Q5) a third reschedule (AC3).

Coverage: AC1 by TS-01 and TS-04, AC2 by TS-01 and TS-05, AC3 by TS-01, TS-02 and TS-08, AC4 by TS-01 and TS-02, so 4 of 4. TS-03, TS-06 and TS-07 trace to the flow only.

Questions: Q1 Is a change exactly 2 hours before the slot allowed, and in which time zone? Q2 What does the customer see when no slot is free? Q3 What happens if the slot fills up between choosing and confirming? Q4 If the fee payment fails, is the old slot kept? Q5 AC3 stops at the second reschedule: is a third one allowed, and what does it cost?

Frequently asked questions

Is a test scenario the same as a Gherkin scenario?

Not quite. In Gherkin, the Scenario keyword introduces one concrete example written as Given/When/Then steps with specific data. It is close to a test case and is often automated. The scenarios in this lesson are one-line statements of what to test; one of them can be illustrated by several Gherkin scenarios.

How many scenarios does a user story need?

There is no fixed number. Aim for at least one scenario for every acceptance criterion and for every alternative or exception flow that changes the outcome. A small story may need three; a story that moves money or changes states needs more. If the list keeps growing, check whether the story should be split.

Our test management tool has no field for scenarios. Do I still need them?

Yes, in some form. Teams often use a folder, a parent item or a group title for the scenario and keep its test cases under it. What matters is not the document but the review: a short list the team can check for missing situations before detailed cases are written.

Can I run a scenario without writing test cases?

Yes. An experienced tester can use a scenario as a guide for exploratory testing and record the data and results while testing. That suits low-risk areas and fast feedback. For regression, audits and high-risk rules, write test cases so that every run is repeatable.

References

  • ISTQB Certified Tester Foundation Level (CTFL) v4.0ISTQB · 2023The foundation syllabus of software testing: test levels and types, test design techniques, test management and tools.
  • ISTQB GlossaryISTQBThe standard definitions of testing terms — test case, regression testing, severity, priority, boundary value analysis and the rest.
  • Gherkin Reference — CucumberCucumberThe Gherkin syntax for executable specifications: Feature, Rule, Scenario, Given/When/Then steps, Background, Scenario Outline and Examples.

Practise with Mutqan tools

Generate high-level test scenarios covering functional, negative, security, usability and compatibility angles for a feature.

Test Design

Convert a list of numbered requirements into traceable test cases with a requirement-to-test matrix.

Test Design

Convert a user story (As a / I want / So that) into structured test cases using templates and heuristics.

Test Design

Go deeper

Your progress on this topic

Part of the QA Roadmap