Member-only story
Software DevelopmentProgrammingAICoding Before You Accept an AI Refactor, Test a Broken Version
Ferid Brković
4 min read11 hours ago
A small JavaScript counterexample can tell you whether the tests protect the behavior you care about.
Press enter or click to view image in full size
You ask a coding agent to simplify a helper and add tests. The new implementation is shorter. The tests pass. The diff looks ready.
Then a user enters “JS” and “js”, and your supposedly deduplicated tag list displays both.
A passing test suite can leave the central requirement untested. When you delegate both the code and its checks, make that requirement explicit before accepting either.
Here is a small, constructed example. It is not a transcript from a particular AI tool.…