Review a Specification for Ambiguity
Scenario
Audit three short specifications for a study-room reservation checker.
Try it yourself
Choose each specification and predict whether two teammates would build the same checker.
| Case | Result |
|---|---|
| Allow booking if plenty of seats exist and the student seems eligible | Select a choice above to see what happens. |
| Return true if freeSeats > 0 and hasPermission is true, else false (no note on negative seats) | Select a choice above to see what happens. |
| Inputs: integer freeSeats >= 0, bool hasPermission. Return error if freeSeats < 0; else return freeSeats > 0 AND hasPermission. | Select a choice above to see what happens. |
Reveal the explanation
- Allow booking if plenty of seats exist and the student seems eligible
Ambiguous. "Plenty" and "seems eligible" have no measurable boundary.
- Return true if freeSeats > 0 and hasPermission is true, else false (no note on negative seats)
Partially ambiguous. Valid inputs are clear, but negative input handling is left unstated.
- Inputs: integer freeSeats >= 0, bool hasPermission. Return error if freeSeats < 0; else return freeSeats > 0 AND hasPermission.
Unambiguous. Inputs, invalid policy, boundary (0 vs 1), and output type are all locked.
Before drawing a flowchart or prompting an AI agent, run a 30-second ambiguity check: Are inputs typed? Are boundaries explicit? Is invalid input defined?
Your turn
Audit "Students pass when their score is good enough" and rewrite it into an unambiguous 2-sentence contract.
Common mistake Leaving "good enough" or the valid score range (0..100) undefined.
Check your work
Input integer score in 0..100; score < 0 or > 100 returns INVALID_SCORE; score >= 60 returns Pass, else Try again.
Quick check
This browser could not save your progress. Changes last until you leave the page.