Test Just Below, At, and Above the Limit
Scenario
A quiz score passes at 60 or higher.
Selected choicePick a choice below
Result—
Try it yourself
Predict the result at each score, then compare the three outcomes.
| Case | Result |
|---|---|
| 59 | Select a choice above to see what happens. |
| 60 | Select a choice above to see what happens. |
| 61 | Select a choice above to see what happens. |
Reveal the explanation
- 59
Failed. One point below the first passing score.
- 60
Passed. The rule includes the boundary.
- 61
Passed. One point above the boundary.
If the code uses > 60, the middle test fails. The other two checks would still pass.
Download shared test cases
Your turn
Write checks at 59, 60, and 61. Change the comparison to > 60 and identify the failing check.
Common mistake Testing only values far from the cutoff.
Check your work
Only the case at 60 fails after that change.
This browser could not save your progress. Changes last until you leave the page.