AP CSP Day 48: Testing & Edge Cases
Share
Big Idea 1
Day 48 Practice
Focus: Testing & Edge Cases
Practice Question
A procedure checks if a number is in range 1-100 inclusive. Which test case is MOST important?
Why This Answer?
Boundary values (1 and 100) are critical test cases because off-by-one errors commonly occur at boundaries. Testing exact limits catches inclusive/exclusive errors.
Why Not the Others?
A) Middle values less likely to reveal boundary errors.
B) Just outside is good but exact boundaries are more critical.
D) Extreme values are less revealing than boundaries.
Common Mistake
Watch Out!
Not prioritizing boundary testing. Most bugs occur at edge cases and boundaries, not middle values.
AP Exam Tip
Always test boundaries, zero, negative, empty, and maximum values. These reveal most bugs.