Test vs Mutant: Adversarial LLM Agents for Robust Unit Test Generation
Pengyu Chang, Yixiong Fang, SILIN CHEN, Yanan Shi, Beijun Shen, Xiaodong Gu
Shanghai Jiao Tong University
Key points
From the paper's conclusion- To address this gap, we propose AdverTest, a novel adversarial framework for LLM-powered test case generation that pairs a test case generation agent T with a mutant generation agent M: M persistently creates mutants "hacking" the blind spots of T's current test suite, while T iteratively refines its tests to "kill" the challenging mutants, with the interaction guided by both coverage and mutation scores.
- Experimental results on Defects4J show that our approach improves fault detection rates by 8.56% over the best existing LLM-based methods and by 50.20% over EvoSuite, while remaining competitive on line and branch coverage.
Abstract
Software testing is a critical, yet resource-intensive phase of the software development lifecycle. 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, comparatively less attention has been paid to enhancing the robustness of bug detection. To address this gap, we propose AdverTest, a novel adversarial framework for LLM-powered test case generation that pairs a test case generation agent T with a mutant generation agent M: M persistently creates mutants "hacking" the blind spots of T's current test suite, whileT iteratively refines its tests to "kill" the challenging mutants, with the interaction guided by both coverage and mutation scores. Experimental results on Defects4J show that our approach improves fault detection rates by 8.56% over the best existing LLM-based methods and by 50.20% over EvoSuite, while remaining competitive on line and branch coverage.
Read the paper
Discussion · 1
Science Skim's AI key points, plus readers' public thoughts
- To address this gap, we propose AdverTest, a novel adversarial framework for LLM-powered test case generation that pairs a test case generation agent T with a mutant generation agent M: M persistently creates mutants "hacking" the blind spots of T's current test suite, while T iteratively refines its tests to "kill" the challenging mutants, with the interaction guided by both coverage and mutation scores.
- Experimental results on Defects4J show that our approach improves fault detection rates by 8.56% over the best existing LLM-based methods and by 50.20% over EvoSuite, while remaining competitive on line and branch coverage.
Readers' thoughts
No reader thoughts yet.
Related papers
- Mutation-Guided Unit Test Generation With a Large Language ModelIEEE Transactions on Software Engineering · 2026
- Do Coverage and Mutation Scores of LLM-Generated Test Suites Correlate with Their Effectiveness? (Replicability Study)Proceedings of the ACM on software engineering. · 2026
- MuMuTestUp: Mutation-Based Multi-agent Test Case UpdateProceedings of the ACM on software engineering. · 2026
- A Comprehensive Study on Large Language Models for Mutation TestingACM Transactions on Software Engineering and Methodology · 2026
- AgentTester: Improve Coverage in Automated Test Generation With Multi‐Agent as OptimizerSoftware Testing, Verification and Reliability · 2026
- Beyond Coverage: Automatic Test Suite Augmentation for Enhanced Effectiveness using Large Language ModelsProceedings of the ACM on Programming Languages · 2026