SWE-Mutation: Can LLMs Generate Reliable Test Suites in Software Engineering? Yuxuan Sun1 , Yuze Zhao1 , Yufeng Wang2 , Yao Du3 , Zhiyuan Ma1 , Jinbo Wang4 , Mengdi Zhang5 , Kai Zhang1 , Zhenya Huang1,6 * , 1 State Key Laboratory of Cognitive Intelligence, University of Science and Technology of China 2 Independent Researcher. 3 Beihang University. 4 School of Mathematical Sciences, Peking University 5 NeoShell AI. 6 Institute of Artificial Intelligence, Hefei Comprehensive National Science Center {sunyuxuan, yuzezhao, zhyma}@mail.ustc.edu.cn, {yfwang1118, mdzhangmd}@gmail.com [email protected], [email protected], {kkzhang08, huangzhy}@ustc.edu.cn
Abstract
arXiv:2605.22175v1 [cs.SE] 21 May 2026
Evaluating software engineering capabilities has become a core component of modern large language models (LLMs); however, the key bottleneck hindering further scaling lies not in the scarcity of high-quality solutions, but in the lack of high-quality test suites. Test suites are indispensable both for synthesizing program repair trajectories and for providing precise feedback signals in reinforcement learning. Unfortunately, due to the high cost and difficulty of annotation, high-quality test suites have long been hard to obtain, while those automatically generated by LLMs tend to be superficial and lack sufficient discriminative power. As a first step toward constructing high-quality test suites, we introduce SWE-Mutation, a benchmark for evaluating LLM-generated test suites. The benchmark characterizes test suites by introducing systematically mutated solutions that attempt to “fool” the test suites and pass validation. We further propose an agentic, languageagnostic framework for automatically generating complex mutants. Our benchmark consists of 2,636 mutated variants derived from 800 original instances and includes a multilingual subset spanning nine programming languages. Experiments on seven LLMs reveal that even DeepSeek-V3.1 achieves only 10.20% verification and 36.15% detection rates, highlighting the inadequacy of current LLMs. Additionally, our agentic mutation strategy enhances realism, reducing average detection rates from 71.04% to 39.81% compared to conventional methods. These findings expose persistent deficiencies in the ability of current LLMs to generate reliable and discriminative test suites.
1
Introduction
Large Language Models (LLMs) have achieved significant progress on automated software engineering (SE) tasks (Jimenez et al., 2024; Hou et al., * Corresponding author
Our code and data are available at https://github. com/Sunny4Coding/SWE-Mutation.
Figure 1: The pivotal role of test suites and high-quality mutants. The test suite serves as the verification standard for issue resolution. While trivial mutants are easily detected, complex mutants can successfully “fool” the test. This highlights that high-quality mutants are indispensable for evaluating whether a test suite is robust enough to prevent incorrect code acceptance.
2024). A common paradigm for evaluating the software engineering capabilities of LLMs is to provide a software issue together with its corresponding test suite, and consider the issue solved if the modelgenerated solution passes all tests as illustrated in Figure 1 (Chen et al., 2021; Austin et al., 2021). Improving the software engineering performance of LLMs—whether by synthesizing program repair trajectories for post-training or by collecting reward signals from the environment during reinforcement learning to estimate advantages—critically depends on the availability of test suites (Le et al., 2022; Zhang et al., 2023; Zhao et al., 2024). In this sense, the ability to automatically construct high-quality, discriminative test suites would bring us substantially closer to a systematic solution to software engineering problems (Chen et al., 2023; Liu et al., 2023). However, generating reliable test suites is notably challenging for LLMs. Unlike code generation, which is a constructive task aiming to produce one correct implementation, test case generation is inherently adversarial: it seeks to expose failures in an existing program by identifying rare,
error-triggering inputs (Yuan et al., 2023). This task suffers from severe information asymmetry, extremely sparse reward signals, and a highly irregular search space, where the vast majority of inputs are uninformative. From both theoretical and practical perspectives, test case generation is closely related to long-standing hard problems in program analysis and verification (Cadar and Sen, 2013; King, 1976), and is arguably more challenging than code generation in many realistic settings. Therefore, as shown in Figure 1, the synthesized test suites tend to be trivial. As a first step toward constructing high-quality test suites, establishing effective evaluation criteria remains insufficiently explored. Existing studies have introduced several benchmarks to assess test suite generation capabilities in software engineering tasks (Liu et al., 2023). These benchmarks typically characterize test suite discriminability by introducing systematically mutated, buggy solutions that attempt to “fool” the test suites and pass validation. Despite substantial progress, these benchmarks still suffer from notable limitations. In particular, the reliance on relatively homogeneous methodologies, combined with the inherent limitations of LLMs, often leads to the generation of trivial test suites that fail to meaningfully probe model capabilities. For instance, standard approaches often employ simple rule-based operators or few-shot prompting to generate mutants (Chen et al., 2023). However, previous research has questioned whether such artificial mutants are truly representative of real-world faults (Just et al., 2014a; Jimenez et al., 2024), as they are often easily killed by modelgenerated test suites as illustrated in Figure 1. Thus, existing benchmarks risk overestimating the quality of test suites. Furthermore, despite the widespread adoption of agentic frameworks—which enable models to deeply understand repositories through environmental interaction (Yao et al., 2023; Yang et al., 2024; Dong et al., 2025)—methods for leveraging these frameworks to generate software mutants remain underdeveloped. Second, diverse tasks require LLMs to handle multilingual repositories (Cassano et al., 2023; Zheng et al., 2023). However, most existing benchmarks remain monolingual. These constraints compromise real-world robustness and usability, posing risks to the integrity of reliable software engineering. Recent studies have indicated that LLMs can leverage code semantics to inject subtle, realistic defects that mimic human errors (Yang et al.,
2025b; Zhao et al., 2025a). Building on this idea, we introduce SWE-Mutation. Our benchmark includes two tasks: test generation and test repair. Concretely, we adopt an agentic framework to generate complex mutants to reveal flaws in synthetic test suites. Each mutant represents an erroneous mutation of the golden solution in the repository and resembles realistic errors. With these mutants, our benchmark provides faithful evaluation of model abilities. By applying our framework to SWE-bench Verified (OpenAI, 2024), we generated 1,664 mutants across 500 instances from 11 popular GitHub repositories. Our benchmark incorporates basic metrics like Pass@1 and Verified Reproduction Rate (VRR). Moreover, we introduce the Relative Detection Rate (RDR) metric, which specifically represents the relative proportion of mutants killed by the test suites. Given our language-agnostic framework, we also provide a multilingual subset with 300 instances and 972 mutants in 9 languages based on SWE-benchMultilingual (Yang et al., 2025a). We evaluate seven mainstream LLMs including Claude Sonnet 4.5 (Anthropic, 2025) and DeepSeek V3.1 (DeepSeek-AI, 2025), using two agentic frameworks: Mini-Swe-Agent (Yang et al., 2024) and Claude Code (Anthropic, 2025). Results show that models still struggle to generate reliable test suites. For instance, DeepSeek-V3.1 only gets 10.20% on VRR and 36.15% on RDR. Furthermore, models encounter significant difficulties in non-Python tasks. Our agentic mutation ensures more realistic and discriminative evaluation metrics: compared to traditional methods, the average Relative Detection Rate drops significantly from 71.04% to 39.81%. Finally, we provide a qualitative analysis of failure cases.
2
Related Work
2.1
Benchmarks for Testing in Software Engineering
The evaluation of LLMs in software engineering has evolved significantly. Early research primarily focused on simple code synthesis tasks using datasets like HumanEval and MBPP, where test suites served merely as verification oracles rather than generation targets (Chen et al., 2021; Austin et al., 2021). More recently, specific benchmarks have been developed to rigorously assess test generation abilities. For instance, TestBench and TestGenEval were introduced to evaluate the genera-
tion of unit tests and assert statements for isolated functions (Zhang et al., 2025; Jain et al., 2025). Concurrently, to capture the complexity of realworld development, the community has established repository-level benchmarks. SWE-bench set the standard for resolving issues in Python repositories (Jimenez et al., 2024), while recent extensions like SWE-smith and Multi-SWE-bench have further expanded this domain (Yang et al., 2025a; Zan et al., 2025). Despite these advancements in both unit and repository levels, existing benchmarks generally lack a robust mechanism to evaluate the quality of model-generated tests. Most rely on pass rates against human-written golden tests or simple code coverage, which are often weak proxies for assessing whether a test suite can detect subtle faults (Wang et al., 2025a).
2.2
Mutation-Based Evaluation and Generation
Mutation testing evaluates test suite quality by injecting artificial faults (mutants) (Papadakis et al., 2019). Traditional generation methods rely on rulebased operators, exemplified by tools like PIT and Major (Coles et al., 2016; Just et al., 2011). However, these rigid rules often produce trivial mutants that fail to mimic real-world complexity (Just et al., 2014b). To address this, approaches such as DeepMutation and µBERT were proposed to generate more diverse mutants via neural networks (Tufano et al., 2020; Degiovanni and Papadakis, 2022). Yet, these methods frequently struggle to ensure syntactic validity or semantic meaningfulness due to a lack of execution context. Recently, LLM-based approaches have emerged as a powerful alternative. Frameworks like BugFarm and LLMorpheus leverage LLMs to generate realistic software defects (Ibrahimzada et al., 2025; Tip et al., 2025). Despite their potential, current methods predominantly rely on static prompting strategies without active environment interaction. Consequently, they often generate non-compilable code or redundant mutants that do not align with repository logic. In contrast, SWE-Mutation introduces an agentic framework that autonomously explores the repository. By analyzing code characteristics to select specific strategies, our approach generates complex semantic mutants, effectively bridging the gap between artificial mutations and realistic bugs.
3
SWE-Mutation
SWE-Mutation is designed to evaluate the test generation and repair abilities of LLMs within realistic software engineering scenarios. Derived from realworld GitHub repositories, the benchmark comprises 500 Python instances and 300 instances across nine other languages. In SWE-Mutation, we generated a total of 2,636 mutants. Each instance supports both tasks and is equipped with 3–5 mutants generated via our agentic framework to facilitate mutation testing. This section outlines the agentic mutation framework, task definition and characteristics of SWE-Mutation. 3.1 3.1.1
Agentic Mutation Framework Overview
As shown in Figure 2, our framework to generate complex mutants includes four key modules: Locate, Mutation, Judge, and Self-Play. These modules construct a rigorous and comprehensive framework for high-quality mutant generation. Detailed statistics of the generated mutants are provided in Appendix C.2. We choose the Claude Sonnet 4 (Anthropic, 2025) as the base model for the agent modules. To rule out a potential “same-family” bias from this choice, we further conduct a systematic robustness study on the full sample set (N =500) by replacing the Claude-4 generator with DeepSeek-V3.1 and Qwen3-Coder; the resulting RDR changes are within 1.5 pp with bootstrap 95% CIs covering zero, and the Spearman rank correlations of evaluators remain 0.96 and 0.93, confirming that our conclusions do not depend on the generator family (see Appendix D.2 for the full analysis). The additional details can be found in Appendix G. 3.1.2
Locate Module
Since our goal is to make realistic mutations rather than randomly modifying code to inject bugs, we aim to constrain code modifications within a specific scope (Yu et al., 2025). In the Locate module, we restrict the files available for mutation to those modified in the golden solution. Additionally, we use Tree-sitter to parse these files and extract execution traces from Fail-to-Pass tests in the golden test suite. This is because Fail-to-Pass (F2P) tests fail on buggy code and pass on fixed code, identifying the specific defect. We focus on F2P because it uniquely captures the bug’s triggering logic and verifies the correctness of the fix. By annotating
Figure 2: The overview of our framework. Starting with the golden solution and golden test suite in a repository, we employ four modules to identify scopes, generate mutants, verify validity, and perform selection.
this trace onto the structural graph, we assist the model in understanding call relationships and test logic, enabling precise mutation. 3.1.3
Mutation Module
We aim to generate mutants that are realistic and difficult for test suites to kill. To do this, we analyzed common errors models make in SWE tasks. These errors often evade model-generated tests, leading to fix failures. We categorize these errors into five strategies. Detailed descriptions and examples for each strategy are provided in Appendix A. In each run, we select one strategy group. The model analyzes the tests in the golden test suite. It modifies code within the scope defined by the Locate module. Then, the model injects bugs based on the chosen strategy. To ensure quality and interpretability, we require the model to provide reasoning for its modifications. Examples of each strategy are provided in Appendix F. 3.1.4
Judge Module
We establish the Judge module to ensure the rationality of generated mutants. In this module, we validate the mutants against the golden test suite under three strict constraints to ensure they resemble realistic, common errors. First, the modifications must be restricted to the files touched by the golden solution. Second, the mutant must be successfully applied to the repository and pass syntax or compilation checks. Third, it must fail at least one F2P test. Instances that do not meet these requirements are returned to the Mutation module for revision
within retry limits. 3.1.5
Self-Play Module
We construct the Self-Play module to ensure that the generated mutants have difficulty and discriminatory power. Within this module, we apply a selection procedure to eliminate trivial mutants. First, leveraging the Mutation module, we sample N diverse candidate mutants by applying varying mutation strategies. Second, we use the model to generate 10 test suites for each instance under the original task setting with temperature. Third, we evaluate each candidate against these generated test suites. A high survival rate indicates that the mutant has successfully evaded detection by the model. We rank and select the top 50% that successfully evaded more than 3 test suites. 3.2
Task Formulation
For each instance in the SWE-Mutation benchmark, we design two tasks to evaluate the abilities of LLMs: test generation and test repair. Test Generation. The goal of the test generation task is to generate a complete test suite from scratch for a given problem. In this process, we only provide the model with the file path where the test suite should be generated. The model is then expected to complete the test suite by its comprehensive understanding of the code repository. Test Repair. The goal of the test repair task is to fix an existing test suite that is currently incomplete or flawed (i.e., it fails to detect existing bugs in the current repository). This repair can be achieved
by adding new test functions or modifying existing ones. Compared to generating tests entirely from scratch, this task more closely reflects real-world SE scenarios. For both tasks, we expect the generated tests to effectively detect the issues in the original buggy repository without incorrectly failing the golden solution. Furthermore, a high-quality test suite should identify as many mutants as possible. This can demonstrate the robustness of the model’s generated tests. The specific prompts used for these tasks can be found in Appendix G. 3.3
Benchmark Characteristics
We detail the features that distinguish SWEMutation from existing test suite benchmarks. This is also illustrated in Table 1. Repository-Level Environment: Unlike benchmarks restricted to file-level snippets, ours is built on well-maintained GitHub repositories with complete execution environments. Models interact via tools and CLIs, simulating complex SE scenarios rather than isolated coding tasks. Support for Agentic Frameworks: While existing benchmarks rely on prompt-only interactions, SWE-Mutation is specifically designed for agentic workflows. It supports popular frameworks like Mini-Swe-Agent and Claude Code, enabling the evaluation of agentic abilities. Multi-language Benchmark: Addressing the Python-centric limitation of current studies, we introduce SWE-Mutation-Multilingual. This extension supports nine programming languages: C, C++, Java, TypeScript, JavaScript, Rust, Go, PHP and Ruby, filling the void for repository-level evaluation in diverse linguistic settings. Agentic Mutation: Conventional methods often rely on trivial rule-based mutations that lack semantic context and are easily detected by advanced models. In contrast, our benchmark employs an agentic framework to synthesize complex mutants. This approach provides a significantly more robust metric for evaluating model abilities.
4
Experiments
4.1
Models
For models, we evaluate seven mainstream opensource and closed-source models, including Claude Sonnet 4.5 and Claude Sonnet 3.7 (Anthropic, 2025), Qwen3-Coder-480B-A35B-Instruct (Qwen Team, 2025), DeepSeek-V3.1 (DeepSeek-AI,
2025), Kimi K2-0905 (Kimi Team et al., 2025), GPT-oss-120B (OpenAI, 2025), and GLM4.6 (Zhipu AI, 2025). For brevity, some model names will be abbreviated throughout this paper. 4.2
Agentic Systems
Due to the complexity of test-suite tasks, directly prompting LLMs to produce the required changes is not effective. Therefore, we use two advanced agentic tools to address these tasks: the opensource Mini-Swe-Agent (Yang et al., 2024) and the proprietary Claude Code (Anthropic, 2025). They represent two different approaches to automating software engineering tasks. Mini-Swe-Agent enables LLMs to solve problems by interacting with codebases solely through bash commands. We select it for its lightweight design, consisting of only about 100 lines of Python code, which makes it easy to deploy. It outputs a complete shell command at each step without relying on separate “tool call” protocols. Claude Code is a command-line interface (CLI) tool designed specifically for Claude models. It allows the model to perform software tasks directly in the terminal. Unlike the general approach of Mini-Swe-Agent, Claude Code uses an optimized workflow for Claude to read, edit, and run code, representing a highly integrated agentic solution. 4.3
Evaluation Metrics
To evaluate the generated test suites effectively, we use three metrics: Pass@1, Verified Reproduction Rate (VRR) and Relative Detection Rate (RDR). The definition is detailed below: Pass@1: We employ Pass@1 to evaluate the model’s success rate in generating valid test cases within a single attempt. A generated test suite is considered successful if it is a correctly formatted git diff and can be successfully applied to the repository. Also, it should execute without triggering compilation errors. Verified Reproduction Rate (VRR): VRR measures how often the model successfully reproduces the specific issue without breaking correct functionality. A generated test suite is considered a success only if it satisfies two conditions. 1): Reproduction: It fails on the original bug. 2): Validity: It passes on the fixed golden code. We define VRR as the proportion of instances in the dataset where the generated test suite satisfies both validity and reproduction rules. This metric ensures that we
Table 1: Comparison of SWE-Mutation with state-of-the-art benchmarks. SWE-Mutation distinguishes itself to integrate agentic mutation within a repository-level environment across 10 languages, addressing the limitations of static generation and monolingual focus in prior works.
Benchmark
Scale
Langs
Agentic Loop
TestEval (Wang et al., 2025b) LLMorpheus (Tip et al., 2025) BugFarm (Ibrahimzada et al., 2025) TestGenEval (Jain et al., 2025) SWT-bench (Mündler et al., 2024)
Function Function Function File Repository
Python JavaScript Java Python Python
✗ ✗ ✗ ✗ ✓
None Few-shot LLM Pipeline LLM Rule-based None
SWE-Mutation (Ours)
Repository
10 languages
✓
Agentic Framework
only credit tests that demonstrate both correctness and effectiveness. Relative Detection Rate (RDR): RDR evaluates the effectiveness of test suites in detecting mutants. Let M(i) denote the total set of mutants generated for instance i. We define two subsets: (i) Mbase : The set of mutants killed by test suite in the original repository. (i) Mgen : The set of mutants killed by the modelgenerated test suite. To focus on evaluating the model’s performance on the specific subset of mutants that the original test suite failed to kill, we formulate RDR using the set difference operation: PN
(i)
(i)
i=1
Mgen \ Mbase
N i=1
M(i) \ Mbase
RDR = P
(i)
(1)
Equation 1 explicitly computes a micro-average by summing the absolute counts of total surviving mutants (denominator) and those successfully killed by the model (numerator) across all instances. This ensures each mutant contributes equally, preventing instances with very few mutants from disproportionately skewing the overall metric. To quantify the reliability of RDR, we further report instance-level bootstrap 95% confidence intervals (10,000 resamples) and non-parametric Wilcoxon signed-rank tests between the top model and each competitor; the detailed statistics are provided in Appendix D.3. Test repair (Mbase ̸= ∅): The metric evaluates the incremental value. It strictly focuses on the new mutants killed by the model that were missed by the original developers. Test generation (Mbase = ∅): In the absence of an original test suite, the set difference simplifies (i.e., M \ ∅ = M). In this case, the metric reduces
Mutation
|M
|
gen to the absolute Mutation Score ( |M| ), measuring the model’s overall ability.
4.4
Main Results
We evaluate seven state-of-the-art LLMs on SWEMutation using two agentic frameworks. The results on test generation and test repair tasks are presented in Table 2 and Table 3. Our analysis reveals that even the most advanced models and frameworks exhibit limited performance. Specifically, Claude-sonnet-4.5 consistently achieves the best performance across all metrics and tasks, significantly outperforming other models. For instance, in the test repair task under the Claude Code framework, it attains the highest VRR (59.20%) and RDR (81.15%). Notably, while most models achieve high Pass@1 scores, their VRR scores remain significantly lower. This discrepancy indicates that while models can easily generate syntactically correct code, constructing logically correct tests that reproduce bugs remains a challenge. For task difficulty, test generation proves to be significantly more challenging than test repair. Comparing the two tables, we observe a universal decline in metrics for the generation task. For example, even for the top-performing Claudesonnet-4.5, the VRR drops from 42.60% (Repair) to 29.80% (Generation) under the Mini-Swe-Agent framework. This underscores the higher complexity involved in synthesizing complete test suites from scratch compared to fixing existing ones. Regarding the framework impact, Claude Code demonstrates superior effectiveness compared to Mini-Swe-Agent. Detailed log analysis reveals that Mini-Swe-Agent relies solely on simple bash commands. When handling the extensive code writing for test generation, the use of “sed” commands leads to indentation errors and other syntax issues. In contrast, Claude Code addresses this with spe-
Table 2: Performance comparison on test repair task across different LLMs on SWE-Mutation. Mini-Swe-Agent
Model Claude-sonnet-4.5 Claude-sonnet-3.7 DeepSeek-V3.1 Qwen3-Coder Kimi-K2 GLM-4.6 GPT-oss-120B
Claude Code
Pass@1(%)
VRR(%)
RDR(%)
Pass@1(%)
VRR(%)
RDR(%)
97.20 94.40 96.60 87.60 83.80 83.40 74.80
42.60 29.80 33.00 38.00 40.60 29.40 24.80
79.30 62.58 66.41 68.99 74.58 71.26 36.31
99.80 97.60 96.80 96.40 86.00 95.60 86.80
59.20 52.80 58.20 50.00 54.40 49.80 36.40
81.15 66.59 68.36 70.21 74.19 73.54 39.28
Table 3: Performance comparison on test generation task across different LLMs on SWE-Mutation. Mini-Swe-Agent
Model Claude-sonnet-4.5 Claude-sonnet-3.7 DeepSeek-V3.1 Qwen3-Coder-480B Kimi-K2 GLM-4.6 GPT-oss-120B
Claude Code
Pass@1(%)
VRR(%)
RDR(%)
Pass@1(%)
VRR(%)
RDR(%)
96.20 88.40 88.20 86.20 79.40 74.60 59.80
29.80 20.60 10.20 12.40 14.60 15.20 8.00
63.70 37.47 36.15 33.33 42.59 39.79 25.61
98.00 95.40 94.00 95.20 83.60 86.20 65.60
40.40 28.80 20.40 26.80 19.20 25.40 19.20
71.71 38.60 39.09 33.21 45.12 42.11 28.73
Table 4: Performance of LLMs on test repair task in SWE-Mutation-Multilingual (Mini-Swe-Agent). Results are averaged across 9 programming language instances. Model
Figure 3: Performance gains achieved by switching from Mini-Swe-Agent to Claude Code.
cialized “Edit” tools, which facilitate the generation and modification of large-scale files. Interestingly, as illustrated in Figure 3, while models running on Claude Code generally achieve higher Pass@1 and VRR scores, there is no significant upward trend in RDR scores. This suggests that switching frameworks primarily enhances basic ability, such as formatting correctness and reproducing the bug. However, detecting complex semantic mutants requires a profound understanding of repository context, so the model’s inherent ability remains the dominant factor (Zhao et al., 2025b). 4.5
Results on SWE-Mutation-Multilingual
We evaluate the test repair task across 9 programming languages with Mini-Swe-Agent as the framework. Table 4 details the performance of five mod-
Claude-sonnet-4.5 DeepSeek-V3.1 Qwen3-Coder Kimi-K2 GLM-4.6
Pass@1 (%) VRR (%) RDR (%) 91.33 86.00 83.67 80.67 81.67
33.33 20.33 16.33 17.00 15.33
58.33 36.67 38.13 41.00 42.05
els on the test repair task. First, performance drops significantly compared to Python. Claude-sonnet4.5 achieves a VRR of 42.60% and an RDR of 79.30% on Python tasks. However, in the multilanguage setting, the scores drop to 33.33% and 58.33%, respectively. Other models show even steeper declines. This confirms that non-Python software engineering tasks are much more challenging for current LLMs. Additionally, performance varies significantly across languages. We visualize the detailed VRR and RDR distributions in Figure 4 and 5. As shown, Claude-sonnet-4.5 demonstrates robust generalization across diverse languages. In contrast, other models show contracted and irregular shapes. Specifically, performance on Java, PHP, and Rust significantly outperforms that on C/C++
Table 5: Comparison of RDR scores across different mutation strategies on the test generation task. Model
RDR on Mutation Strategy (%) Rule-Based Few-shot Agentic (Ours)
Claude-sonnet-4.5 Claude-sonnet-3.7 DeepSeek-V3.1 Qwen3-Coder Kimi-K2 GLM-4.6 GPT-oss-120B
75.43 73.25 72.92 72.16 74.12 73.88 55.55
69.52 55.25 52.86 50.18 62.43 59.55 35.27
63.70 ↓ 37.47 ↓ 36.15 ↓ 33.33 ↓ 42.59 ↓ 39.79 ↓ 25.61 ↓
Figure 4: RDR performance across 9 programming languages for different LLMs.
4.7 and JS/TS. Our analysis identifies the root cause. Models encounter major hurdles when synthesizing tests involving memory management (typical in C/C++) and event-driven mechanisms (typical in JS/TS). In Appendix F, we provide an analysis of representative failure cases. 4.6
Comparison between Mutation Strategies
We compare three mutation strategies on the test generation task: rule-based mutation (Jain et al., 2025), few-shot LLM (Tip et al., 2025) and our agentic semantic mutation. Specific prompt settings can be found in Appendix C.1. In this context, since there is no baseline test suite (Mbase = ∅), the RDR metric degenerates to the absolute percentage of mutants killed. As shown in Table 5, models achieve the highest scores on rule-based mutants. This indicates that random syntax errors are trivial to detect. Scores drop partially on mutants generated by few-shot LLM. However, models obtain the lowest scores on our semantic-level mutation. For instance, the score of Claude-sonnet4.5 drops from 85.40% to 63.70%. This proves that our semantic mutants are much harder to kill. They effectively expose the limitations of generated tests. We further analyze the score distribution across strategies. For rule-based method, model scores remain tightly clustered within a narrow range. This convergence suggests that syntactic mutants fail to distinguish model capabilities. In contrast, our method reveals distinct performance gaps between models. This variance confirms that our strategy offers superior discrimination. Additionally, evaluations using standard SE metrics further validate the quality of our mutants. Detailed results are available in Appendix C.2.
Failure Analysis
To understand why models fail on SWE-Mutation tasks, we manually checked the failed instances. We summarize the main reasons below. Lack of Global Understanding: Models tend to focus on local file content and overlook global structures, such as class hierarchies or project utilities. This leads to calls to undefined methods or the misuse of internal APIs. Furthermore, models struggle with environment dependencies and frequently confuse relative and absolute import paths or hallucinate non-existent libraries. These errors directly cause execution failures. Instability in Cross-file Interaction and Long Contexts: Models struggle to track data flow across multiple files and often fail to instantiate objects defined in separate directories. Moreover, generating extensive test files is error-prone. Models lose coherence during long code generation. We observed frequent indentation errors and truncated code. This issue is particularly severe when using simple command-line tools. We provide a detailed analysis of this in Appendix F. Cross-Lingual Failure Patterns: To further characterize how failure modes vary across programming languages, we manually inspect the failed instances on SWE-Mutation-Multilingual and summarize the most frequently observed error patterns for each of the nine languages. As shown in Table 12 (Appendix E), while the dominant failure types naturally differ across languages, issue misunderstanding and inconsistent environment/package versions remain the two most pervasive causes of failure globally. Note that because tests generated under instances sharing identical thirdparty libraries (e.g., astropy in Python and lombok in Java) often exhibit common, library-specific defects, and the distribution of these libraries across