Creation Of Test Scenarios, Test Cases
Test Scenarios
A test scenario is a high-level description of what needs to be tested, often expressed as a single line capturing an end-to-end functionality (e.g., "Verify user can successfully log in with valid credentials").
Test Cases
A test case is a detailed, step-by-step specification derived from a test scenario, describing exact preconditions, inputs, steps, and expected results.
- Test Case ID: A unique reference.
- Title/Summary: A short description of what is being tested.
- Preconditions: The required state before execution.
- Test Steps: The precise actions to perform, in order.
- Test Data: The specific input values used.
- Expected Result: What should happen if the software works correctly.
- Actual Result & Status: Filled in during execution (Pass/Fail).
From Scenario to Case
A single test scenario often expands into multiple detailed test cases to cover positive flows, negative flows, and edge cases.
How to Write Test Scenarios from a Requirement
Start with the requirement or user story and ask, "What can a user do here, and what could go wrong?" A practical routine is:
- Read the requirement and its acceptance criteria carefully, noting every rule and limit.
- List the main user journeys, one line each. These become your scenarios.
- Add scenarios for invalid input, permissions and error handling.
- Review the list with a developer or business analyst to catch misunderstandings early.
- Link each scenario to its requirement ID so changes can be traced later.
Worked Example: Password Reset
Requirement: "A registered user can reset the password through a link sent to their email. The link expires after a set time. The new password must meet the password policy."
Scenarios derived from it:
- TS01: Verify a registered user can request a reset link.
- TS02: Verify the user can set a new password using a valid link.
- TS03: Verify an expired link is rejected.
- TS04: Verify a weak password is rejected by the policy.
- TS05: Verify an unregistered email does not reveal whether the account exists.
Now expand TS04 into a detailed test case:
| Field | Value |
|---|---|
| Test Case ID | TC_PR_007 |
| Title | Reject new password shorter than the minimum length |
| Preconditions | User has a valid, unexpired reset link |
| Steps | 1. Open reset link. 2. Enter a password one character below the minimum in both fields. 3. Click Save. |
| Test Data | Password: Ab1@xyz (adjust to the real policy) |
| Expected Result | Password is not saved; a clear validation message explains the length rule |
The same scenario would also get cases for a password exactly at the minimum, one missing a special character and one that matches the old password if the policy forbids reuse.
Techniques That Produce Better Cases
- Equivalence partitioning: group inputs that should behave the same and test one value from each group.
- Boundary value analysis: test just below, at and just above every limit, since defects cluster at edges.
- Decision tables: useful when several conditions combine, such as user type plus account status.
- State transition: for flows like "link sent, link used, link expired".
Mistakes That Make Test Cases Hard to Use
- Vague expected results such as "should work properly". Write exactly what should be visible or stored.
- Combining several checks in one case, so a failure does not show which part broke.
- Hiding preconditions in the steps, which makes the case fail for the wrong reason.
- Hard-coding data that only exists on one tester's machine.
- Testing only the happy path.
Quick review checklist: each case is independent, has one clear objective, can be run by someone new to the project, and traces back to a requirement.
Ready to master real-world software testing?
Learn manual and automation testing hands-on with mentor-led sessions.