02-daily-development

Bug Fix Workflow

02-daily-development/bug-fix-workflow

Bug Fix Workflow

Overview

Bug fixing is the repeatable process of finding the cause, applying the minimum safe fix, and verifying the result.


Why It Matters

Good bug fixes reduce repeat incidents and improve trust in the codebase.


Core Concepts

  • Reproduce the bug.
  • Identify the failing layer.
  • Fix the shared cause, not just the symptom.

Mental Models

The reported bug is the symptom. The root cause is usually one boundary or assumption deeper.


Best Practices

  • Capture exact steps to reproduce.
  • Use the smallest effective patch.
  • Add a regression test when possible.

Common Mistakes

  • Fixing only the current route or screen.
  • Changing behavior without verifying the full flow.
  • Leaving the root cause unaddressed.

Trade-offs

Sometimes the safest fix is a narrow patch. When the issue is systemic, shared code usually needs the change.


Decision Framework

  1. Reproduce.
  2. Narrow the layer.
  3. Confirm the cause.
  4. Patch the shared path.
  5. Verify and add regression coverage.

Examples

  • A bad auth redirect should be fixed in the shared auth flow, not one page.
  • A form validation bug should be covered with a test for the failing input.

Checklists

  • Can I reproduce the bug reliably?
  • Did I inspect the exact request or state?
  • Did I verify the fix in the whole user path?

Senior Engineer Notes

Senior engineers optimize for the next occurrence, not the current incident alone. One shared fix is usually better than three local patches.


Further Reading