[论文解读] The Importance of Discerning Flaky from Fault-triggering Test Failures: A Case Study on the Chromium CI
本研究评估了Chromium CI中flakiness预测方法的表现,发现尽管检测flaky测试的精确度高达99.2%,但76.2%的故障触发型测试失败被错误分类为flaky,导致未能发现回归缺陷。作者提出了基于执行特征(如运行时长和flakiness率)的故障导向预测模型,显著提升了性能(MCC从0.20提升至0.42),主张从测试级别转向故障级别进行flakiness检测。
Flaky tests are tests that pass and fail on different executions of the same version of a program under test. They waste valuable developer time by making developers investigate false alerts (flaky test failures). To deal with this problem, many prediction methods that identify flaky tests have been proposed. While promising, the actual utility of these methods remains unclear since they have not been evaluated within a continuous integration (CI) process. In particular, it remains unclear what is the impact of missed faults, i.e., the consideration of fault-triggering test failures as flaky, at different CI cycles. To fill this gap, we apply state-of-the-art flakiness prediction methods at the Chromium CI and check their performance. Perhaps surprisingly, we find that, despite the high precision (99.2%) of the methods, their application leads to numerous faults missed, approximately 76.2% of all regression faults. To explain this result, we analyse the fault-triggering failures and show that flaky tests have a strong fault-revealing capability, i.e., they reveal more than 1/3 of all regression faults, indicating an inherent limitation of all methods focusing on identifying flaky tests, instead of flaky test failures. Going a step further, we build failure-focused prediction methods and optimize them by considering new features. Interestingly, we find that these methods perform better than the test-focused ones, with an MCC increasing from 0.20 to 0.42. Overall, our findings imply that on the one hand future research should focus on predicting flaky test failures instead of flaky tests and the need for adopting more thorough experimental methodologies when evaluating flakiness prediction methods, on the other.
研究动机与目标
- 评估最先进的flakiness预测方法在工业级CI流水线中的实际应用价值。
- 研究将故障触发型失败错误分类为flaky对回归缺陷检测可靠性的影响。
- 探究故障导向预测模型是否优于测试导向模型,以识别flaky失败。
- 识别有效特征(尤其是动态执行特征)以提升故障级别flakiness检测性能。
- 倡导在CI系统中从检测flaky测试转向检测flaky测试失败的范式转变。
提出的方法
- 本研究分析了9个月内10,000个Chromium CI构建中产生的180万条测试失败记录,将失败分类为flaky或fault-triggering。
- 应用最先进的基于词汇的flakiness预测模型(例如基于测试代码标记)来检测flaky测试。
- 作者重新训练模型以预测flaky失败而非flaky测试,使用故障级别特征(如运行时长和历史flakiness率)。
- 采用标准指标(包括精确度、召回率和Matthews相关系数MCC)评估模型性能。
- 对比测试导向与故障导向模型,分析性能差异及特征贡献。
- 通过过滤数据确保真实标签的可靠性,排除在任何构建中曾为flaky或fault-revealing的通过测试。
实验结果
研究问题
- RQ1现有flakiness预测方法在真实CI流水线中,对故障触发型测试失败的误分类程度如何?
- RQ2flaky测试的故障揭示能力如何影响工业环境中flakiness预测的可靠性?
- RQ3故障导向预测模型是否能优于测试导向模型,准确区分flaky失败与故障触发型失败?
- RQ4哪些特征(尤其是动态执行特征)能提升故障导向flakiness预测模型的性能?
- RQ5在大规模CI系统中,使用flaky测试检测对回归缺陷检测的实际影响是什么?
主要发现
- 尽管检测flaky测试的精确度高达99.2%,但76.2%的故障触发型测试失败被预测模型错误分类为flaky。
- flaky测试具有很强的故障揭示能力,在数据集中触发了超过三分之一(1/3)的回归缺陷。
- 故障导向预测模型的Matthews相关系数(MCC)达到0.42,显著优于测试导向模型的0.20。
- 引入运行时长和历史flakiness率等动态特征,显著增强了区分flaky失败与故障触发型失败的能力。
- 本研究揭示了当前flakiness预测的根本局限:聚焦于测试而非失败,即使在高精度模型下,仍会造成大量故障漏报。
- 研究结果表明,未来研究应优先关注故障级别flakiness检测,并在真实CI环境中采用更严格的评估方法。
阅读本论文
在 Nubint 阅读器中打开原文,边读边就任意段落提问。
在 Nubint 中阅读本论文本解读由 AI 根据论文原文生成,引用前请核对原文。