How to read a use case (actors, preconditions, main success scenario, alternative and exception flows, postconditions) and turn every flow into test scenarios with measurable coverage.
beginner Mobile & web
Short on time? Switch to the quick version.
Your progress
A banking app ships a new “Forgot password?” flow. The tester walks through it on a phone: enter email, open the link, choose a new password, done. Every step works. A week later, support is busy: customers who opened the reset email on their laptop see a blank page, and customers who tapped a link they had already used get logged in with no password change at all.
Nobody tested those routes because nobody wrote them down. A use case would have listed them on one page, and use case testing would have turned each one into a test.
Use cases come from software design (Ivar Jacobson introduced them in the late 1980s). The structured, readable style most teams use today was popularized by Alistair Cockburn’s book Writing Effective Use Cases. Formats vary between companies, but these parts appear almost everywhere.
Everything that can go differently is listed as an extension, numbered after the step where it branches off. “3a” means “something different at step 3”, “3b” is a second thing that can happen at step 3.
On success: “only the new password works, other devices are logged out, the link can’t be used again”.
If it fails (sometimes called the minimal guarantee): “the old password still works”. Even a failed run must not leave the system in a broken state.
Postconditions are gold for testers: they’re the checks people forget because the confirmation screen looks right.
A worked example: reset a forgotten password
Here’s the use case behind the story at the top of this lesson, written the way many teams do it:
Banking app
UC-07 Reset a forgotten password
Primary actor
Customer who can’t log in
Other actors
Email service
Preconditions
The customer has an account with a verified email address.
The customer is logged out.
Trigger
The customer taps “Forgot password?” on the login screen.
Main success scenario (the happy path)
1The customer enters their email address and taps Send link.
2The system shows “If an account exists, we’ve sent a link” and emails a reset link valid for 30 minutes.
3The customer opens the link on the same phone.
4The system shows the New password screen.
5The customer enters a new password that meets the rules and taps Save.
6The system saves the password, logs out all other devices and shows “Password changed”.
Extensions (alternative and exception flows, numbered by the step where they branch off)
1a. The email address has a typo in its format Alternative
The system shows “Enter a valid email address”; the customer corrects it and continues at step 1.
3a. The customer opens the link on a computer Alternative
The website shows the New password screen; the flow continues at step 5.
3b. The link is older than 30 minutes Exception
The system shows “This link has expired” with a button to send a new one. The use case ends.
3c. The link was already used Exception
The system shows “This link has already been used”. The use case ends.
5a. The new password breaks a rule Alternative
The system explains which rule; the customer corrects it and continues at step 5.
Postconditions on success
Only the new password works.
Other devices are logged out.
The reset link can’t be used again.
If it fails
The old password still works.
The two bugs from that story live right there: opening the link on a computer is extension 3a, and an old link is 3c. A tester working from this page would have tested both before release.
Check this part
In a use case, what is the main success scenario?
The main success scenario (basic flow) is the happy path. Alternative and exception flows branch off its steps.
While reordering food, two of three dishes are available. The app adds those two and the customer still orders. What kind of flow is that?
The customer still reaches the goal by a slightly different route, so it's an alternative flow.
Actors, preconditions, the main success scenario, alternative and exception flows, and postconditions.
Part Not started
From flows to tests
One test for the main success scenario, end to end.
At least one test per alternative flow. Follow the branch and check it rejoins the main path correctly.
At least one test per exception flow. Check the message, that nothing half-finished is left behind, and that the user can start again.
Check the postconditions, not just the last screen. “Password changed” on screen means little if the old password still works.
Use other techniques inside the steps. The “new password” step still needs boundary values for its length rules.
Deriving test scenarios step by step
Read the whole use case and list its flows. Main success scenario, 1a, 3a, 3b, 3c, 5a: six flows.
Write one scenario for the main flow. Use realistic data: a real-looking email, a password that meets the rules.
Write one scenario per extension. Follow the main steps up to the branching point, take the branch, then either follow it back into the main flow or check that the use case ends cleanly.
Add the postconditions to the expected results. After the main flow, try the old password (must fail), check another logged-in device (must be logged out) and tap the link again (must say it was used).
Look for missing extensions. Read every system step and ask “what could go wrong here?” What if the email takes 10 minutes to arrive? What if the customer requests two links and uses the first one? Missing extensions are requirement gaps: raise them, just like gaps in a decision table.
With the browser’s own controls: Back, refresh and opening the link in a second tab.
These aren’t always in the use case. When they’re missing, they’re excellent questions for the team, and good material for error guessing.
Common mistakes
Testing only the main flow. The happy path is usually the part developers already tried themselves.
Checking the last screen instead of the postconditions. “Order confirmed” doesn’t prove the customer was charged once.
Treating preconditions as test steps. “Has a verified email” is setup; build it with test data, don’t re-test it in every case.
Inventing behavior for a missing extension. If the use case doesn’t say what happens when every dish is sold out, ask. Don’t guess the expected result.
Writing one giant test for all flows. If it fails at step 2, you learn nothing about the other branches. One flow per test keeps failures readable.
Check this part
After a successful password reset, the "Password changed" screen appears. What else should the test check?
Postconditions describe what must be true afterward. A confirmation screen can look perfect while the old password still works.
A use case has two alternative flows. How many tests do they need at least?
Follow each branch and check it rejoins the main path correctly.
One test for the main flow, at least one per alternative and exception flow, and check the postconditions.
Part ProNot started
Measuring coverage
Use case coverage is simple: flows tested ÷ flows in the use case. Five flows and three tested means 60%. Aim for 100% of flows on important journeys, because most use case bugs hide in the alternatives and exceptions, which developers often build last and test least.
More tests don’t automatically mean more coverage: ten variations of the main flow still cover only one flow.
Use case coverage counts flows, not steps:
coverage = flows exercised by at least one test ÷ all flows in the use case
Six flows with four tested is 67%. Two notes from practice:
More tests ≠ more coverage. Ten variations of the main flow with different cards still cover only one flow. They may be worth running for other reasons (payment methods are risky), but count them honestly.
100% flow coverage isn’t “fully tested”. It means every documented route ran at least once. Data variations inside steps, undocumented routes and combinations of extensions (sold-out dish and declined card) are still open. Pick the risky combinations on purpose.
Check this part
A use case has a main flow, 3 alternative flows and 2 exception flows. Your tests cover the main flow and all alternatives. What is the flow coverage?
4 of 6 flows are covered: 4 ÷ 6 ≈ 67%. Both exception flows, where error handling bugs hide, are still untested.
You run ten variations of the main flow with different cards. How many flows have you covered?
Coverage counts flows, not tests. The variations may be worth running, but they all follow the same flow.
Coverage counts flows, not steps: flows tested divided by all flows in the use case.
The rest of this lesson is in Bugwise Pro
The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.
Agile teams usually write user stories instead of formal use cases. The thinking is the same: a story’s acceptance criteria often describe the alternative and error paths. If a story only describes the happy path, ask “and what if…?” in refinement and you’re doing use case thinking.
A tester can bring use case thinking into story refinement: sketch the main flow, then ask about each step “what else could happen here?” Each answer becomes an acceptance criterion, often in Given/When/Then form. Several stories (“reorder”, “handle sold-out dishes”, “show price changes”) often add up to one use case, and a use case is a great map for end-to-end tests across those stories.
Check this part
What do agile teams usually write instead of formal use cases?
Stories are smaller, but the thinking is the same: acceptance criteria often describe the alternative and error paths.
A user story only describes the happy path. What can you do in refinement?
Asking what else could happen at each step is use case thinking, and each answer becomes an acceptance criterion.
Agile teams write user stories instead; bring use case thinking into refinement by asking “and what if…?” at each step.
The rest of this lesson is in Bugwise Pro
The last parts of every lesson are part of Bugwise Pro. Sign in to unlock them if you have it.
Sort the product owner’s notes into the parts of a use case, then pick test scenarios. The coverage check tells you which alternative and exception flows you missed, and which picks add no new coverage.
🧭 Use case workshop: “Reorder a previous order”
The product owner of a food delivery app sent you loose notes. First sort them into the parts of a use case, then choose test scenarios and see which flows you covered.
Step 1 · Sort the notes
Alternative = a different route that can still reach the goal, possibly after correcting a mistake. Exception = the use case ends without the goal.
The customer is logged in and has at least one completed order.
The customer opens Orders and taps Reorder on a past order.
If the cart already has items from another restaurant, the app asks whether to replace them.
If some dishes are sold out, the available ones are added and the missing ones are listed.
If the restaurant is closed, the app says when it opens and adds nothing.
The app adds the dishes to the cart at today’s prices and opens the cart.
If prices changed since the original order, the cart shows a “Prices updated” notice.
If the card is declined, the app keeps the cart and asks for another payment method.
The customer is charged once, and the original order is unchanged in the history.
Classify every note to check.
Step 2 · Build your test scenarios
Pick the scenarios you would run. Aim to cover every flow and the postconditions without wasting tests.
0 selected
Example test cases
These come from the “Reorder a previous order” use case in the workshop, shown again here. Notice how each one names the flow it covers.
FoodDash
UC-12 Reorder a previous order
Primary actor
Logged-in customer
Other actors
Restaurant system, payment provider
Preconditions
The customer is logged in.
The customer has at least one completed order.
Trigger
The customer taps Reorder on a past order.
Main success scenario (the happy path)
1The customer opens Orders and taps Reorder on a past order.
2The system checks that the restaurant is open and every dish is available.
3The system adds the dishes to the cart at today’s prices and opens the cart.
4The customer checks the address and payment method and taps Place order.
5The system charges the payment method and shows the order confirmation.
Extensions (alternative and exception flows, numbered by the step where they branch off)
1a. The cart already has items from another restaurant Alternative
The system asks whether to replace them. Replace: continue at step 2. Cancel: the use case ends with the cart unchanged.
2a. Some dishes are sold out Alternative
The system adds the available dishes and lists the missing ones; continue at step 3.
2b. Every dish is sold out Exception
The system says nothing can be reordered. The cart stays as it was. The use case ends.
2c. The restaurant is closed Exception
The system shows when it opens. Nothing is added to the cart. The use case ends.
3a. Prices changed since the original order Alternative
The cart shows a “Prices updated” notice next to the changed dishes; continue at step 4.
5a. The payment is declined Alternative
The system keeps the cart and asks for another payment method; the customer may continue at step 4.
Postconditions on success
A new order exists at today’s prices.
The customer is charged once.
The original order is unchanged in the history.
If it fails
No order is created and nothing is charged if the use case ends early.
TC-UC-01Main flow: reorder a past order and pay by cardpositivehigh
The lemonade is removed; the cart holds only the Pizza Roma dishes; the order can be placed. (A good extra test: choose Cancel instead, and the cart still contains only the lemonade.)