Pair One Accepting and One Declining Example
Scenario
Room booking requires freeSeats > 0 and permission = true. Compare two candidate test pairs.
Try it yourself
Which pair isolates the permission rule cleanly?
| Case | Result |
|---|---|
| (2 seats, permission true) → true vs. (0 seats, permission false) → false | Select a choice above to see what happens. |
| (2 seats, permission true) → true vs. (2 seats, permission false) → false | Select a choice above to see what happens. |
| (1 seat, permission true) → true vs. (0 seats, permission true) → false | Select a choice above to see what happens. |
Reveal the explanation
- (2 seats, permission true) → true vs. (0 seats, permission false) → false
Noisy pair. Both inputs changed at once, so you cannot tell which rule caused false.
- (2 seats, permission true) → true vs. (2 seats, permission false) → false
Clean pair. Only permission changed, isolating the permission rule.
- (1 seat, permission true) → true vs. (0 seats, permission true) → false
Clean pair. Only freeSeats changed, isolating the capacity rule.
An implementation that ignores permission still passes the noisy pair! Holding all other inputs constant catches missing conditions immediately.
Download shared test cases
Your turn
Write a clean positive/negative pair for the Library Checkout rule that isolates the 3-book limit.
Common mistake Changing both book availability and borrowed count in the same declining example.
Check your work
(available=true, borrowed=2) → true paired with (available=true, borrowed=3) → false.
Quick check
This browser could not save your progress. Changes last until you leave the page.