Turn a bug report into a failing test

A failing test with reproduction steps, expected versus observed behaviour and a short list of code areas to inspect.

Choose one of three approaches. The steps for that option appear below.

Choose an option above. On a phone, swipe the tabs left or right to see all options →

Claude: drafts outline, failing test and code areas

One Claude chat drafts the outline, the failing test and candidate areas. You run the test and decide.

  1. You

    Gather report

  2. Claude

    Draft all three

  3. You

    Check and decide

  1. Gather the bug report and module

    Use: You

    Have ready: the bug report and the 120-line module.

    Check

    Fill gaps by asking the reporter.

  2. Draft outline, failing test and code areas

    Use: Claude

    In one chat, ask for a numbered reproduction outline, a failing test using the reported inputs, and candidate code areas (not fixes). Mark inferred steps.

    Details

    What to paste into the tool

    Task: Reproduction outline and points still to confirm. Here is a user-written bug report. Extract a numbered reproduction outline: steps, inputs, and the expected behaviour. Mark any step you inferred rather than read in the report, and list what is still to confirm. Names appear as codes such as P1; keep the codes in your output. Task: Test file. Here is the module the report concerns. Draft one test file that follows the reproduction outline and uses the reported inputs exactly. The test must fail now and pass once the reported behaviour is correct. Do not change the module. Task: Candidate locations. Without changing anything, list the areas of this module likely involved in the failing behaviour. Label every suggestion as a candidate area, not a fix.

  3. Run the test, check areas, approve or hold

    Use: You

    Run the test and confirm why it fails. Step through it, keep the areas it really touches and drop the rest.

    Check

    Run the test; check the failure reason. Check each suggested code area by stepping through the failing test and discard areas that do not contribute. Approve the shortlist only after stepping through the failing test.

Before you paste into any AI tool, remove any confidential information. Put it back at the end.

Tools in this workflow

Deciding between ChatGPT and Claude for this? See the comparison.

Final check

The developer runs the test and confirms it fails for the reported reason; no AI path executes the code itself.

Inferred reproduction steps are marked and gaps are filled with the reporter.

Likely code areas are treated as hypotheses, not fixes, and non-contributing areas are discarded by stepping through the failing test.

No path modifies the module.

Check the result against your original inputs. Approve it before sharing or acting.

What still needs checking
  • ChatGPT Codex plan availability and limits, and Copilot agent-mode consumption beyond listed items, were not captured on the cited pages.
  • Whether any tool produces a test that fails for the reported reason is unchecked everywhere; the developer's run is the control in all paths.

Share this page