一句话:通过 7,816 次构建的大规模实证,揭示仅看语句覆盖率变化不足以刻画测试覆盖率的演化。
论文研究测试套件质量随代码演化的问题。以往工作常以整体语句覆盖率或补丁语句覆盖率衡量变化,本文额外关注未改动语句的覆盖率变化。作者对 Java、Python、Scala 等流行语言编写的 47 个项目、7,816 次构建进行大规模实证分析,追踪各修订版本间被覆盖语句集合的演化。结果表明,在大型成熟项目中,仅测量语句覆盖率变化无法刻画代码演化的细微影响;为此,论文提出并研究将补丁覆盖率与非补丁覆盖率分离、并将覆盖率数值变化与被覆盖语句集合变化区分开来的新评估方式,以更全面理解补丁对测试套件质量的影响。
Statement coverage is commonly used as a measure of test suite quality. Coverage is often used as a part of a code review process: if a patch decreases overall coverage, or is itself not covered, then the patch is scrutinized more closely. Traditional studies of how coverage changes with code evolution have examined the overall coverage of the entire program, and more recent work directly examines the coverage of patches (changed statements). We present an evaluation much larger than prior studies and moreover consider a new, important kind of change --- coverage changes of unchanged statements. We present a large-scale evaluation of code coverage evolution over 7,816 builds of 47 projects written in popular languages including Java, Python, and Scala. We find that in large, mature projects, simply measuring the change to statement coverage does not capture the nuances of code evolution. Going beyond considering statement coverage as a simple ratio, we examine how the set of statements covered evolves between project revisions. We present and study new ways to assess the impact of a patch on a project's test suite quality that both separates coverage of the patch from coverage of the non-patch, and separates changes in coverage from changes in the set of statements covered.