Skip to content

Systematic Debugging

调试类

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

Quick Start

Understand in 30 Seconds

Random fixes waste time and create new bugs.

Core Principle: Always find root cause before attempting fix. Symptom fixes are failure.

When to Use

  • Test failures
  • Production bugs
  • Unexpected behavior
  • Performance issues
  • Build failures

Complete Guide

Iron Law

No fix without root cause investigation

Four-Phase Process

Phase 1: Root Cause Investigation

  1. Read error message carefully
  2. Reproduce consistently
  3. Check recent changes
  4. Trace data flow

Phase 2: Pattern Analysis

  1. Find working example
  2. Compare with reference
  3. Identify differences

Phase 3: Hypothesis and Test

  1. Form single hypothesis
  2. Minimal test
  3. Verify before continuing

Phase 4: Implementation

  1. Create failing test case
  2. Implement single fix
  3. Verify fix