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

面向回归测试套件的高效增量代码覆盖率分析

Efficient Incremental Code Coverage Analysis for Regression Test Suites

Jiale Amber Wang, Kaiyuan Wang, Pengyu Nie

AI总结:

针对全量代码覆盖率重复计算开销大且 RTS 与覆盖率分析不兼容的问题,提出基于最小测试子集的增量分析技术,并实现 iJaCoCo,在 22 个开源仓库上显著加速。

摘要:

代码覆盖率分析已被广泛应用于开源和工业软件仓库的持续集成中,以监控回归测试套件的充分性。然而,计算代码覆盖率的成本可能很高,会在测试执行期间引入显著开销。此外,当只有部分覆盖率数据受到代码变更影响时,通常没有必要为整个测试套件重新收集代码覆盖率。虽然现有的回归测试选择(RTS)技术能够选择其行为可能受到代码变更影响的测试子集,但这些技术与代码覆盖率分析技术并不兼容——也就是说,简单执行由 RTS 选择的测试会产生不正确的代码覆盖率结果。本文提出了第一种增量代码覆盖率分析技术,该技术通过执行最小的测试子集来更新受代码变更影响的覆盖率数据,从而加快代码覆盖率分析。我们在名为 iJaCoCo 的工具中实现了该技术,该工具构建于 Ekstazi 和 JaCoCo 之上,后两者分别是面向 Java 的最先进 RTS 工具和代码覆盖率分析工具。我们在来自 22 个开源仓库的 1,122 个版本上评估了 iJaCoCo,结果表明,与 JaCoCo 相比,iJaCoCo 可将代码覆盖率分析时间平均加快 1.86 倍,最高可达 8.20 倍。

英文摘要:

Code coverage analysis has been widely adopted in the continuous integration of open-source and industry software repositories to monitor the adequacy of regression test suites. However, computing code coverage can be costly, introducing significant overhead during test execution. Plus, re-collecting code coverage for the entire test suite is usually unnecessary when only a part of the coverage data is affected by code changes. While regression test selection (RTS) techniques exist to select a subset of tests whose behaviors may be affected by code changes, they are not compatible with code coverage analysis techniques -- that is, simply executing RTS-selected tests leads to incorrect code coverage results. In this paper, we present the first incremental code coverage analysis technique, which speeds up code coverage analysis by executing a minimal subset of tests to update the coverage data affected by code changes. We implement our technique in a tool dubbed iJaCoCo, which builds on Ekstazi and JaCoCo -- the state-of-the-art RTS and code coverage analysis tools for Java. We evaluate iJaCoCo on 1,122 versions from 22 open-source repositories and show that iJaCoCo can speed up code coverage analysis time by an average of 1.86x and up to 8.20x compared to JaCoCo.

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

↑