Débogage Systématique

VérifiéSûr

Une méthodologie de débogage structurée avec un arbre de décision pour reproduire, isoler et tracer les bugs. Aide les développeurs à diagnostiquer systématiquement les problèmes en comparant les environnements, en traçant le flux de données et en effectuant une recherche binaire. Utile lors de l'investigation de bugs, de crashs ou de comportements inattendus.

Spar Skills Guide Bot
DeveloppementIntermédiaire
13002/06/2026
Claude CodeCursorWindsurf
#debugging#systematic-diagnostic#decision-tree#root-cause-analysis

Recommandé pour

Notre avis

Une stratégie de débogage structurée utilisant un arbre de décision et un tableau des causes racines courantes pour reproduire, isoler et tracer systématiquement les bugs.

Points forts

  • Fournit un arbre de décision clair pour les scénarios de débogage courants
  • Inclut un tableau reliant les symptômes aux causes probables et aux vérifications
  • Met en garde contre les anti-patrons comme le débogage au hasard et la correction des symptômes

Limites

  • Suppose qu'il est possible de reproduire le bug, ce qui n'est pas toujours le cas
  • Le tableau des causes racines n'est pas exhaustif ; les bugs novices peuvent nécessiter une analyse plus approfondie
  • Nécessite une familiarité de base avec les outils de débogage (journalisation, points d'arrêt, instantanés de tas)
Quand l'utiliser

Lors de l'investigation d'un bug, d'un crash ou d'un comportement inattendu pour suivre un processus de diagnostic méthodique.

Quand l'éviter

Lorsque le problème est déjà bien compris et qu'un correctif connu peut être appliqué directement, ou pour une exploration de code sans erreur spécifique.

Analyse de sécurité

Sûr
Score qualité90/100

The skill provides a debugging guide with a decision tree, common root causes, and strategies. It only allows Bash and Read, which are safe in this context. There are no destructive commands, network calls, or data exfiltration risks.

Aucun point d'attention détecté

Exemples

Debug intermittent CI failure
I have a test that passes locally but fails intermittently in CI. It's a race condition, so I need to add timestamps to logs and isolate the issue. Use the debugging decision tree and root cause table to help me diagnose and fix it.
Trace null pointer error
I'm getting a 'Cannot read property of null' error. I need to trace the data flow backwards from the error point to find where the null value originates. Apply the systematic debugging strategy with binary search isolation.
Investigate memory leak
My application's memory usage keeps growing over time. I suspect unclosed resources or event listener leaks. Use the debugging guide to take heap snapshots before and after, identify the leak, and fix it.

name: debugging description: Systematic diagnostic strategy with decision tree for reproducing, isolating, and tracing bugs. Use when investigating bugs, crashes, or unexpected behavior. Complements systematic-debugging workflow with concrete diagnostic patterns. metadata: version: "1.0" allowed-tools: Bash Read

Debugging

Decision Tree

Bug reported → Can you reproduce it?
    ├─ Yes → Is it consistent?
    │   ├─ Yes → Add breakpoint/logging at suspected location → Trace
    │   └─ No (intermittent) → Race condition or timing issue → Add timestamps to logs
    └─ No → Check environment differences
        ├─ Works locally, fails in CI → Compare env vars, paths, timezone
        ├─ Works for others, fails for me → Check local config, versions, OS
        └─ Cannot reproduce anywhere → Get reproduction steps from reporter

Common Root Causes

| Symptom | Likely Cause | Check | |---------|-------------|-------| | Works locally, fails in CI | Env vars, file paths, timezone | Compare environments | | Intermittent failure | Race condition, flaky test, timeout | Add logging, increase timeout | | Null/undefined error | Missing null check, async ordering | Trace data flow backwards | | Memory growing | Unclosed resources, event listener leaks | Heap snapshot before/after | | Slow response | N+1 queries, missing index, large payload | Profile, check query count | | CORS error | Missing headers, wrong origin, preflight | Check server response headers | | 403/401 | Token expired, wrong scope, missing header | Inspect request headers | | "It worked yesterday" | Dependency update, config change, data change | Check git log, dep diff, recent deploys | | Passes alone, fails in suite | Shared state between tests, order dependency | Run in isolation, check setup/teardown |

Strategy

  1. Reproduce - Get a reliable reproduction case first
  2. Isolate - Binary search: remove half the variables, see if it still fails
  3. Trace - Follow data flow from input to failure point
  4. Verify - Fix should explain the symptom, not just suppress it

Anti-Patterns

  • Shotgun debugging - Changing random things hoping it works. Understand first, fix second.
  • Fix the symptom - Adding a null check without understanding why it's null. Find the root cause.
  • "It works now" - Can't explain why it broke or why the fix works. Keep investigating.
  • Printf and pray - Adding one log, running, adding another. Plan your instrumentation.
Skills similaires