Pebellslearn by building
0%
RoadmapsMatrixCoursesSandboxSign in
Manual Testing  ›  Lesson

Test Cases, Scenarios and Boundaries

Test Cases and Scenarios 16 minA scenario names a situation worth testing, a test case spells out exact steps, data and expected result, and techniques like equivalence partitioning and boundary values choose the few inputs most likely to find bugs.

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.

Designing quantity testsStep 1 of 4
  1. 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.

quick drill

For a quantity range of 1 to 20, which set shows boundary value analysis?

quick drill

"Customer applies a coupon at checkout." What is this?

quick drill

Which expected result is well written?

quick drill

With equivalence partitioning, why test only one value from 1 to 20?

quick drill

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.

Practice — level up

0/1 solved

Write your answer, then compare it with a rubric and a model answer.

ExplainCases for the quantity box

Basketly's quantity box accepts whole numbers from 1 to 20. Identify the partitions and boundary values, then write one full test case (ID, precondition, steps, data, expected result) for the most interesting boundary.