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

230,439次测试失败之后:对不稳定失败分类器的实证评估

230,439 Test Failures Later: An Empirical Evaluation of Flaky Failure Classifiers

Abdulrahman Alshammari, Paul Ammann, Michael Hilton, Jonathan Bell

AI总结:

本研究针对不稳定测试失败的分类问题,基于22个Java项目的498个不稳定测试、230439条失败消息,实证评估失败去重方法的效果,发现其效果因项目而异,并给出使用指导。

摘要:

不稳定测试(flaky tests)是指即使没有代码变更,也可能非确定性地通过或失败的测试。尽管不稳定测试会造成误报,但一旦被检测到,它们通常仍会保留在测试套件中,因为人们可能也依赖它们来检测真实故障。因此,不稳定测试研究中的一个关键开放问题是:如何快速判断测试失败是由不稳定性导致的,还是它检测到了缺陷?目前的行业实践是让开发人员重新运行失败的测试:如果一个测试失败后又通过了,根据定义它就是不稳定的;如果测试持续失败,那很可能是真实故障。然而,这种方法可能既无效又低效。开发人员可能已经用于分类测试失败的另一种方法是失败去重(failure de-duplication),该方法将新发现的测试失败与之前见过的不稳定失败和真实失败进行匹配。但由于不稳定测试的失败症状可能与真实失败的症状相似,存在将真实测试失败误分类为可忽略的不稳定失败的风险。我们使用来自22个开源Java项目的498个不稳定测试的数据集,收集了包含230,439条失败消息(包括不稳定和非不稳定的)的大型数据集,从而能够对失败去重的有效性进行实证研究。我们发现,对于某些项目,这种方法极其有效(特异性达100%),而对于其他项目,该方法则完全无效。通过分析这些不稳定失败和非不稳定失败的特征,我们为开发人员应如何依赖这种方法提供了有用的指导。

英文摘要:

Flaky tests are tests that can non-deterministically pass or fail, even in the absence of code changes.Despite being a source of false alarms, flaky tests often remain in test suites once they are detected, as they also may be relied upon to detect true failures. Hence, a key open problem in flaky test research is: How to quickly determine if a test failed due to flakiness, or if it detected a bug? The state-of-the-practice is for developers to re-run failing tests: if a test fails and then passes, it is flaky by definition; if the test persistently fails, it is likely a true failure. However, this approach can be both ineffective and inefficient. An alternate approach that developers may already use for triaging test failures is failure de-duplication, which matches newly discovered test failures to previously witnessed flaky and true failures. However, because flaky test failure symptoms might resemble those of true failures, there is a risk of missclassifying a true test failure as a flaky failure to be ignored. Using a dataset of 498 flaky tests from 22 open-source Java projects, we collect a large dataset of 230,439 failure messages (both flaky and not), allowing us to empirically investigate the efficacy of failure de-duplication. We find that for some projects, this approach is extremely effective (with 100\% specificity), while for other projects, the approach is entirely ineffective. By analyzing the characteristics of these flaky and non-flaky failures, we provide useful guidance on how developers should rely on this approach.

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

↑