Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generation
On the map: LLM agents and tool use → Software engineering coding agents
Abstract (arXiv)
Software testing is a critical, yet resource-intensive phase of the software development lifecycle. Over the years, various automated tools have been developed to aid in this process. Search-based approaches typically achieve high coverage but produce tests with low readability, whereas large language model (LLM)-based methods generate more human-readable tests but often suffer from low coverage and compilability. While the majority of research efforts have focused on improving test coverage and readability, little attention has been paid to enhancing the robustness of bug detection, particularly in exposing corner cases and vulnerable execution paths. To address this gap, we propose AdverTest, a novel adversarial framework for LLM-powered test case generation. AdverTest comprises two interacting agents: a test case generation agent (T) and a mutant generation agent (M). These agents engage in an adversarial loop, where M persistently creates new mutants "hacking" the blind spots of T's current test suite, while T iteratively refines its test cases to "kill" the challenging mutants produced by M. This interaction loop is guided by both coverage and mutation scores, enabling the system to co-evolve toward both high test coverage and bug detection capability. Experimental results in the Defects4J dataset show that our approach improves fault detection rates by 8.56% over the best existing LLM-based methods and by 63.30% over EvoSuite, while also improving line and branch coverage.
Key facts. Cited by 6 papers in the map (data through 7 Oct 2026). Placed in Software engineering coding agents, one of 16 directions in LLM agents and tool use. Builds on 31 of its 73 references that are in the map. First posted on arXiv 8 Feb 2026.
Builds on
31 of 73 references.
Closest ancestors · 4
Same direction, newest first
- 2026SWE-Pruner: Self-Adaptive Context Pruning for Coding Agents23 Jan
- 2025SWE-Debate: Competitive Multi-Agent Debate for Software Issue Resolution31 Jul
- 2025SWE-rebench: An Automated Pipeline for Task Collection and Decontaminated Evaluation of Software Engineering Agents26 May
- 2025TestForge: Feedback-Driven, Agentic Test Suite Generation18 Mar
Other references · 27
- 2022Chain-of-Thought Prompting Elicits Reasoning in Large Language Modelscited by 12,302
- 2021Evaluating Large Language Models Trained on Codecited by 8,053
- 2023An Empirical Evaluation of Using Large Language Models for Automated Unit Test Generationcited by 193
- 2020Unit Test Case Generation with Transformers and Focal Contextcited by 118
- 2023ChatUniTest: A Framework for LLM-Based Test Generationcited by 94
- 2024Automated Unit Test Improvement using Large Language Models at Metacited by 73
- 2025SWE-Exp: Experience-Driven Software Issue Resolutioncited by 64
- 2023Using Large Language Models to Generate JUnit Tests: An Empirical Studycited by 53
- 2023Effective Test Generation Using Pre-trained Large Language Models and Mutation Testingcited by 51
- 2022Pynguin: Automated Unit Test Generation for Pythoncited by 49
- 2024From Code to Correctness: Closing the Last Mile of Code Generation with Hierarchical Debuggingcited by 46
- 2025LongCodeZip: Compress Long Context for Code Language Modelscited by 38
15 more
- 2023WhiteFox: White-Box Compiler Fuzzing Empowered by Large Language Modelscited by 37
- 2024HITS: High-coverage LLM-based Unit Test Generation via Method Slicingcited by 37
- 2024CoverUp: Effective High Coverage Test Generation for Pythoncited by 36
- 2023A3Test: Assertion-Augmented Automated Test Case Generationcited by 33
- 2023Learning Deep Semantics for Test Completioncited by 31
- 2023CAT-LM: Training Language Models on Aligned Code And Testscited by 28
- 2024Between Lines of Code: Unraveling the Distinct Patterns of Machine and Human Programmerscited by 27
- 2025Mutation-Guided LLM-based Test Generation at Metacited by 23
- 2026In Line with Context: Repository-Level Code Generation via Context Inliningcited by 18
- 2026GlimpRouter: Efficient Collaborative Inference by Glimpsing One Token of Thoughtscited by 16
- 2024Leveraging Large Language Models for Enhancing the Understandability of Generated Unit Testscited by 11
- 2024LLMs as Continuous Learners: Improving the Reproduction of Defective Code in Software Issuescited by 10
- 2021Extracting Concise Bug-Fixing Patches from Human-Written Patches in Version Control Systemscited by 9
- 2024A Comprehensive Study on Large Language Models for Mutation Testingcited by 3
- 2025Mutation Testing via Iterative Large Language Model-Driven Scientific Debuggingcited by 3
Built on by
Citing papers per year: 2026: 6.
6 papers.
- 2026EffiSkill: Agent Skill Based Automated Code Efficiency Optimizationcited by 9
- 2026LLM Agents Can See Code Repositoriescited by 3
- 2026SkillForge: Self-Distilling Agents for Project-Specific Issue Resolutioncited by 2
- 2026Repo0: Design-Driven Zero-to-All Code Generationcited by 2
- 2026Schr"odinger's Code Repository: Have LLMs Learned SWE-bench or Memorized It?cited by 0
- 2026Beyond Rule-Based Mutation Testing: Test-Aware Mutant Generation Using Large Language Modelscited by 0
- 2026Beyond Rule-Based Mutation Testing: Test-Aware Mutant Generation Using Large Language Models24 Sep 2026
- 2026Schr"odinger's Code Repository: Have LLMs Learned SWE-bench or Memorized It?21 Aug 2026
- 2026Repo0: Design-Driven Zero-to-All Code Generation20 Aug 2026
- 2026SkillForge: Self-Distilling Agents for Project-Specific Issue Resolution19 Aug 2026
- 2026LLM Agents Can See Code Repositories12 Jun 2026
- 2026EffiSkill: Agent Skill Based Automated Code Efficiency Optimization29 Mar 2026
Similar, not cited
Close in wording, no citation either way
- 2026SWE-Mutation: Can LLMs Generate Reliable Test Suites in Software Engineering?
- 2026Multi-Agent LLM Collaboration for Unit Test Generation via Human-Testing-Inspired Workflows
- 2026Automated structural testing of LLM-based agents: methods, framework, and case studies
- 2026Complex Agents, Shallow Tests: Demystifying and Enhancing Test Adequacy of Agent Harness in the Wild
- 2025Challenges in Testing Large Language Model Based Software: A Faceted Taxonomy
- 2026ACE: Self-Evolving LLM Coding Framework via Adversarial Unit Test Generation and Preference Optimization
- 2025ImpossibleBench: Measuring LLMs' Propensity of Exploiting Test Cases
- 2025Rethinking Testing for LLM Applications: Characteristics, Challenges, and a Lightweight Interaction Protocol