Scenario Coverage and Prioritizing Scenarios by Risk
In the ISTQB Advanced Level Test Analyst syllabus, behavior-based test techniques derive test cases from how the system is expected to behave in realistic usage. Use case testing and scenario-based testing are central examples. A use case describes interactions between actors and the system. It includes a main (basic) flow, alternative flows and exception or error flows. A scenario is one specific path through these flows, such as a successful purchase, a purchase with an expired card, or a cancelled transaction. Scenario coverage measures how thoroughly these paths have been exercised. It is usually calculated as the number of scenarios tested divided by the total number of identified scenarios, expressed as a percentage. Minimum coverage normally requires one test for the main success scenario and at least one test for each alternative and exception flow. More rigorous coverage may also combine flows, for example an alternative path followed by an error, or exercise loops and repeated steps. However, the number of possible combinations can grow very quickly, so exhaustive scenario coverage is rarely practical. The Test Analyst must therefore choose the scenarios that matter most. Prioritizing scenarios by risk addresses this need. Each scenario is assessed for likelihood of failure and impact of failure. Likelihood factors include complexity, new or changed functionality, defect history and integration points. Impact factors include business criticality, financial loss, safety, regulatory consequences and user visibility. Frequency of use is also important. A scenario followed by most users every day deserves more attention than a rare edge case, unless that edge case carries severe consequences. High-risk scenarios are tested first and in greater depth, sometimes with several data variations. Low-risk scenarios may receive lighter testing or be deferred. This approach aligns testing effort with business value. It ensures that the most important user journeys work if testing time is cut short. It also gives stakeholders clear traceability between risks, scenarios and the coverage achieved, which supports informed release decisions.
Scenario Coverage and Prioritizing Scenarios by Risk (ISTQB CTAL-TA Behavior-Based Test Techniques)
In the ISTQB Certified Tester Advanced Level Test Analyst (CTAL-TA) syllabus, scenario-based testing is one of the behavior-based test techniques, alongside techniques such as CRUD testing and state transition testing. It focuses on how users or other systems interact with the test object to reach a goal. Two ideas sit at the heart of the technique:
1. Scenario coverage: how you measure the thoroughness of scenario-based testing.
2. Prioritizing scenarios by risk: how you decide which scenarios to design, implement and run first, and how deeply to test them, when time is limited.
Why It Is Important
- Business focus: Scenarios mirror real user workflows, so defects found here are often the ones users would actually hit.
- Measurable thoroughness: Scenario coverage gives a clear exit criterion and a basis for progress reporting, for example 'all main and alternative scenarios covered, 80% of exception scenarios covered'.
- Limited resources: Real systems can have a very large number of scenarios. Risk-based prioritization makes sure the scenarios with the highest risk are tested first and most thoroughly.
- Alignment with risk-based testing: The Test Analyst identifies and assesses product risks. Ranking scenarios by risk applies that work directly to test design.
- Stakeholder communication: Coverage and priority give business stakeholders a language they understand, such as 'all checkout flows are tested'.
What It Is
Scenarios are sequences of interactions between actors (users or systems) and the test object. They are typically derived from use cases, user stories, business process models (for example BPMN), activity diagrams or workflow descriptions. They usually fall into three types:
- Main (basic) scenario: the typical, most common path to the goal, often called the happy path.
- Alternative scenarios: valid variations that still reach the goal by a different route, for example paying by voucher instead of by card.
- Exception (error) scenarios: paths where something goes wrong and the system must handle it, for example a payment being declined, a timeout or invalid data.
Scenario coverage is the coverage criterion for this technique. The coverage items are the scenarios themselves:
Scenario coverage = (number of scenarios exercised by tests / total number of identified scenarios) x 100%
The main and alternative scenarios are sometimes reported separately from the exception scenarios to give a more meaningful picture.
Prioritizing scenarios by risk means ranking scenarios by their risk level. Risk level is usually a combination of likelihood (the chance that the scenario contains a defect) and impact (the consequence if it fails). This ranking then drives:
- the order in which tests are designed and executed;
- how thoroughly each scenario is tested, for example adding data variations or boundary values;
- which scenarios may be omitted or deferred when time runs out.
How It Works
Step 1: Identify the scenarios. Analyze the test basis, such as a use case flow or a process model. List the main flow, each alternative flow and each exception flow. Each flow becomes a coverage item. Loops and branch points may create many paths, so agree on a practical rule, for example 'each loop executed zero, one and many times' or 'each alternative covered at least once'.
Step 2: Assess the risk of each scenario.
Likelihood factors include:
- complexity of the flow;
- new or changed functionality;
- integration points with other systems;
- inexperienced developers;
- areas with a history of defects.
Impact factors include:
- frequency of use (how many users follow this path);
- financial loss;
- safety or legal consequences;
- reputational damage;
- availability of workarounds.
Combine the two into a risk level (high, medium or low, or a numeric score such as likelihood x impact).
Step 3: Rank and allocate effort.
- High-risk scenarios: tested first, with more test cases and more data variations.
- Low-risk scenarios: tested later, lightly, or deferred.
The main scenario is often high priority because it is used most frequently, so its failure affects most users. However, an exception scenario with severe impact, such as double charging a customer or a safety-related error handler, can rank as high or higher.
Step 4: Design test cases. Typically at least one test case is designed per scenario. Additional test cases can be added for high-risk scenarios using other techniques, such as equivalence partitioning or boundary value analysis, on the data used within each step.
Step 5: Measure and report coverage. Track the coverage achieved against the target. Report it together with the residual risk of any scenarios that are not covered.
Worked Example
An online checkout use case has the following scenarios:
- S1 Main: pay by card successfully.
- S2 Alternative: pay by voucher.
- S3 Alternative: split payment between voucher and card.
- S4 Exception: card declined.
- S5 Exception: payment gateway timeout.
- S6 Exception: voucher expired.
The risk assessment gives:
- S1: high frequency and high impact, so high risk.
- S5: complex integration and possible double charging, so high risk.
- S3: new and complex feature, so medium-high risk.
- S4: common case with medium impact, so medium risk.
- S2: medium risk.
- S6: rare, with a simple workaround, so low risk.
The execution order is therefore S1, S5, S3, S4, S2, S6.
If time allows only S1, S5, S3 and S4 to be tested, then scenario coverage = 4/6 = 66.7%. The residual risk lies mainly in S2 and S6, which should be reported to stakeholders.
Relationship to Other Concepts
- Scenario-based testing complements state transition testing (system states) and CRUD testing (data lifecycle).
- It is well suited to system testing, system integration testing and acceptance testing, where end-to-end workflows matter.
- Risk-based prioritization of scenarios is a specific application of the general risk-based testing approach in the syllabus.
- 100% scenario coverage does not guarantee that all data combinations, all states or all code are tested. It only means each identified scenario was exercised at least once.
Exam Tips: Answering Questions on Scenario Coverage and Prioritizing Scenarios by Risk
1. Know the coverage items. In scenario-based testing the coverage items are the scenarios (main, alternative and exception). Do not confuse them with states, transitions, decision table rules or code statements.
2. Calculate carefully. Count all identified scenarios, including the main one, in the denominator. Watch out for scenarios that are duplicated or that one test case covers together with another. One test case usually covers one scenario, so count distinct scenarios exercised, not test cases executed.
3. Minimum number of test cases. To achieve 100% scenario coverage you need at least as many test cases as there are distinct scenarios. Read whether the question allows one test to cover several paths.
4. Risk = likelihood x impact. When a question gives frequency of use, business criticality, complexity or defect history, map each factor to likelihood or impact. The highest combined value is ranked first.
5. Do not assume the happy path always wins. The main scenario is often top priority because of frequency, but an exception scenario with severe consequences (financial, safety, legal) may be ranked higher. Read the stem for impact clues.
6. Look for keywords. Phrases like 'most frequently used', 'new', 'complex', 'integrates with a third party' or 'regulatory' signal higher risk. Phrases like 'rarely used', 'workaround available' or 'unchanged since last release' signal lower risk.
7. Limited-time questions. If asked which scenarios to test given limited time, choose the option that covers the highest-risk scenarios first. Do not pick the option that simply maximizes the count of scenarios covered.
8. Residual risk. Remember that untested scenarios represent residual risk that should be reported. An answer mentioning reporting uncovered high-risk scenarios is usually correct.
9. Eliminate distractors. Reject answers that say 100% scenario coverage means the system is defect-free or fully tested. Also reject answers that apply code coverage measures to scenario-based testing.
10. Scenario-type identification. Practice classifying flows. 'The user cancels' or 'the server is unavailable' are usually exception scenarios. 'The user chooses another valid option' is an alternative scenario.
11. Apply-level questions (K3). Expect a use case or process description from which you must derive the scenarios, compute coverage and rank them. Sketch the flows on scratch paper and label them M, A1, A2, E1 and so on before answering.
Summary
Scenario coverage measures how many identified main, alternative and exception scenarios have been exercised. Prioritizing scenarios by risk ensures that the scenarios most likely to fail and most damaging if they fail are tested first and most thoroughly. In the exam:
- identify the scenarios correctly;
- calculate coverage using distinct scenarios;
- rank scenarios by combining likelihood and impact;
- always consider and report residual risk.
CTAL-TA - Scenario Coverage and Prioritizing Scenarios by Risk Example Questions
Test your knowledge of Scenario Coverage and Prioritizing Scenarios by Risk
Question 1
A test analyst tracks scenario-based testing for two use cases in a transit app. Use case 'Top up travel card': 1 rider selects amount; 2 rider pays; 3 app loads credit. Its variations are 1a amount above 200 rejected, top-up ends (low risk); 2a card declined, rider pays from wallet, credit loaded (medium risk); 2b payment taken but credit load times out, top-up cancelled and refund issued (high risk). Use case 'Refund travel card': 1 rider requests refund; 2 system approves; 3 money transferred. Its only variation is 2a card used today, refund rejected (medium risk). Results so far: top-up main scenario passed; top-up 2a passed; refund main scenario failed, and its fix is not yet delivered; refund 2a passed. What is the scenario coverage across both use cases, and which test should run next?
Question 2
A test analyst prepares the first test batch for the use case 'Book meeting room' in a booking system. Main scenario: 1 user enters room and time slot; 2 user adds an attendee, repeated up to a maximum of 8 attendees, and the step may be skipped; 3 system checks availability; 4 system confirms the booking. Extension 3a: room is taken, the system proposes another room, the user accepts and the booking is confirmed. Exception 3b: calendar service is unreachable and the booking is aborted. Exception 4a: user cancels before confirmation. The risk assessment rates the main scenario high, 3a high, 3b medium and 4a low. The first batch covers every high-risk scenario. Simple loop coverage applies to step 2 in the main scenario only. Every other scenario gets one test case. How many test cases does the first batch need, and what scenario coverage does it reach?
Question 3
A tester orders scenario-based tests for the use case 'Activate prepaid SIM' in a mobile app. The main scenario is: 1 customer enters SIM number; 2 system validates SIM; 3 customer selects tariff; 4 system charges initial top-up; 5 system activates SIM. Extension 3a: customer redeems a voucher instead of paying, continue at 5 (risk low). Exception 2a: SIM already active, request rejected (risk high). Exception 4a: payment declined, activation aborted (risk medium). The main scenario has risk medium. In the test environment, an active SIM can only be obtained by running the main scenario successfully. Ties between equal risks go to the scenario that other tests depend on. Each scenario gets one test case. Which execution order follows risk priority within this constraint, and what scenario coverage is reached after the first two tests?