Skip to content
PromptLab by FEHMER TECH
ENDE
Coding

Systematic Bug Fixing

Identify and fix bugs in your code with structured AI analysis.

Prompt template

Analyze the following [PROGRAMMING LANGUAGE] code and identify all bugs and errors.

**Bug Description:**
Expected behavior: [EXPECTED BEHAVIOR]
Actual behavior: [ACTUAL BEHAVIOR]
Error message (if any): [ERROR MESSAGE]

**Please analyze:**
1. **Root Cause Analysis:** What is the fundamental cause of the error?
2. **Bug Identification:** Mark the exact lines causing the bug
3. **Fix Suggestion:** Show the corrected code with explanation
4. **Side Effects:** Could the fix affect other parts of the code?
5. **Prevention:** How can similar bugs be avoided in the future?

**Context:**
- Runtime environment: [ENVIRONMENT]
- Framework/Library: [FRAMEWORK]

Buggy code:
```[PROGRAMMING LANGUAGE]
[INSERT CODE HERE]
```

Replace placeholders in [square brackets]: [PROGRAMMING LANGUAGE][EXPECTED BEHAVIOR][ACTUAL BEHAVIOR][ERROR MESSAGE][ENVIRONMENT][FRAMEWORK][INSERT CODE HERE]

How to use this template

Copy the prompt, replace the placeholders in square brackets with your details and paste it into the AI assistant of your choice. The more precise your details, the better the result.

Tips for better results

  • Always include the full error message and stack trace
  • Describe the steps to reproduce the bug
  • Specify the runtime environment and versions
  • Ask for unit tests that would cover the bug

Suitable open models

The selection names current open models as a starting point for your own tests. It is not a measurement for this template.

Keywords: #bug-fixing #debugging #error-handling #troubleshooting

Last updated: