Practice question · Put in order
Order these steps into the scientific debugging method.
- Run the test and observe
- Reproduce the failure reliably
- Form a hypothesis about the cause
- Design a minimal test that would confirm or refute it
- Fix the cause, and keep the test to guard against regressions
Hints
- A bug you cannot reproduce cannot be studied, reproduction comes first.
- This is the experimental method wearing a programmer’s hat: hypothesis → experiment → observation.
Show the answer
- Reproduce the failure reliably
- Form a hypothesis about the cause
- Design a minimal test that would confirm or refute it
- Run the test and observe
- Fix the cause, and keep the test to guard against regressions
Why
Debugging is science: reproduce, hypothesize, experiment, conclude. The final twist is uniquely software’s, the confirming test becomes a permanent tripwire so the same bug can never sneak back.
Practise Debugging and validation
The app has 9 more questions on this lesson, and keeps your place in the course. Physics I is free to start.
More questions on Debugging and validation
- Your projectile simulation says a thrown ball climbs forever. Which debugging move gives the most information…
- A program runs without errors and produces plausible numbers that are wrong. Why is this harder to catch than…
- Order the steps of a systematic debugging process.
- Complete the description of debugging.
- Sort these errors by category.