A team ships an AI-generated pricing feature. The tests pass. Coverage sits at 83%. The dashboard is green. Everyone moves on to the next sprint.
Three weeks later, a customer reports that prices are off by a factor of ten. Not the kind of error that crashes a system. The kind that quietly sends invoices with a decimal in the wrong place.
The team pulls up the test suite. There’s a test for the pricing function. It has full branch coverage. It calls the function with sample inputs, captures the output, and asserts that the output is... whatever the function returns. The test was generated from the implementation. It asked the code what the price was, and then agreed.
The bug was present the day the code was written. The test confirmed it the same day.
This is what happens when AI writes first the code and than the tests. The tests don’t define what “correct” means. They describe what the code does. When the code is correct, the tests pass. When the code is wrong, the tests also pass. The test followed the bug.
This isn’t hypothetical. Research on LLM-generated test assertions confirms what practitioners are noticing: AI-generated tests capture what the code actually does rather than what it should do. When the code contains a bug, the tests follow the bug. Ox Security found the same pattern across 300+ repositories and gave it a name: “Fake Test Coverage.” Tests that hit the numbers without testing behavior. Present in 40-50% of AI-generated code.
How many of your tests define what “correct” means? And how many just confirm what the code already does?
The Oracle Gap
Every test does two things. First, it runs the code: calls the function, passes inputs, exercises a code path. Second, it asserts what the result should be. The first part is execution. The second part is what testing researchers call the oracle: the definition of correct behavior.
Coverage measures the first half. Only the oracle provides protection.
AI is excellent at execution. It can call every function, traverse every branch, hit every line. It can generate tests that achieve impressive coverage in minutes. What it cannot do is specify what correct behavior looks like. That definition comes from requirements, domain knowledge, architectural decisions, edge-case reasoning. It lives in someone’s head, in a specification, or nowhere at all.
When the definition of “correct” was never written down, AI fills the gap the only way it can: by reading the implementation and asserting that the implementation does what the implementation does. The test becomes a mirror of the code. A mirror can’t tell you if you have something on your face.
This is the oracle gap. AI automates the part of testing that was never the hard part. The hard part was always deciding what the code should do. That part still requires a human who understands the domain, the requirements, the edge cases, the reason behind the boundary condition. AI doesn’t have access to any of that, because most of it was never externalized. As explored earlier in this series, domain language is the channel through which AI receives behavioral intent. When the naming is generic, AI has nothing to work with. When it’s specific (”calculateDiscountedPrice,” “expectedTotalAfterTax”), the odds improve. But naming alone doesn’t replace a specification.
The natural response to “AI tests are shallow” has been to generate more of them. This makes the problem worse. AI-generated tests tend to pack more assertions per test method than human-written ones, which looks impressive on a dashboard but creates a different problem: Assertion Roulette. When a test packs multiple assertions into a single method and that test fails, you can’t tell which assertion triggered or why. The test that was supposed to help you diagnose a bug now requires its own debugging session.
The response to shallow oracles has been to generate more of them, not to make each one meaningful.
The Metric That Lied for a Decade
Here’s the uncomfortable part. Coverage was never a reliable predictor of fault detection. AI didn’t break this. AI just made the consequences impossible to ignore.
This has been settled science for over a decade. When researchers generated thousands of test suites for large Java systems and measured the correlation between coverage and the ability to catch faults, controlling for the number of tests, the correlation was low to moderate. Stronger forms of coverage offered no additional predictive power. More granular measurement didn’t help. The finding won a Distinguished Paper Award in 2014 and a Most Influential Paper award ten years later. It held up. The industry ignored it.
The reason is simple. Coverage is easy to measure, easy to display on a dashboard, and easy to turn into a policy. “All code must have 80% coverage” is a rule anyone can write and any CI pipeline can enforce. “All tests must have meaningful oracles” is not. Organizations chose the metric they could operationalize, not the metric that predicted what they cared about.
AI didn’t break this trade-off. It scaled it. When AI generates tests that hit 80% coverage in minutes, the policy is satisfied before a human asks whether any of those tests would catch a real regression. The metric that was already a weak proxy is now being gamed automatically by a tool that is very good at exactly this kind of target-hitting.
There’s a name for this phenomenon. When a measure becomes a target, it ceases to be a good measure. Coverage became a target. AI is the machine that fulfills Goodhart’s Law at industrial speed: perfect at optimizing for the metric, blind to the goal behind it.
Even Google, which operates the most sophisticated coverage infrastructure in the industry, concluded that raw coverage is “not reliably actionable.” They didn’t abandon coverage. They admitted it wasn’t enough. They built a new metric that filters coverage to only surface the gaps worth testing. If Google can’t make raw coverage meaningful, a coverage target in your CI pipeline isn’t doing what you think it’s doing.
What Measures Protection
If coverage doesn’t predict fault detection, what does? The answer turns on a simple shift in the question you ask.
Coverage asks: “did the test run this line?” That’s an execution question. A tautological test can answer it perfectly.
Mutation testing asks a different question: “if I changed this line, would a test fail?” It injects small faults into the code. Swap a comparison operator. Change a boundary condition. Flip a boolean. Then it checks whether the test suite catches the change. A test that mirrors the implementation won’t catch the mutation, because the mutation changes the behavior the test was blindly confirming. A test that specifies behavior will.
The evidence is clear: a test suite’s mutation score correlates with its ability to detect real faults, independently of coverage. And this isn’t academic. Google runs mutation testing across thousands of projects. Developers exposed to it write better tests, improve existing suites, and catch bugs that would otherwise reach production.
Property-based testing shifts the question even further. Instead of writing examples (”given input X, expect output Y”), you write properties (”for all valid inputs, this invariant holds”). Instead of checking that calculatePrice(100, 0.1) returns 90, you specify that prices are always positive, always rounded to two decimal places, and always less than or equal to the base price when a discount is applied. You don’t specify a single correct answer. You specify what “correct” looks like.
The results are striking: each property-based test discovers about 50 times as many faults as the average unit test. Not 50% more. Fifty times. You don’t need a million test cases. You need one well-specified property.
What mutation testing and property-based testing share is more important than how they differ. Both force someone to define what “correct” means before the test can exist. “Would you notice if this changed?” “What must always be true?” Neither question can be answered by reading the implementation. Both require the human judgment that AI cannot provide and coverage does not demand.
Practitioners are already making this shift. Developers using AI report reaching for mutation testing, property-based testing, and approval testing more frequently. The tools you use when you no longer trust that traditional test-first cycles produce meaningful assertions. The TDD community is adapting. The question is whether your organization has noticed.
The recommendation isn’t to throw out coverage. Coverage is useful as a diagnostic: it’s good at finding code that isn’t tested at all. Keep it for that purpose. But stop treating it as evidence of safety. Stop confusing “the tests passed” with “the code is correct.”
The Question Your Dashboard Can’t Answer
Your coverage dashboard answers one question: how much code did the tests execute?
It does not answer the question that matters: how much behavior do the tests protect?
The first question is trivially automated. AI can achieve high execution coverage in minutes. The second requires someone to specify what correct behavior looks like. That specification comes from domain knowledge, requirements, and the kind of judgment that can only be exercised by people who understand what the system is supposed to do. No model, no matter how capable, can generate that from the code alone. The code tells you what is. The oracle tells you what should be.
AI made the first question irrelevant by answering it automatically and cheaply. The gap between execution and protection is now the primary quality risk in AI-assisted development. Tests exist. Coverage is up. And nobody asked whether those tests would catch a behavioral regression.
Here’s the readiness assessment.
Pick a function that was recently modified by an AI coding assistant. Introduce a subtle behavioral change. Swap a boundary condition. Off-by-one an index. Flip a comparison operator. Run your test suite.
Did anything fail?
If yes, your tests define behavior. They specify what the code should do, independent of what it currently does. They’re testing the oracle, not mirroring the implementation.
If no, your tests confirm code. They assert that the function returns what the function returns. They’ll pass on correct code and on buggy code alike. They give you a green dashboard while the regressions accumulate underneath.
The organizations that will maintain quality under AI acceleration aren’t the ones with the highest coverage numbers. They’re the ones that can answer a question their dashboard was never designed to ask.
Would we notice if the behavior changed?


