一句话:通过大规模代码审查数据与开发者访谈,揭示测试文件评审与生产代码评审的差异及工具改进需求。
自动化测试对软件质量至关重要,但测试代码的编写与维护常被视为次要工作,其质量保障是否以及如何借助代码审查仍不明确。本文结合定量与定性方法,分析了超过 300,000 次代码审查,并访谈了 12 名开发者,以了解他们评审测试文件时的做法与看法。研究给出了当前代码审查实践的概览,识别出限制测试代码评审的障碍,以及开发者希望代码审查工具改进的问题。结果表明,评审测试文件与评审生产文件存在显著差异,且审查过程中的导航是开发者面临的主要问题之一。基于这些发现,作者提出了一系列面向工具设计与未来研究的建议。
Automated testing is considered an essential process for ensuring software quality. However, writing and maintaining high-quality test code is challenging and frequently considered of secondary importance. For production code, many open source and industrial software projects employ code review, a well-established software quality practice, but the question remains whether and how code review is also used for ensuring the quality of test code. The aim of this research is to answer this question and to increase our understanding of what developers think and do when it comes to reviewing test code. We conducted both quantitative and qualitative methods to analyze more than 300,000 code reviews, and interviewed 12 developers about how they review test files. This work resulted in an overview of current code reviewing practices, a set of identified obstacles limiting the review of test code, and a set of issues that developers would like to see improved in code review tools. The study reveals that reviewing test files is very different from reviewing production files, and that the navigation within the review itself is one of the main issues developers currently face. Based on our findings, we propose a series of recommendations and suggestions for the design of tools and future research.