Computer Science I / Debugging Logic and State
Practice question · Select all that apply

Select every practice that the lesson recommends for debugging.

Hints
  1. One option is the named anti-pattern, not a recommendation.
  2. The lesson calls changing code at random 'shotgun debugging'.
Show the answer
  • B. Narrow down where the state first becomes wrong
  • C. Observe the actual values variables hold
  • D. Reproduce the bug before trying to fix it
  • E. Re-run the test suite after the fix to confirm nothing else broke
Why

Reproduce, observe, localize, and re-run after fixing are the recommended routine. Changing code randomly is 'shotgun debugging', the pitfall the lesson warns against, because it can hide a symptom without addressing the real cause.

Read the lesson: Debugging Logic and State →

Practise Debugging Logic and State

The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Debugging Logic and State