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

通过并行批量测试加速持续集成

Accelerating Continuous Integration with Parallel Batch Testing

Emad Fallahzadeh, Amir Hossein Bavand, Peter C. Rigby

AI总结:

本研究针对大规模持续集成成本高的问题,提出DynamicBatching和TestCaseBatching两种并行批量测试方法,经Chrome等数据验证可大幅减少测试机器用量,为资源高效测试提供方案。

摘要:

大规模持续集成成本高昂,但对软件开发至关重要。包括测试选择和优先级排序在内的各类测试优化技术旨在降低这一成本。测试分批是一种有效却被忽视的替代技术。本研究通过调整测试分批的机器数量评估并行化的效果,并提出两种新方法。\n 我们将TestAll作为基准,研究并行度和机器数量对反馈时间的影响。我们重新评估了ConstantBatching(恒定分批),并提出DynamicBatching(动态分批),该方法根据队列中剩余的变更调整批次大小。我们还提出了TestCaseBatching(测试用例分批),允许新构建在完整测试执行前加入批次,从而加快持续集成速度。我们的评估使用了爱立信的结果以及来自开源Chrome项目的2.76亿条测试结果,评估指标包括反馈时间、执行量减少情况,同时提供Chrome项目脚本和数据的访问权限。\n 结果表明,测试并行化对反馈时间存在非线性影响,因为每次测试延迟会在整个测试队列中累积叠加。批次大小为4的ConstantBatching最多可减少72%的机器使用量即可维持实际平均反馈时间,并实现最高达75%的恒定执行量减少。类似地,DynamicBatching最多可减少91%的机器使用量即可维持实际平均反馈时间,且表现出最高达99%的可变执行量减少。TestCaseBatching最多可减少81%的机器使用量即可维持实际平均反馈时间,并展现出最高达67%的可变执行量减少。我们建议从业者使用DynamicBatching和TestCaseBatching来高效减少所需测试机器数量。分析历史数据以找到增加更多机器对反馈时间影响极小的阈值,对于实现资源高效的测试也至关重要。

英文摘要:

Continuous integration at scale is costly but essential to software development. Various test optimization techniques including test selection and prioritization aim to reduce the cost. Test batching is an effective alternative, but overlooked technique. This study evaluates parallelization's effect by adjusting machine count for test batching and introduces two novel approaches. We establish TestAll as a baseline to study the impact of parallelism and machine count on feedback time. We re-evaluate ConstantBatching and introduce DynamicBatching, which adapts batch size based on the remaining changes in the queue. We also propose TestCaseBatching, enabling new builds to join a batch before full test execution, thus speeding up continuous integration. Our evaluations utilize Ericsson's results and 276 million test outcomes from open-source Chrome, assessing feedback time, execution reduction, and providing access to Chrome project scripts and data. The results reveal a non-linear impact of test parallelization on feedback time, as each test delay compounds across the entire test queue. ConstantBatching, with a batch size of 4, utilizes up to 72% fewer machines to maintain the actual average feedback time and provides a constant execution reduction of up to 75%. Similarly, DynamicBatching maintains the actual average feedback time with up to 91% fewer machines and exhibits variable execution reduction of up to 99%. TestCaseBatching holds the line of the actual average feedback time with up to 81% fewer machines and demonstrates variable execution reduction of up to 67%. We recommend practitioners use DynamicBatching and TestCaseBatching to reduce the required testing machines efficiently. Analyzing historical data to find the threshold where adding more machines has minimal impact on feedback time is also crucial for resource-effective testing.

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

↑