Systematic Debugging
A structured approach to debugging that finds root causes instead of applying random fixes.
Phase 1: Root Cause Investigation
- •Reproduce the issue consistently
- •Isolate the problem - identify exact component/function
- •Gather evidence - logs, stack traces, state
- •Form hypothesis about the cause
Phase 2: Pattern Analysis
- •When does it fail? (timing, input, state)
- •What changed recently?
- •Are there related issues?
- •What does the error message actually say?
Phase 3: Hypothesis Testing
- •Test ONE change at a time
- •Verify hypothesis with minimal reproduction
- •Document what you learned
- •If wrong, revert and try next hypothesis
Phase 4: Implementation
- •Apply minimal fix to root cause
- •Add tests to prevent regression
- •Document the fix
- •Verify in all affected scenarios
Anti-Patterns to Avoid
- •❌ Changing multiple things at once
- •❌ Fixing symptoms instead of causes
- •❌ Ignoring error messages
- •❌ Not testing after fixing
- •❌ Assuming without evidence
Key Principles
"If repeated fixes fail, question the architecture."
- •Understand before fixing
- •Evidence over assumptions
- •One change at a time
- •Root cause over symptoms
- •Prevent future occurrences