测试套件生成能力不足,新基准揭示大模型漏洞
SWE-Mutation: Can LLMs Generate Reliable Test Suites in Software Engineering?

- 用系统性变异代码测试大模型生成的测试套件
- 最强模型仅36.15%检测率,暴露生成能力缺陷
- 自研智能变异框架提升真实性,更难通过
评估软件工程能力已成为现代大语言模型的核心任务;然而阻碍进一步发展的关键瓶颈并非高质量解法稀缺,而是高质量测试套件的缺乏。测试套件对于程序修复路径合成和强化学习中的精准反馈至关重要。由于标注成本高、难度大,高质量测试套件长期难以获取,而大模型自动生成的测试套件往往表面化、区分度不足。为此,我们提出SWE-Mutation,一个用于评估大模型生成测试套件的基准。该基准通过引入系统性变异解法来“欺骗”测试套件并使其通过验证,从而评估其有效性。我们还提出一种代理式、语言无关的自动复杂变异框架。该基准包含2,636个源自800个原始实例的变异版本,并涵盖九种编程语言的多语言子集。对七款大模型的实验表明,即使是最强的DeepSeek-V3.1,验证率也仅为10.20%,检测率仅36.15%,凸显当前大模型在生成可靠、有区分力测试套件方面的严重不足。此外,我们的代理变异策略显著提升真实感,使平均检测率从71.04%降至39.81%。这些发现揭示了当前大模型在测试套件生成上的持续缺陷。
原文摘要 · Abstract (English)
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, language-agnostic 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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。