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

通过优先级排序潜在的顺序依赖型不稳定测试减少测试重跑次数

Reduction of Test Re-runs by Prioritizing Potential Order Dependent Flaky Tests

University of Dhaka(达卡大学)

Hasnain Iqbal, Zerina Begum, Kazi Sakib

AI总结:

针对现有OD不稳定测试检测方法需大量无关重跑的问题,提出基于测试类共享静态字段识别潜在OD测试并排序的方法,可显著减少测试执行量与不必要重跑,提升检测效率。

摘要:

不稳定测试(flaky test)的行为不可预测,会导致自动化软件测试不可靠。这类测试在同一代码库上多次运行时,可能通过也可能失败。然而,不稳定测试即便会造成持续集成(CI)流水线失败,通常也并不对应任何代码故障。\n顺序依赖(order-dependent,OD)测试是常见的一类不稳定测试,其测试结果取决于它与其他测试用例的运行相对顺序。已有多项研究探索了OD测试的检测与修复方法,但这些方法需要多次重跑与顺序依赖无关的测试。因此,有必要对潜在的OD测试进行优先级排序,以减少重跑次数。\n本文提出了一种对潜在顺序依赖型测试进行优先级排序的方法:通过分析测试类中的共享静态字段,识别出更可能存在顺序依赖的测试。在针对27个项目模块的实验中,该方法在23个案例里成功将所有OD测试排在前列,平均减少65.92%的测试执行量,以及72.19%的不必要重跑。这些结果表明,该方法通过降低执行成本,显著提升了OD测试的检测效率。

英文摘要:

Flaky tests can make automated software testing unreliable due to their unpredictable behavior. These tests can pass or fail on the same code base on multiple runs. However, flaky tests often do not refer to any fault, even though they can cause the continuous integration (CI) pipeline to fail. A common type of flaky test is the order-dependent (OD) test. The outcome of an OD test depends on the order in which it is run with respect to other test cases. Several studies have explored the detection and repair of OD tests. However, their methods require re-runs of tests multiple times, that are not related to the order dependence. Hence, prioritizing potential OD tests is necessary to reduce the re-runs. In this paper, we propose a method to prioritize potential order-dependent tests. By analyzing shared static fields in test classes, we identify tests that are more likely to be order-dependent. In our experiment on 27 project modules, our method successfully prioritized all OD tests in 23 cases, reducing test executions by an average of 65.92% and unnecessary re-runs by 72.19%. These results demonstrate that our approach significantly improves the efficiency of OD test detection by lowering execution costs.

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

↑