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.
翻译:代码覆盖率分析已被广泛应用于开源和工业软件仓库的持续集成中,以监控回归测试套件的充分性。然而,计算代码覆盖率的成本可能很高,会在测试执行期间引入显著开销。此外,当只有部分覆盖率数据受代码变更影响时,为整个测试套件重新收集代码覆盖率通常是不必要的。虽然存在回归测试选择(RTS)技术来选择其行为可能受代码变更影响的测试子集,但这些技术与代码覆盖率分析技术并不兼容——即,简单地执行RTS选择的测试会导致错误的代码覆盖率结果。本文提出了首个增量代码覆盖率分析技术,该技术通过执行最小测试子集来更新受代码变更影响的覆盖率数据,从而加速代码覆盖率分析。我们将该技术实现为一个名为iJaCoCo的工具,该工具基于Ekstazi和JaCoCo——它们是Java领域最先进的RTS和代码覆盖率分析工具。我们在来自22个开源仓库的1,122个版本上评估iJaCoCo,结果表明,与JaCoCo相比,iJaCoCo平均可将代码覆盖率分析时间加速1.86倍,最高可达8.20倍。