arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2307.16023cs.SE
收藏

基于神经网络的测试预言生成:大规模评估与经验教训

Neural-Based Test Oracle Generation: A Large-scale Evaluation and Lessons Learned

Soneya Binta Hossain, Antonio Filieri, Matthew B. Dwyer, Sebastian Elbaum, Willem Visser

AI总结:

该研究通过大规模复现实验评估前沿神经网络测试预言生成方法TOGA的实际有效性,发现其存在误分类率高、假阳性多等局限,为该领域技术改进与评估提供了参考。

摘要:

定义测试预言是测试开发的关键核心环节,但人工构建测试预言的成本很高。尽管近年基于神经网络的自动化测试预言生成技术已展现出潜力,但它们在实际场景中的有效性仍是一个值得深入探究的重要问题。本文研究了Dinella等人近期提出的基于神经网络的自动测试预言生成方法TOGA的有效性。TOGA利用EvoSuite生成的测试输入,同时生成异常预言和断言预言。在Defects4J基准的研究中,TOGA的表现优于基于规约、搜索和神经网络的其他方法,共检测到57个缺陷,其中包括30个其他方法未检测到的独有缺陷。为更深入地了解其在真实场景中的适用性,我们对TOGA开展了一系列外部复现、扩展复现和概念复现研究。\n在一项涵盖25个真实Java系统、22.35万个测试用例和5.1万个注入故障的大规模研究中,我们评估了TOGA相对于当前工业界最佳实践和学术界前沿方法在提升故障检测有效性方面的能力。研究发现,TOGA对所需预言类型的误分类率为24%;而在分类正确的情况中,约62%的情况下它的置信度不足,无法生成任何断言预言。当它确实生成断言预言时,其中超过47%为假阳性,且真阳性断言仅使故障检测率相较于已有工作提升了0.3%。这些发现揭示了当前前沿的基于神经网络的测试预言生成技术的局限性,为后续改进提供了宝贵见解,也为评估未来的自动测试预言生成方法提供了经验参考。

英文摘要:

Defining test oracles is crucial and central to test development, but manual construction of oracles is expensive. While recent neural-based automated test oracle generation techniques have shown promise, their real-world effectiveness remains a compelling question requiring further exploration and understanding. This paper investigates the effectiveness of TOGA, a recently developed neural-based method for automatic test oracle generation by Dinella et al. TOGA utilizes EvoSuite-generated test inputs and generates both exception and assertion oracles. In a Defects4j study, TOGA outperformed specification, search, and neural-based techniques, detecting 57 bugs, including 30 unique bugs not detected by other methods. To gain a deeper understanding of its applicability in real-world settings, we conducted a series of external, extended, and conceptual replication studies of TOGA. In a large-scale study involving 25 real-world Java systems, 223.5K test cases, and 51K injected faults, we evaluate TOGA's ability to improve fault-detection effectiveness relative to the state-of-the-practice and the state-of-the-art. We find that TOGA misclassifies the type of oracle needed 24% of the time and that when it classifies correctly around 62% of the time it is not confident enough to generate any assertion oracle. When it does generate an assertion oracle, more than 47% of them are false positives, and the true positive assertions only increase fault detection by 0.3% relative to prior work. These findings expose limitations of the state-of-the-art neural-based oracle generation technique, provide valuable insights for improvement, and offer lessons for evaluating future automated oracle generation methods.

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

↑