r/ChatGPTCoding • • 22d ago

Discussion How are you handling regression testing when coding with ChatGPT?

I've been using AI-assisted coding to develop a technical reporting app, and I've run into something that's been driving me nuts lol.

I'll identify an issue, work through a fix with AI, test it, and everything looks good. Then I'll run an older test case and discover something completely unrelated has stopped working.

The app deals with unfamiliar Excel workbooks and supporting evidence, so I've got a growing collection of test cases covering formulas, conflicting information, missing measurements and incorrect data associations.

Some comparisons are automated, but I still need to manually inspect a lot of the results. Especially situations where the output looks correct but the information has ended up in the wrong place.

I've started being much stricter about keeping fixes narrow and comparing results against previous tests. It's helped, but damn, the testing is becoming a project of its own.

I've been considering bringing GitHub into the process to organize failures and regression cases.

For those using ChatGPT or Codex on larger projects, how are you actually handling this? Are you having AI write tests before making changes, using a separate agent to review fixes, or doing most of the verification yourself?

2 Upvotes

22 comments sorted by

View all comments

2

u/BarathKanna 20d ago

What works for me on reporting-style apps is a golden folder of outputs you have already marked correct by hand, plus a tiny diff runner that only shows what changed after each fix. Looking at the whole workbook again is how wrong placement slips past. Every real bug also becomes a pinned failing case before the fix lands, and the agent is not allowed to edit those fixtures without a human. Narrow diffs help, but the regression set is the product: keep it in git, name cases by the failure they catch, and treat a silent change in a golden file as a failed CI check even when the new numbers look plausible. AI writes the candidate fix. Your saved cases decide whether it is safe.

1

u/_ACTUALin 20d ago

That's actually pretty close to how I've been approaching regression testing. I've been building up a collection of test cases with known expected outputs, and every time I fix one mapping issue, I want to make sure I haven't broken five other things lol. I like your point about treating unexpected changes to previously approved outputs as failures by default. That's a solid way to keep fixes from quietly introducing new problems.