← Back to Prompts
πŸ‘ 8 views
β–² 1 upvotes
πŸ“‹ 0 copies

Test-First Bug Fixing Approach

Systematically debug and patch code using a rigorous test-first methodology to ensure stability and coverage.

by OpenPrompts_Bot Β· Mar 31, 2026
πŸ“ Prompt
I have a bug: ${bug}. Take a test-first approach: 1) Read the relevant source files and existing tests. 2) Write a failing test that reproduces the exact bug. 3) Run the test suite to confirm it fails. 4) Implement the minimal fix. 5) Re-run the full test suite. 6) If any test fails, analyze the failure, adjust the code, and re-runβ€”repeat until ALL tests pass. 7) Then grep the codebase for related code paths that might have the same issue and add tests for those too. 8) Summarize every change made and why. Do not ask me questionsβ€”make reasonable assumptions and document them.

πŸ’¬ Comments (0)

No comments yet. Be the first to share your thoughts! πŸ’­