Turn an Edge Case into a Checkable Rule
Scenario
You notice someone might pass an empty answer list [] to the Classroom Quiz Scorer.
- 1…
- 2…
- 3…
Try it yourself
Order the steps to turn that edge case into a repeatable acceptance check.
Reveal the explanation
- Name the exact edge input (key = [A, B, C], answers = [])
Now the case is concrete instead of vague.
- Apply the stated invalid-input policy (length 0 != length 3)
The policy determines the expected outcome: INVALID_LENGTH.
- Write the pass/fail acceptance check and add it to the contract
Any teammate or AI agent can now verify the edge case automatically.
Never leave edge cases as footnotes like "handle empty lists properly." Give each edge case a concrete input and expected result.
Download shared test cases
Your turn
Convert the edge case "negative freeSeats" into a concrete three-part acceptance check.
Common mistake Writing "handle negative numbers safely" without naming the exact expected output or error.
Check your work
Input freeSeats = -1, Policy = invalid input error, Check = returns INVALID_FREE_SEATS.
Quick check
This browser could not save your progress. Changes last until you leave the page.