一句话:介绍 Google 大规模代码覆盖率基础设施、可视化与代码评审应用,并基于五年数据和开发者调查给出工业落地建议。
论文关注代码覆盖率在工业界大规模部署时面临的价值认知与计算成本问题。作者描述了 Google 的覆盖率基础设施:每天为十亿行代码、七种编程语言计算覆盖率,并将信息作用于 changeset 和代码评审层面,使其可操作。文章介绍了覆盖率的可视化与使用方式,以及规模化采用中的挑战与解决方案。为评估采用情况与开发者感知,作者分析了五年期间的采用率、错误率和平均覆盖率,并收集了面向 3000 名开发者的 512 份问卷回复。最后,论文给出了在工业环境中实施和使用代码覆盖率的具体建议。
Code coverage is a measure of the degree to which a test suite exercises a software system. Although coverage is well established in software engineering research, deployment in industry is often inhibited by the perceived usefulness and the computational costs of analyzing coverage at scale. At Google, coverage information is computed for one billion lines of code daily, for seven programming languages. A key aspect of making coverage information actionable is to apply it at the level of changesets and code review. This paper describes Google’s code coverage infrastructure and how the computed code coverage information is visualized and used. It also describes the challenges and solutions for adopting code coverage at scale. To study how code coverage is adopted and perceived by developers, this paper analyzes adoption rates, error rates, and average code coverage ratios over a five-year period, and it reports on 512 responses, received from surveying 3000 developers. Finally, this paper provides concrete suggestions for how to implement and use code coverage in an industrial setting.