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

通过从错误报告中提取相关测试输入丰富自动化测试用例生成

Enriching Automatic Test Case Generation by Extracting Relevant Test Inputs from Bug Reports

Wendkûuni C. Ouédraogo, Laura Plein, Kader Kaboré, Andrew Habib, Jacques Klein, David Lo, Tegawendé F. Bissyandé

AI总结:

针对自动化测试用例生成中输入相关性不足的问题,提出结合大语言模型与传统技术的BRMiner方法,从错误报告提取相关输入,提升测试生成的覆盖率与缺陷检测能力。

摘要:

软件质量与其所经受测试的有效性紧密相关。人工编写测试虽对缺陷检测至关重要,但耗时耗力,这推动了自动化测试用例生成领域的大量研究。然而,现有方法往往难以生成相关输入,限制了所生成测试的有效性。为解决这一问题,我们提出BRMiner——一种将大语言模型(LLM)与传统技术相结合的新方法,可从错误报告中提取相关输入,进而增强自动化测试生成工具的性能。本研究中,我们使用Defects4J基准以及EvoSuite、Randoop等测试生成工具对BRMiner进行评估。结果表明,BRMiner的相关输入率(RIR)达60.03%,相关输入提取准确率(RIEAR)达31.71%,显著优于仅依赖LLM的方法。整合BRMiner的输入后,EvoSuite生成更有效测试的能力得到提升,带来了代码覆盖率的增长,在多个项目的分支、指令、方法和行覆盖率上均有提升。此外,BRMiner助力检测出58个独特缺陷,其中包含传统基线方法遗漏的缺陷。总体而言,BRMiner将LLM过滤与传统输入提取技术相结合,显著提升了自动化测试生成的相关性与有效性,推动了缺陷检测能力的提升并增强了代码覆盖率,从而助力更高质量的软件开发。

英文摘要:

The quality of software is closely tied to the effectiveness of the tests it undergoes. Manual test writing, though crucial for bug detection, is time-consuming, which has driven significant research into automated test case generation. However, current methods often struggle to generate relevant inputs, limiting the effectiveness of the tests produced. To address this, we introduce BRMiner, a novel approach that leverages Large Language Models (LLMs) in combination with traditional techniques to extract relevant inputs from bug reports, thereby enhancing automated test generation tools. In this study, we evaluate BRMiner using the Defects4J benchmark and test generation tools such as EvoSuite and Randoop. Our results demonstrate that BRMiner achieves a Relevant Input Rate (RIR) of 60.03% and a Relevant Input Extraction Accuracy Rate (RIEAR) of 31.71%, significantly outperforming methods that rely on LLMs alone. The integration of BRMiner's input enhances EvoSuite ability to generate more effective test, leading to increased code coverage, with gains observed in branch, instruction, method, and line coverage across multiple projects. Furthermore, BRMiner facilitated the detection of 58 unique bugs, including those that were missed by traditional baseline approaches. Overall, BRMiner's combination of LLM filtering with traditional input extraction techniques significantly improves the relevance and effectiveness of automated test generation, advancing the detection of bugs and enhancing code coverage, thereby contributing to higher-quality software development.

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

↑