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

基于测试相似度的测试用例优先级排序

Test Case Prioritization Using Test Similarities

Alireza Haghighatkhah, Mika Mäntylä, Markku Oivo, Pasi Kuvaja

摘要:

软件测试中的一个经典的启发式方法是奖励多样性,这意味着必须为那些与已经优先化的测试用例差异最大的测试用例分配更高的优先级。这种方法通常被称为基于相似性的测试优先级(SBTP),可以使用各种技术来实现。我们研究的目的是调查SBTP是否比随机排列更有效地发现缺陷,以及确定哪种SBTP实现会导致更好的结果。为了实现我们的目标,我们从文献中实现了五种不同的技术,并使用defects 4j数据集进行了实验,该数据集包含来自六个真实世界的开源Java程序的395个真实故障。研究结果表明,在过程的早期运行最不相似的测试用例比随机排列更有效(Vargha-Delaney A [VDA]:使用归一化压缩距离观察到的0.76-0.99)。在有效性方面,没有发现任何技术更优。局部敏感散列在很小程度上不如其他SBTP技术有效(VDA:与归一化压缩距离相比观察到0.38),但其速度大大优于其他技术(即,大约快5-111倍)。我们的研究结果让人想起一句著名的格言:“不要把所有的鸡蛋放在一个篮子里”。为了有效地消耗有限的测试预算,应该通过在测试过程的早期运行最不相似的测试用例,将其均匀地分布在系统的不同部分。

英文摘要:

A classical heuristic in software testing is to reward diversity, which implies that a higher priority must be assigned to test cases that differ the most from those already prioritized. This approach is commonly known as similarity-based test prioritization (SBTP) and can be realized using a variety of techniques. The objective of our study is to investigate whether SBTP is more effective at finding defects than random permutation, as well as determine which SBTP implementations lead to better results. To achieve our objective, we implemented five different techniques from the literature and conducted an experiment using the defects4j dataset, which contains 395 real faults from six real-world open-source Java programs. Findings indicate that running the most dissimilar test cases early in the process is largely more effective than random permutation (Vargha-Delaney A [VDA]: 0.76-0.99 observed using normalized compression distance). No technique was found to be superior with respect to the effectiveness. Locality-sensitive hashing was, to a small extent, less effective than other SBTP techniques (VDA: 0.38 observed in comparison to normalized compression distance), but its speed largely outperformed the other techniques (i.e., it was approximately 5-111 times faster). Our results bring to mind the well-known adage, "don't put all your eggs in one basket". To effectively consume a limited testing budget, one should spread it evenly across different parts of the system by running the most dissimilar test cases early in the testing process.

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

↑