Context: Modern code review is a widely employed technique in both industrial and open-source projects, serving to enhance software quality, share knowledge, and ensure compliance with coding standards and guidelines. While code review is extensively studied for its general challenges, best practices, outcomes, and socio-technical aspects, little attention has been paid to how refactoring is reviewed and what developers prioritize when reviewing refactored code in the Refactor branch. Objective: The goal is to understand the review process for refactoring changes in the Refactor branch and to identify what developers care about when reviewing code in this branch. Method: In this study, we present a quantitative and qualitative examination to understand the main criteria developers use to decide whether to accept or reject refactored code submissions and identify the challenges inherent in this process. Results: Analyzing 2,154 refactoring and non-refactoring reviews across Qt open-source projects, we find that reviews involving refactoring from the Refactor branch take significantly less time to resolve in terms of code review efforts. Additionally, documentation of developer intent is notably sparse within the Refactor branch compared to other branches. Furthermore, through thematic analysis of a substantial sample of refactoring code review discussions, we construct a comprehensive taxonomy consisting of 12 refactoring review criteria.
翻译:背景:现代代码审查是工业界和开源项目中广泛采用的技术,旨在提升软件质量、分享知识并确保符合编码标准与规范。尽管代码审查在一般性挑战、最佳实践、成果及社会技术层面已得到广泛研究,但针对重构代码如何被审查,以及开发者在审查 Refactor 分支中的重构代码时优先关注哪些方面,却鲜有探讨。目标:本研究旨在理解 Refactor 分支中重构变更的审查过程,并识别开发者在审查该分支代码时所关注的核心要素。方法:本研究通过定量与定性分析,探究开发者在决定接受或拒绝重构代码提交时采用的主要标准,并识别此过程中固有的挑战。结果:通过对 Qt 开源项目中 2,154 项重构与非重构审查的分析,我们发现涉及 Refactor 分支的重构审查在代码审查工作量方面所需的解决时间显著更短。此外,与其他分支相比,Refactor 分支中关于开发者意图的文档记录明显更为稀疏。进一步地,通过对大量重构代码审查讨论样本进行主题分析,我们构建了一个包含 12 项重构审查标准的完整分类体系。