Targeted AI Test Generation Caught 44 of 46 Killable Bugs, but With a Catch
A developer ran an experiment testing how well AI-generated tests could detect deliberately planted bugs in Python code using a mutation-testing framework. A generic prompt producing 556 tests caught only 9 of 53 surviving mutations, while a targeted approach — writing one test per mutation with a strict pass/fail gate — caught 44 of 46 that were realistically detectable. However, the tests showed zero cross-function transfer, with 36 of the 44 catching exactly one mutation each, suggesting the AI learns the fault shown rather than improving broader coverage. The experiment also uncovered 11 bugs in the harness itself, each of which made results appear better than they were, highlighting how measurement errors tend to go unnoticed when outcomes look favorable. The author concludes that high test counts and line coverage metrics can be deeply misleading without mutation-based verification of what tests actually detect.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in