Otter: Generating Tests from Issues to Validate SWE Patches
Toufique Ahmed, Jatin Ganhotra, Rangeet Pan, Avraham Shinnar, Saurabh Sinha, Martin Hirzel
Abstract
While there has been plenty of work on generating tests from existing code, there has been limited work on generating tests from issues. A correct test must validate the code patch that resolves the issue. This paper focuses on the scenario where that code patch does not yet exist. Doing so supports two major use-cases. First, it supports TDD (test-driven development), the discipline of "test first, write code later" that has well-documented benefits for human software engineers. Second, it also validates SWE (software engineering) agents, which generate code patches for resolving issues. This paper introduces TDD-Bench-Verified, a benchmark for generating tests from issues, and Otter, an LLM-based solution for this task. Otter augments LLMs with rule-based analysis to check and repair their outputs, and introduces a novel self-reflective action planner. Experiments show Otter outperforming state-ofthe-art systems for generating tests from issues, in addition to enhancing systems that generate patches from issues. We hope that Otter helps make developers more productive at resolving issues and leads to more robust, well-tested code.
Ask Lune
Know this paper in minutes, not an afternoon.
Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.
7 top-tier papers have cited it since. Know what they found before your reviewers do.
Lune can draw on
the full paper · the top-tier papers that cite it · related work
Free to start. No credit card required.
Lineage
- SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents cites CodeT: Code Generation with Generated Tests
- SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents cites Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproduction
- Comprehend, Imitate, and then Update: Unleashing the Power of LLMs in Test Suite Evolution cites SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents
- Comprehend, Imitate, and then Update: Unleashing the Power of LLMs in Test Suite Evolution cites SWE-bench: Can Language Models Resolve Real-world Github Issues?
- Automated Generation of Issue-Reproducing Tests by Combining LLMs and Search-Based Testing cites SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents
- Automated Generation of Issue-Reproducing Tests by Combining LLMs and Search-Based Testing cites SWE-bench: Can Language Models Resolve Real-world Github Issues?
- Automated Generation of Issue-Reproducing Tests by Combining LLMs and Search-Based Testing cites Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproduction
- iCoRe: An Iterative Correlation-Aware Retriever for Bug Reproduction Test Generation cites SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents
- iCoRe: An Iterative Correlation-Aware Retriever for Bug Reproduction Test Generation cites SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering
- iCoRe: An Iterative Correlation-Aware Retriever for Bug Reproduction Test Generation cites Heterogeneous Prompting and Execution Feedback for SWE Issue Test Generation and Selection
- iCoRe: An Iterative Correlation-Aware Retriever for Bug Reproduction Test Generation cites Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproduction
- SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering cites SWE-bench: Can Language Models Resolve Real-world Github Issues?
- SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering cites Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproduction
- Heterogeneous Prompting and Execution Feedback for SWE Issue Test Generation and Selection cites SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code Agents
- Heterogeneous Prompting and Execution Feedback for SWE Issue Test Generation and Selection cites CodeT: Code Generation with Generated Tests
- Heterogeneous Prompting and Execution Feedback for SWE Issue Test Generation and Selection cites SWE-bench: Can Language Models Resolve Real-world Github Issues?
- Heterogeneous Prompting and Execution Feedback for SWE Issue Test Generation and Selection cites SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering
- Heterogeneous Prompting and Execution Feedback for SWE Issue Test Generation and Selection cites Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproduction
- Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproduction cites CodeT: Code Generation with Generated Tests
- Compiling Large Multi-modal Requirement Documents into Runnable Software Systems: From an Agentic Test-Driven Perspective cites SWE-bench: Can Language Models Resolve Real-world Github Issues?
- Compiling Large Multi-modal Requirement Documents into Runnable Software Systems: From an Agentic Test-Driven Perspective cites SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering
- Compiling Large Multi-modal Requirement Documents into Runnable Software Systems: From an Agentic Test-Driven Perspective cites Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproduction
Cited by top-tier papers7
- Heterogeneous Prompting and Execution Feedback for SWE Issue Test Generation and SelectionToufique Ahmed, Jatin Ganhotra, Avraham Shinnar, Martin HirzelICSE 2026 · 2 citations
- Comprehend, Imitate, and then Update: Unleashing the Power of LLMs in Test Suite EvolutionTangzhi Xu, Jianhan Liu, Yuan Yao, Cong Li et al.ASE 2025 · 1 citation
- Automated Generation of Issue-Reproducing Tests by Combining LLMs and Search-Based TestingKonstantinos Kitsios, Marco Castelluccio, Alberto BacchelliASE 2025 · 1 citation
- Compiling Large Multi-modal Requirement Documents into Runnable Software Systems: From an Agentic Test-Driven PerspectiveWeiyu Kong, Yun Lin, Xiwen Teoh, Duc-Minh Nguyen et al.ISSTA 2026 · 1 citation
- iCoRe: An Iterative Correlation-Aware Retriever for Bug Reproduction Test GenerationJunyi Wang, Jialun Cao, Zhongxin LiuFSE 2026
Builds on6
- SWE-bench: Can Language Models Resolve Real-world Github Issues?Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao et al.ICLR 2024 · 2,082 citations
- SWE-agent: Agent-Computer Interfaces Enable Automated Software EngineeringJohn Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret et al.NeurIPS 2024 · 2,059 citations
- SWT-Bench: Testing and Validating Real-World Bug-Fixes with Code AgentsNiels Mündler, Mark Niklas Müller, Jingxuan He, Martin T. VechevNeurIPS 2024 · 172 citations
- Large Language Models are Few-shot Testers: Exploring LLM-based General Bug ReproductionSungmin Kang, Juyeon Yoon, Shin YooICSE 2023 · 163 citations
- CodeT: Code Generation with Generated TestsBei Chen, Fengji Zhang, Anh Nguyen, Daoguang Zan et al.ICLR 2023 · 64 citations
Related papers
- UTBoost: Rigorous Evaluation of Coding Agents on SWE-BenchBoxi Yu, Yuxuan Zhu, Pinjia He, Daniel KangACL 2025 · 20 citations
- SWE-Swiss: A Multi-Task Fine-Tuning and RL Recipe for High-Performance Issue ResolutionZhenyu He, Qingping Yang, Wei Shen, Xiaojian Zhong et al.ACL Findings 2026
- Test-Driven Development and LLM-based Code GenerationNoble Saji Mathews, Meiyappan NagappanASE 2024 · 15 citations
- Can Agent Fix Agent Issues?Alfin Wijaya Rahardja, Junwei Liu, Weitong Chen, Zhenpeng Chen et al.NeurIPS 2025 · 4 citations
- Issue2Test: Generating Reproducing Test Cases from Issue ReportsNoor Nashid, Islem Bouzenia, Michael Pradel, Ali MesbahICSE 2026 · 1 citation
