RL Teaches Agents to Write Tests That Actually Cover New Ground — 52% Branch Coverage Gain Over Best Baselines
Current LLM-based test generation agents suffer from what researchers call structural myopia: they write new tests that cover the same code paths as existing tests, failing to grow test suite coverage in a principled way. The problem is fundamental—agents optimize each test independently without considering whether the test actually adds new value to the suite. TestDecision approaches this by reformulating test suite generation as a Markov Decision Process and proving mathematically that its objective exhibits monotone submodularity—a property that enables a tractable greedy step-wise procedure to approximate global optimization. Instead of generating tests in isolation, the system treats test suite building as an optimization problem where each new test should maximize marginal coverage gain. An RL training pipeline then teaches the agent to act as a "neural greedy expert" that explicitly focuses on what new coverage each test adds. On the ULT benchmark, this approach achieves 38-52% improvement in branch coverage and 298-558% improvement in execution pass rate over existing methods across all base models. Critically, the coverage gains come from writing tests that add new value, not from generating more tests that repeat existing coverage. This matters because agentic coding pipelines that use AI to maintain or grow test suites are almost certainly experiencing structural myopia. Agents generate passing tests that don't catch regressions because they cover the same paths that are already tested. The result is a false sense of security where test suites grow but actual bug detection capacity doesn't improve. The RL formulation is model-agnostic, making it applicable to existing test generation loops regardless of the underlying model. Teams can evaluate their current test generation agents using a simple metric: do the new tests actually improve branch coverage? If not, the loop is producing coverage theater rather than real quality signal. For engineering teams building autonomous CI workflows, the submodularity insight provides a way to think about test generation optimization. Rather than asking "how many tests can we generate," the better question is "what critical coverage gaps remain unfilled?" This shift from quantity to quality could dramatically improve the effectiveness of AI-assisted testing in production environments. The approach also has implications for how teams design their evaluation criteria for test generation agents. Traditional metrics focused on test pass rates or coverage percentages don't capture whether the coverage is actually useful. TestDecision shows that the key differentiator is whether new tests add value that wasn't already present in the suite. Read more about TestDecision and its neural greedy approach to test generation at the original source.