arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2502.09801cs.SE
收藏

单元测试的过去与现在:探究大语言模型(LLMs)对缺陷检测和效率的影响

Unit Testing Past vs. Present: Examining LLMs' Impact on Defect Detection and Efficiency

Rudolf Ramler, Philipp Straubinger, Reinhold Plösch, Dietmar Winkler

AI总结:

本文通过实验对比LLM支持与手动单元测试,发现LLM支持显著提升单元测试生成数量、缺陷检测率和测试效率,为LLMs在软件测试中的实际应用提供实证依据。

摘要:

将ChatGPT和GitHub Copilot等大型语言模型(LLMs)集成到软件工程工作流中,已显示出提升生产力的潜力,尤其在软件测试领域。本文研究LLM支持是否能提高单元测试期间的缺陷检测效果。基于先前比较手动和工具支持测试的研究,我们复制并扩展了一项实验:参与者在限时会话中,借助LLMs为包含植入缺陷的Java系统编写单元测试。对比LLM支持与手动测试的结果显示,LLM支持显著增加了生成的单元测试数量、缺陷检测率和整体测试效率。这些发现突显了LLMs在改善测试和缺陷检测结果方面的潜力,为其在软件测试中的实际应用提供了实证见解。

英文摘要:

The integration of Large Language Models (LLMs), such as ChatGPT and GitHub Copilot, into software engineering workflows has shown potential to enhance productivity, particularly in software testing. This paper investigates whether LLM support improves defect detection effectiveness during unit testing. Building on prior studies comparing manual and tool-supported testing, we replicated and extended an experiment where participants wrote unit tests for a Java-based system with seeded defects within a time-boxed session, supported by LLMs. Comparing LLM supported and manual testing, results show that LLM support significantly increases the number of unit tests generated, defect detection rates, and overall testing efficiency. These findings highlight the potential of LLMs to improve testing and defect detection outcomes, providing empirical insights into their practical application in software testing.

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

↑