TL;DR
This paper introduces TDD-Bench-Java, the first repository-level benchmark for generating reproduction tests from issue descriptions in Java, alongside e-Otter++, a state-of-the-art LLM-based test generation workflow. By evaluating their approach on both public open-source projects and a proprietary enterprise dataset, the authors reveal critical gaps in how AI coding assistants handle real-world, industry-grade software challenges.
What Problem Does This Paper Address?
When a developer encounters a bug, the first step in Test-Driven Development (TDD) is writing a reproduction test—a test that fails on the current buggy codebase ($\text{c}_{\text{old}}$) but passes once the fix is applied ($\text{c}_{\text{new}}$). These tests are incredibly valuable for validating fixes, but they are rarely included in issue reports.
While recent AI research has made strides in automatically generating these tests, existing benchmarks and tools focus almost exclusively on Python. Java presents unique challenges: its static type system and strict object-oriented structure mean that a poorly generated test won't just fail—it will cause compilation and build errors. Furthermore, enterprise Java bugs behave differently than open-source Python bugs, making it unclear if Python-centric tools can successfully cross the language barrier.
Methods
The authors developed e-Otter++ for Java, adapting a top-tier Python test generation agent to navigate Java's strict ecosystem. The pipeline consists of four main phases:
- Merged Localization: Unlike Python workflows that separate bug localization from test localization, e-Otter++ merges them. This accommodates the fact that Java developers frequently write tests in entirely new files rather than modifying existing ones.
- Contextualization: To prevent devastating build errors, an LLM selects the correct package name, imports, and file paths from the existing repository before generating any test code.
- Execution-Feedback Refinement: The agent generates an initial test and runs it on the buggy code. An LLM-based "critic" reviews the execution logs to determine if the test failed for the right reason (the actual bug) or due to a syntax/compilation error, iteratively repairing the test up to 10 times.
- Heterogeneous Prompting (Inference Scaling): Instead of just tweaking the LLM's generation temperature to get diverse test candidates, the system uses 6 distinct prompt "morphs" (e.g., simplifying the issue, removing confusing code snippets, or asking the LLM to draft a potential patch first). A final LLM selector picks the best candidate based on the execution logs.
Datasets
The paper evaluates its approach using two distinct datasets:
- TDD-Bench-Java: A newly curated public benchmark containing 250 instances extracted from popular open-source Java repositories (like Apache, Google, and FasterXML). Every instance is verified to ensure the developer's original test exhibits true "fail-to-pass" behavior.
- Proprietary Dataset: 150 issues from an active, internal IBM Java project. This dataset provides a "contamination-free" environment to test how well the LLMs generalize to code they couldn't have memorized during training.
Key Insights and Ideas
- The Open-Source vs. Enterprise Divide: Enterprise issues are fundamentally harder. In the public benchmark, 70.8% of issues were simple bug fixes. In the proprietary dataset, 84% were feature requests.
- The Challenge of the Blank Slate: Enterprise feature requests often require creating entirely new classes and functions. If an LLM tries to write a test for code that doesn't exist yet in $\text{c}_{\text{old}}$, it hits a wall.
- Prompt Diversity Beats Randomness: Using heterogeneous prompting (morphing the issue description) increased the pool of successful reproduction tests by more than 32% compared to standard single-prompt generation.
Key Results
- Public Benchmark Success: On TDD-Bench-Java, e-Otter++ achieved a 43.6% fail-to-pass rate using Claude-Sonnet-4.5 and 46.4% using GPT-5.2.
- The Power of Refinement: The iterative feedback loop was crucial, providing a performance boost of up to 13.6 percentage points for GPT-5.2.
- The Enterprise Reality Check: When evaluated on the proprietary dataset without hints, e-Otter++ managed a meager 4% success rate. Because enterprise issue descriptions are shorter and lack code snippets, the model couldn't guess the names of the new classes being introduced. However, when the authors provided "identifier hints" (the names of the newly introduced classes/functions), performance shot up to 20%.
Limitations and Future Work
The primary limitation highlighted is the poor quality of real-world enterprise issue descriptions, which are often brief and under-specified compared to well-documented open-source issues.
The authors conclude that fully autonomous test generation isn't ready for complex enterprise feature requests. Future research must focus on automated hint generation or designing effective human-in-the-loop workflows to help developers clarify specifications before the AI agent begins its work.
Summary updated