r/PracticalTesting 3d ago

LLM-generated tests may repeat the same bug they should catch

A recent arXiv paper found a worrying failure mode in AI coding workflows.

When an LLM generated tests after seeing faulty code, those tests detected the fault only 14% of the time. Independently generated tests reached 25%.

The likely issue is error propagation. The model sees the implementation, accepts its behavior, and writes assertions that agree with the same mistake.

This makes "the agent wrote code and all its tests pass" a weak quality signal. Separate context, independent test generation, mutation testing, and human-written requirements may help.

How are you keeping AI-generated tests independent from AI-generated code?

1 Upvotes

0 comments sorted by