Test Cases, Scenarios and Boundaries
Basketly's quantity box accepts whole numbers from 1 to 20. You could test all twenty valid numbers, plus hundreds of invalid ones, and still miss the bug. Or you could test four carefully chosen values and catch it. Good test design is about choosing inputs, then writing them down so anyone can repeat them.
The rule
Scenarios say what to test; cases say exactly how; boundaries say where bugs hide.
A test scenario is a one-line situation worth checking: "Customer changes an item's quantity in the cart." Scenarios are quick to list and good for coverage conversations.
A test case spells one check out so precisely that anyone gets the same result:
| Field | Example |
|---|---|
| ID | TC-CART-07 |
| Precondition | Logged in; cart holds 1 × Brown Bread |
| Steps | 1. Open cart 2. Type 21 in quantity 3. Press Update |
| Data | Quantity 21 |
| Expected result | Quantity stays 1; message "You can order up to 20 of each item" |
Two classic test design techniques pick the data:
- Equivalence partitioning: split inputs into groups the software should treat the same way, then test one value from each. For 1 to 20: below 1, 1 to 20, above 20, and not a whole number.
- Boundary value analysis: bugs cluster at the edges, where a developer writes
<instead of<=. Test each side of every edge: 0 and 1, 20 and 21.
The shortcut
For any range, test the edge and one step outside it, at both ends. For "1 to 20" that is 0, 1, 20, 21, plus one middle value and one wrong type.
Write the scenario
"Customer changes an item's quantity." One line, many cases to come.
The trap is writing expected results like "works correctly". A case without a precise expected result has no oracle, so two testers can run it and disagree.
Drills
Answer fast — trust the rule.
For a quantity range of 1 to 20, which set shows boundary value analysis?
"Customer applies a coupon at checkout." What is this?
Which expected result is well written?
With equivalence partitioning, why test only one value from 1 to 20?
A developer wrote if quantity < 20 for "up to 20". Which value catches it?
Remember
- Scenarios say what to test; cases say exactly how; boundaries say where bugs hide.
- For a range, test each edge and one step outside, at both ends.
- Every case needs a precise expected result.
