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

E-Test:持续改进的测试套件

E-Test: E'er-Improving Test Suites

Università della Svizzera Italiana (USI)(瑞士意大利语大学);Università Milano-Bicocca(米兰比可卡大学);Constructor Institute of Technology (CIT)(Constructor技术学院)

Ketai Qiu, Luca Di Grazia, Leonardo Mariani, Mauro Pezzè

AI总结:

E-Test通过利用大型语言模型识别未测试的执行场景,有效提升测试套件质量并减少维护成本。

摘要:

测试套件本质上是不完美的,测试人员可以始终通过添加新的测试用例来提高其质量,从而提高目标软件系统的可靠性。然而,找到探索现有套件之外执行场景的测试用例可能非常具有挑战性且劳动密集,尤其是在管理大型测试套件的长时间期内。在本文中,我们提出了E-Test,一种方法,通过将测试套件与生产中出现的执行场景相结合,缩小测试套件探索的执行空间与测试后经历之间的差距。E-Test(i)从大量场景中识别尚未测试的执行,例如在高强度生产使用期间监控的那些,(ii)生成新的测试用例以增强测试套件。E-Test利用大型语言模型(LLMs)来定位当前测试套件无法充分覆盖的场景,并通过执行这些场景的测试用例来增强套件。我们在1975个场景的数据集上进行了评估,这些场景来自已投入生产的高星开源Java项目和Defects4J。结果表明,E-Test在检索尚未测试的执行场景方面显著优于最先进的方法。尽管现有的回归测试和现场测试方法在该任务上的最大F1分数为0.34,而普通的LLMs达到最大F1分数为0.39,E-Test达到0.55。这些结果突显了E-Test在通过有效针对尚未测试的执行场景来增强测试套件以及减少维护测试套件所需手动努力方面的影响力。

英文摘要:

Test suites are inherently imperfect, and testers can always enrich a suite with new test cases that improve its quality and, consequently, the reliability of the target software system. However, finding test cases that explore execution scenarios beyond the scope of an existing suite can be extremely challenging and labor-intensive, particularly when managing large test suites over extended periods. In this paper, we propose E-Test, an approach that reduces the gap between the execution space explored with a test suite and the executions experienced after testing by augmenting the test suite with test cases that explore execution scenarios that emerge in production. E-Test (i) identifies executions that have not yet been tested from large sets of scenarios, such as those monitored during intensive production usage, and (ii) generates new test cases that enhance the test suite. E-Test leverages Large Language Models (LLMs) to pinpoint scenarios that the current test suite does not adequately cover, and augments the suite with test cases that execute these scenarios. Our evaluation on a dataset of 1,975 scenarios, collected from highly-starred open-source Java projects already in production and Defects4J, demonstrates that E-Test retrieves not-yet-tested execution scenarios significantly better than state-of-the-art approaches. While existing regression testing and field testing approaches for this task achieve a maximum F1-score of 0.34, and vanilla LLMs achieve a maximum F1-score of 0.39, E-Test reaches 0.55. These results highlight the impact of E-Test in enhancing test suites by effectively targeting not-yet-tested execution scenarios and reducing manual effort required for maintaining test suites.

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

↑