anyone else not trust AI-generated tests? been trying to actually measure if they catch anything
Ok this has been bugging me for a while. I let the AI write tests, everything's green, coverage looks great... and I still don't trust any of it lol. Because the test just asserts whatever the code already does. If there's a bug in there, the test just locks it in and moves on like nothing happened.
Like, 100% coverage means nothing if the assertions are garbage, right? The only thing that actually matters is whether the test fails when the code is wrong. And nobody's sitting there checking that by hand for a wall of generated tests.
So I started messing with mutation testing for this. Basically you break the code on purpose and see if the test notices. Doesn't notice? The test is useless, toss it.
Ended up wrapping it into a little .NET tool. FsCheck for the properties, Stryker.NET does the mutation. The LLM proposes stuff, then it gets filtered pretty hard: anything that fails on working code gets dropped, anything that survives a mutant gets dropped too. You only keep what actually killed something.
Ran it on a real CliWrap commit just so I wasn't fooling myself: 2 proposed, 1 kept (with the mutant it caught), 1 thrown out for killing zero mutants. Honestly the throwing-out part is the whole point, I'd rather it show me nothing than hand me a test that does nothing.
Not gonna pretend it's some genius original thing btw. Meta does this propose-then-refute loop internally and Mutahunter is an open source take on it. Mine just does properties instead of examples, and the LLM never gets to be the judge, all the yes/no stuff is deterministic.
Anyway, mostly just curious: does anyone here actually do this in CI? Or are you all kinda just vibing and hoping the generated tests are fine lol.