LESSON VIEW
PQA-03 · LEVEL 1 FOUNDATIONS · PRACTICAL QA

Writing Test Cases That Catch Bugs

Objective: Write a test case in the full format — ID, requirement, steps, test data, and an expected result calculated from the requirement — so the case can actually fail when the software is wrong.

⏱ ≈2 h full lesson · Practice site: FreshNest booking form · English edition — Español · العربية · বাংলা in translation

🧽 The practice business: FreshNest Home Cleaning — a fictional local cleaning company (owner: Maya Torres) invented for this course. Every example and exercise uses FreshNest, so you learn on a complete, realistic business without ever touching a real one.

2 of 11 modes explored

Ways to learn this lesson

Tap a title to open that way of learning. Use as many as you need — then take the lesson quiz below.

📖Read
The full lesson, in order
~30 min›

A test case is not a vibe ("check the form works"). It is a small contract: given these steps and this data, the requirement promises this exact result. If any of the three is vague, the case cannot fail — and a case that cannot fail cannot catch a bug.

Every case in this course carries the same fields: ID, requirement, preconditions, numbered steps, explicit test data, and an expected result quoted or calculated from the requirement — never from what the software currently does. That last rule is the whole game: if you write the expected result by looking at the screen, you have written a description of the bug, not a test.

Balance the set deliberately. Happy paths prove the product can work; negative and boundary cases prove it refuses to work wrongly. Most real damage hides in the second group: the invalid phone accepted, the empty field waved through, the price computed with the wrong rule.

⚡Key Points
The whole lesson in 5 bullets
~5 min›
  • A test case is a contract: steps + data → one exact expected result.
  • Write the expected result from the requirement BEFORE running the case.
  • An expected result copied from the screen makes the case unable to fail.
  • Happy paths prove it can work; negative/boundary cases prove it can't work wrongly.
  • Every case gets an ID (TC-FN-…) tied to a requirement (REQ-FN-…) — that link is traceability.
🪜Worked Example
Watch one task done step by step
~12 min›

The course's real test-case document, executed against the FreshNest practice site. Full document: 8 cases (pricing, validation, booking, content).

The case — TC-FN-PRC-001

Deep clean estimate uses the 1.5× multiplier. Requirement REQ-FN-01. Steps: 1) Service = Deep. 2) Bedrooms = 2. 3) Read the estimate. Test data: Deep, 2 beds (Standard base $140).

The expected result — calculated first

$210. From the brief's rule, by hand: 140 × 1.5 = 210. Written before the case ever ran.

The run

On the practice build, the screen showed $168. Because the expected result existed independently, the gap is unambiguously a defect — it became defect report DEF-FN-001 (Lesson PQA-06).

Its neighbours in the document

TC-FN-PRC-002 (Standard ±$30/bedroom), TC-FN-PRC-003 (Move-Out never shows a price), TC-FN-VAL-001 (letters in phone rejected), TC-FN-VAL-003 (boundary: 9- and 11-digit phones rejected, 10 accepted), TC-FN-BKG-001 (valid booking confirms), TC-FN-CNT-001 (no prohibited claims).

Why this document works

Each case can fail, each failure names a requirement, and the same IDs are reused by the defect reports, the traceability matrix, and the automated suite — one thread from rule to result.

🗺️Visual Map
The idea as a diagram
~6 min›
One thread: rule → resultRequirement REQ-FN-01Deep = 1.5 × StandardTest case TC-FN-PRC-001Steps + data + $210 expectedRun the caseActual: $168Compare expected vs actualGap = defect DEF-FN-001Mismatch?No → the case passesThe same case proves the fixbecomesdrivesis verified byTest caseDefect reportFixRetest

One map of the lesson: a requirement becomes a case, a case becomes a verdict, and the same case proves the fix.

🧪Hands-On Lab
Do it yourself, then reveal the key
~20 min›

Spot the flaw. Each item is a broken test case fragment — pick what's wrong with it.

1. "Check the Deep price looks right." (no numbers anywhere)

2. Steps: 1) Open the form. 2) Try some phones. Expected: invalid ones fail.

3. Expected result: "The estimate shows what the site currently shows."

4. A case for Move-Out pricing with expected result "$250 flat".

5. Steps and data are exact, but no requirement is named.

🎧Listen
Hear it narrated in your language
~4 min›

Here is the one idea in this lesson. A test case is a contract. You write down the steps, the exact data, and the result the requirement promises, before you run anything. For the FreshNest Deep clean, the rule says one point five times the Standard price. Standard is one hundred forty dollars, so the expected estimate is two hundred ten dollars. When the practice site showed one hundred sixty eight, there was nothing to argue about. The case was right, the site was wrong, and that gap became a defect report. Write the expected result first, from the rule, never from the screen. A case that cannot fail cannot catch a bug.

🃏Flashcards
Key terms, flip to recall
~6 min›
Test case
Tap the card to flip it

One check with steps, test data, and an expected result.

1/5
🎭Scenario
A story decision — you be the owner
~7 min›

Your lead asks you to 'just quickly check the new pricing page' with no cases written. The release is tonight. You…

🗣️Teach-Back
Explain it in your own words
~10 min›

Explain to a friend, in your own words: why must the expected result be written before you run a test case? Use the $210 vs $168 example.

Now check yourself honestly:

⚖️Before / After
Weak way vs strong way, side by side
~6 min›
The weak wayThe strong way
Run it, see $168, assume that's the price.

"Check Deep pricing works."

Run it, see $168 — a named, evidenced mismatch.

TC-FN-PRC-001 with expected $210 calculated from REQ-FN-01.

📋Job Aid
A checklist to use at work
~3 min›

📝 Lesson Quiz — Check Yourself

1. Where must the expected result come from?

2. TC-FN-PRC-001 runs and the estimate shows $168. What is true?

3. Which addition most improves "Check invalid phones are handled"?

Score: 0 / 3