计算资源对不稳定测试(Flaky Tests)的影响
The Effects of Computational Resources on Flaky Tests
AI总结:
本文评估 CPU、内存等计算资源对不稳定测试的影响,基于 52 个多语言项目和 27 种配置识别 RAFT,发现 46.5% 的不稳定测试受资源影响。
摘要:
不稳定测试(Flaky tests)是指在代码未发生变化的情况下,以非确定方式通过或失败的测试。这些测试会损害开发者的生产力。尤其是在持续集成环境中运行测试时,测试可能会竞争有限的计算资源(如 CPU、内存等),因此我们假设资源的可用性或不可用性可能是影响不稳定测试失败率的重要因素。我们首次评估了计算资源对不稳定测试的影响,研究涵盖使用 Java、JavaScript 和 Python 编写的共 52 个项目,以及 27 种不同的资源配置。通过采用严格的统计方法,我们确定了哪些测试属于 RAFT(Resource-Affected Flaky Tests,受资源影响的不稳定测试)。我们发现,数据集中 46.5% 的不稳定测试是 RAFT,这表明通过调整运行测试时可用的资源,可以避免相当大比例的不稳定测试失败。我们向开发者报告了 RAFT 以及可用于避免这些测试的配置,并收到了积极反馈:开发者有兴趣修复 RAFT,或改进项目规范,使测试仅在不太可能遇到 RAFT 失败的配置下运行。我们的结果对尝试检测不稳定测试的研究人员也具有启示,例如,在运行测试时减少可用资源是一种具有成本效益的方法,可检测出更多不稳定失败。
英文摘要:
Flaky tests are tests that nondeterministically pass and fail in unchanged code. These tests can be detrimental to developers' productivity. Particularly when tests run in continuous integration environments, the tests may be competing for access to limited computational resources (CPUs, memory etc.), and we hypothesize that resource (in)availability may be a significant factor in the failure rate of flaky tests. We present the first assessment of the impact that computational resources have on flaky tests, including a total of 52 projects written in Java, JavaScript and Python, and 27 different resource configurations. Using a rigorous statistical methodology, we determine which tests are RAFT (Resource-Affected Flaky Tests). We find that 46.5% of the flaky tests in our dataset are RAFT, indicating that a substantial proportion of flaky-test failures can be avoided by adjusting the resources available when running tests. We report RAFTs and configurations to avoid them to developers, and received interest to either fix the RAFTs or to improve the specifications of the projects so that tests would be run only in configurations that are unlikely to encounter RAFT failures. Our results also have implications for researchers attempting to detect flaky tests, e.g., reducing the resources available when running tests is a cost-effective approach to detect more flaky failures.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。