Test first bug fixing approach pc 1096

Test-First Bug Fixing Approach

Scroll down to copy the prompt

Text Updated 1 min read by prompts.chat · @ilkerulusoy
Advertisement

The 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.

Open in

The prompt is copied to your clipboard — just paste it in.

Tags

Advertisement

More like this

Related prompts

Ethereum Developer

Copy this Ethereum Developer AI prompt to get a focused coding response from ChatGPT, Gemini, Claude, or another AI assistant.

Linux Terminal

Copy this Linux Terminal AI prompt to get a focused coding response from ChatGPT, Gemini, Claude, or another AI assistant.

JavaScript Console

Copy this JavaScript Console AI prompt to get a focused coding response from ChatGPT, Gemini, Claude, or another AI assistant.