EvoOtter: Evolutionary Reproduction Test Generator

Toufique Ahmed, Jatin Ganhotra, Avraham Shinnar, Martin HirzelarXiv 2026

TL;DR

EvoOtter is an efficient framework that combines evolutionary programming with Large Language Models (LLMs) to automatically generate high-quality Bug Reproduction Tests (BRTs). By utilizing rule-based mutation testing, a resource-conscious "successive halving" strategy, and batched LLM crossover calls, it achieves state-of-the-art test generation performance at a fraction of the cost of traditional inference-scaling methods.

What Problem Does This Paper Address?

When a software bug is reported, developers ideally want a Bug Reproduction Test (BRT)—a test case that reliably fails on the buggy code base but passes once the bug is fixed (known as a Fail-to-Pass, or F2P test). Automatically generating these tests is incredibly difficult because issue descriptions are usually written in informal, natural language.

Furthermore, because the correct code fix (the oracle) doesn't exist yet when the test is being written, it is hard to know if a generated test is failing because it actually caught the bug, or if it's failing due to an unrelated syntax error or environmental issue. Prior state-of-the-art methods try to overcome this via "inference scaling"—using LLMs to generate hundreds of candidate tests and patches, and then running them to find the best match. However, this brute-force approach is computationally expensive, slow, and highly prone to overfitting.

Methods

EvoOtter introduces an elegant, cost-effective evolutionary programming loop designed specifically to work with modern frontier LLMs.

Fig. 1: Overview of EVOOTTER workflow.

Key components of the methodology include:

  • Predator-Prey Dynamics: Candidate BRTs act as "predators" trying to catch "prey"—which are rule-based, deterministic buggy variants (mutants) of the code. The fittest tests are those that successfully detect the most mutants.
  • BRT-Friendly Mutation Scoring: Traditional mutation testing marks a mutant as "killed" if a passing test suddenly fails. Since BRTs are supposed to fail on the base code, EvoOtter normalizes and compares the execution log outputs. If a mutant alters the failure log, it means the test successfully detected the code change.
  • Successive Halving: To keep test execution costs constant across generations, EvoOtter starts with a large pool of candidate tests ($n$) and a small pool of mutants ($m$). In each evolutionary step, it discards the worst-performing half of the tests and doubles the number of mutants.
Fig. 2: Timeline.
  • Batched Crossover: Instead of making separate LLM calls to mutate or cross over every single test candidate, EvoOtter feeds the entire surviving population into the LLM in a single batched call, instructing it to swap, add, or remove statements to create the next generation of offspring.

Datasets

The authors evaluated EvoOtter on three Python-based benchmarks using the pytest framework:

  1. TDD-Bench-Verified: A benchmark focused on test-driven development scenarios.
  2. SWT-Bench-Verified: A verified subset of the popular SWE-bench repository.
  3. SWE-Rebench: A newly curated, contamination-free benchmark containing software engineering tasks spanning from January 2025 to March 2026. This ensures that the evaluation models could not rely on pre-training data memorization.

Key Insights and Ideas

  • Differential Log Analysis Enables Mutation Testing on Buggy Code: You don't need a perfectly passing codebase to leverage mutation testing. Normalizing and diffing execution logs provides a strong enough signal to rank test effectiveness.
  • LLMs Excel at Batch Refinement: While generating highly diverse initial tests in a single prompt is difficult, asking an LLM to perform crossover and repair on an entire batch of existing tests simultaneously works remarkably well and slashes API costs.
  • Mutation Scores Maintain Diversity Better Than LLM Critics: While LLMs are highly effective at picking the single best test in early rounds, they exhibit bias that reduces population diversity. Mutation-based selection maintains a more diverse pool, allowing the crossover phase to produce superior test evolutions over time.

Key Results

  • State-of-the-Art F2P Rates: Using Claude-Opus-4.7 with a single-prompting setup, EvoOtter achieved a 75.3% F2P rate on TDD-Bench-Verified and 66.3% on SWE-Rebench, outperforming all published, peer-reviewed baselines.
  • Drastic Cost Reductions: The evolutionary loop costs a mere $0.17 on average per instance (excluding initial test generation). By replacing expensive heterogeneous prompting with single-prompt batch generation, the total cost dropped to $0.88 per instance, making the use of expensive, high-reasoning frontier models economically viable.
  • Resilience to Contamination: EvoOtter performed consistently well on both pre-cutoff and post-cutoff instances within the SWE-Rebench dataset, demonstrating true generalization rather than data memorization.

Limitations and Future Work

  • Language and Framework Constraints: The framework is currently implemented and evaluated exclusively for Python repositories using pytest. Extension to other languages like Java or Go remains future work.
  • Fixed Population Hyperparameters: Due to high inference costs, the authors restricted the initial population size to 8 tests. A deeper sensitivity analysis exploring larger initial populations (e.g., 16 or 32 tests) could yield even higher accuracy.
  • Dependency on Frontier Models: The batched crossover mechanism relies heavily on the long-context understanding and advanced reasoning capabilities of top-tier models; smaller or older LLMs may not handle batch test refinement as effectively.

Summary updated

BibTeX
@misc{ahmed2026evootter,
  author = {Toufique Ahmed and Jatin Ganhotra and Avraham Shinnar and Martin Hirzel},
  title = {{EvoOtter: Evolutionary Reproduction Test Generator}},
  year = {2026},
  eprint = {2607.02854},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2607.02854},
}
Figure