Skip to content
Tech

Why do my AI-generated tests pass on the bugs they were meant to catch?

83

机会

AI coding assistants generate unit tests by reading the implementation, so assertions reflect what the code currently does rather than what it should do. A test written against a buggy function learns the bug as a fixture, not a violation. Developers shipping with 90% AI-generated coverage see mutation scores stay flat and real regressions slip through unchanged. The core issue is the oracle problem: there is no ground truth for correct behavior unless you supply it, and AI assistants have no access to the requirements or intent behind the code. Research from July 2025 confirms that LLM-generated tests frequently pass on the exact buggy code they were written against, failing only when the bug is fixed.

为什么重要

A test suite that passes on broken code is worse than no test suite, because it turns the primary quality signal into a false guarantee.

我如何评估机会

机会评分是我的个人判断,而非量化指标:痛苦程度、发生频率,以及当前解决方案的匮乏程度。分数越高,意味着我认为越值得去构建。

严重性8/10

出现时造成的痛苦程度。

频率9/10

人们实际遇到它的频率。

空白空间8/10

当前针对它的优质工具有多匮乏。

更多值得解决的问题