<!-- llms-explorer concept facts · https://llms-explorer.com/tree/debugging-strategies/ · pack 2026-09-08 · ~2878 tokens -->

# Debugging Strategies

> Transform debugging from frustrating guesswork into systematic problem-solving with proven strategies, powerful tools, and methodical approaches.

Parent: [Debugging Techniques](https://llms-explorer.com/tree/debugging-techniques/) · 13 facets · 49 facts · page: https://llms-explorer.com/tree/debugging-strategies/

## Debugging Strategies

- Transform debugging from frustrating guesswork into systematic problem-solving with proven strategies, powerful tools, and methodical approaches. — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#debugging-strategies)

## When to Use This Skill

- Tracking down elusive bugs — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#when-to-use-this-skill)
- Investigating performance issues — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#when-to-use-this-skill)
- Understanding unfamiliar codebases — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#when-to-use-this-skill)
- Debugging production issues — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#when-to-use-this-skill)
- Analyzing crash dumps and stack traces — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#when-to-use-this-skill)
- Profiling application performance — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#when-to-use-this-skill)
- Investigating memory leaks — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#when-to-use-this-skill)
- Debugging distributed systems — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#when-to-use-this-skill)

## 1. The Scientific Method

- 1. Observe: What's the actual behavior? 2. Hypothesize: What could be causing it? 3. Experiment: Test your hypothesis 4. Analyze: Did it prove/disprove your theory? 5. Repeat: Until you find the root cause — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#1-the-scientific-method)

## 2. Debugging Mindset

- "It can't be X" - Yes it can — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#2-debugging-mindset)
- "I didn't change Y" - Check anyway — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#2-debugging-mindset)
- "It works on my machine" - Find out why — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#2-debugging-mindset)
- Reproduce consistently — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#2-debugging-mindset)
- Take breaks when stuck — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#2-debugging-mindset)

## 3. Rubber Duck Debugging

- Explain your code and problem out loud (to a rubber duck, colleague, or yourself). Often reveals the issue. — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#3-rubber-duck-debugging)

## JavaScript/TypeScript Debugging

- VS Code Debugger Configuration: — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#javascripttypescript-debugging)

## Technique 2: Differential Debugging

- Compare working vs broken: — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#technique-2-differential-debugging)

## Best Practices

- Reproduce First: Can't fix what you can't reproduce — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#best-practices)
- Isolate the Problem: Remove complexity until minimal case — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#best-practices)
- Read Error Messages: They're usually helpful — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#best-practices)
- Check Recent Changes: Most bugs are recent — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#best-practices)
- Use Version Control: Git bisect, blame, history — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#best-practices)
- Take Breaks: Fresh eyes see better — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#best-practices)
- Document Findings: Help future you — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#best-practices)
- Fix Root Cause: Not just symptoms — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#best-practices)

## Common Debugging Mistakes

- Making Multiple Changes: Change one thing at a time — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#common-debugging-mistakes)
- Not Reading Error Messages: Read the full stack trace — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#common-debugging-mistakes)
- Assuming It's Complex: Often it's simple — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#common-debugging-mistakes)
- Debug Logging in Prod: Remove before shipping — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#common-debugging-mistakes)
- Not Using Debugger: console.log isn't always best — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#common-debugging-mistakes)
- Giving Up Too Soon: Persistence pays off — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#common-debugging-mistakes)
- Not Testing the Fix: Verify it actually works — [source](https://llms-explorer.com/sources/mdb-context-hub/debugging-strategies/#common-debugging-mistakes)

## Where this helps

- Tracking down an intermittent bug that only reproduces in production, where systematic hypothesis testing narrows the search space faster than guessing. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Debugging someone else's unfamiliar codebase, where rubber-duck explaining each line forces you to read what the code actually does rather than what you assume it does. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Isolating a regression introduced by a recent change, using differential debugging (bisecting between a working and a broken state) instead of guessing which commit is at fault. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Working a flaky test failure that different engineers keep dismissing as "probably a timing issue" without anyone ever confirming the actual mechanism. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*

## How to apply this

- Apply the scientific method explicitly: form a specific, falsifiable hypothesis about the bug's cause before changing any code, then design a test that would prove or disprove it. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Use differential debugging by bisecting between a known-good and known-bad state (a specific commit, a specific input) rather than guessing which of several recent changes caused a regression. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Practice rubber-duck debugging by explaining the code's intended behavior out loud or in writing, line by line, before reaching for a debugger — articulating it often surfaces the mismatch between intent and actual code. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Match the technique to the bug type: differential/bisection for regressions, systematic hypothesis testing for logic errors, and dedicated concurrency tools (not scattered print statements) for race conditions. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*

## Antipatterns

- Changing multiple things at once while chasing a bug, which makes it impossible to tell which change actually fixed (or didn't fix) the problem. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Reaching for a debugger or print statements before forming any hypothesis about the cause, turning debugging into unguided exploration instead of a directed search. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Dismissing a flaky failure as "probably timing" without ever confirming the mechanism, which lets the same class of bug resurface repeatedly under a different symptom. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Adding heavy logging or breakpoints to a suspected concurrency bug without considering that the instrumentation itself can change timing and hide the very race condition being hunted (a Heisenbug). — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*

## Known issues

- The scientific method for debugging takes real discipline under time pressure; teams under deadline stress tend to revert to guess-and-check. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Differential and bisection debugging assumes a reliably reproducible failure and a clean history of intermediate states — neither is guaranteed for flaky or environment-dependent bugs. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Rubber-duck debugging works best on logic errors you can reason through; it does little for bugs caused by external state such as race conditions, network timing, or third-party service behavior. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*
- Strategies that work well for deterministic bugs often fail on concurrency bugs, where the act of adding logging or breakpoints can itself change timing and hide the bug. — [source](https://llms-explorer.com/tree/debugging-strategies/) *(AI-suggested, synthesized from this pack's existing facts — not extracted from a source document.)*

## Context files

- [Debugging Strategies](https://llms-explorer.com/downloads/sources/mdb-context-hub/debugging-strategies.md)
