arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2605.22175cs.SEcs.AI
收藏

SWE-Mutation:LLMs能否在软件工程中生成可靠的测试套件?

SWE-Mutation: Can LLMs Generate Reliable Test Suites in Software Engineering?

State Key Laboratory of Cognitive Intelligence(认知智能国家重点实验室);University of Science and Technology of China(中国科学技术大学);Beihang University(北航);School of Mathematical Sciences, Peking University(北京大学数学科学学院);NeoShell AI;Institute of Artificial Intelligence, Hefei Comprehensive National Science Center(合肥综合性国家科学中心人工智能研究院)

Yuxuan Sun, Yuze Zhao, Yufeng Wang, Yao Du, Zhiyuan Ma, Jinbo Wang, Mengdi Zhang, Kai Zhang, Zhenya Huang

AI总结:

本文提出SWE-Mutation基准,用于评估LLM生成的测试套件质量,通过系统性地变异解决方案来测试测试套件的可靠性,并发现当前LLM在生成可靠且具有判别力的测试套件方面存在不足。

摘要:

评估软件工程能力已成为现代大语言模型(LLMs)的核心组成部分;然而,进一步扩展的关键瓶颈不在于高质量解决方案的稀缺,而在于高质量测试套件的缺乏。测试套件对于合成程序修复轨迹和在强化学习中提供精确反馈信号至关重要。不幸的是,由于标注成本高且困难,高质量测试套件长期以来难以获得,而由LLM自动生成的测试套件往往肤浅且缺乏足够的判别力。作为构建高质量测试套件的第一步,我们介绍了SWE-Mutation,一个用于评估LLM生成测试套件的基准。该基准通过引入系统性变异的解决方案来表征测试套件,这些变异试图“欺骗”测试套件并通过验证。我们进一步提出了一种代理、语言无关的框架,用于自动生成复杂的变异体。我们的基准包含2,636个变异体,源自800个原始实例,并包含覆盖九种编程语言的多语言子集。对七种LLM的实验表明,即使DeepSeek-V3.1也仅达到10.20%的验证率和36.15%的检测率,突显了当前LLM的不足。此外,我们的代理变异策略增强了现实性,与传统方法相比,将平均检测率从71.04%降低到39.81%。这些发现揭示了当前LLM在生成可靠且具有判别力的测试套件方面存在的持续缺陷。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑