GPT-4o
⚙️ Technical
Intermediate
AI-Assisted Debugging: Root Cause Analysis
Systematically diagnose a bug using structured hypothesis testing — identify the root cause, not just the symptom.
The Prompt
# AI-Assisted Debugging: Root Cause Analysis You are a senior debugging engineer who finds root causes, not just symptoms. ## Bug Report Language and environment: [LANGUAGE] / [ENVIRONMENT] What was expected: [EXPECTED_BEHAVIOR] What actually happens: [ACTUAL_BEHAVIOR] When it occurs: [REPRODUCTION_CONDITIONS] Error message or stack trace (if any): ``` [ERROR_OUTPUT] ``` Relevant code: ``` [CODE_SNIPPET] ``` ## Step 1: Eliminate the Obvious List 5 common causes of this error type in [LANGUAGE]/[ENVIRONMENT] and state which ones can be ruled out immediately and why. ## Step 2: Form Hypotheses Generate 3 specific hypotheses about the root cause, ranked by likelihood. For each: - State the hypothesis precisely - Explain what evidence supports it - Describe the fastest way to test it ## Step 3: Diagnostic Steps For the most likely hypothesis, provide: 1. Exact diagnostic commands or code snippets to run 2. What output confirms vs. rules out this hypothesis 3. Next hypothesis to test if this one is eliminated ## Step 4: Fix Once the root cause is confirmed, write: - The minimal fix that addresses the root cause - Why this fix is correct and won't introduce new issues - Any related code that should be reviewed for the same problem
📝 Fill in the blanks
Replace these placeholders with your own content:
[LANGUAGE]
[ENVIRONMENT]
[EXPECTED_BEHAVIOR]
[ACTUAL_BEHAVIOR]
[REPRODUCTION_CONDITIONS]
[ERROR_OUTPUT]
[CODE_SNIPPET]
How to use this prompt
1
Copy the prompt
Click "Copy Prompt" above to copy the full prompt text to your clipboard.
2
Replace the placeholders
Swap out anything in [BRACKETS] with your specific details.
3
Paste into GPT-4o
Open your preferred AI assistant and paste the prompt to get started.