Code review is widely known as one of the best practices for software quality assurance in software development. In a typical code review process, reviewers check the code committed by developers to ensure the quality of the code, during which reviewers and developers would communicate with each other in review comments to exchange necessary information. As a result, understanding the information in review comments is a prerequisite for reviewers and developers to conduct an effective code review. Code snippet, as a special form of code, can be used to convey necessary information in code reviews. For example, reviewers can use code snippets to make suggestions or elaborate their ideas to meet developers' information needs in code reviews. However, little research has focused on the practices of providing code snippets in code reviews. To bridge this gap, we conduct a mixed-methods study to mine information and knowledge related to code snippets in code reviews, which can help practitioners and researchers get a better understanding about using code snippets in code review. Specifically, our study includes two phases: mining code review data and conducting practitioners' survey. The study results highlight that reviewers can provide code snippets in appropriate scenarios to meet developers' specific information needs in code reviews, which will facilitate and accelerate the code review process.
翻译:代码审查被广泛认为是软件开发中保证软件质量的最佳实践之一。在典型的代码审查流程中,审查者检查开发人员提交的代码以确保代码质量,期间审查者与开发人员会通过审查评论交流必要信息。因此,理解审查评论中的信息是审查者和开发人员有效开展代码审查的先决条件。代码片段作为一种特殊形式的代码,可用于在代码审查中传递必要信息。例如,审查者可通过代码片段提出建议或阐述观点,以满足开发人员在代码审查中的信息需求。然而,目前鲜有研究关注代码审查中代码片段的使用实践。为填补这一空白,我们采用混合方法研究,挖掘代码审查中与代码片段相关的信息与知识,以帮助从业者和研究者更深入地理解代码片段在代码审查中的应用。具体而言,本研究包含两个阶段:挖掘代码审查数据与开展从业者调查。研究结果表明,审查者可在适当场景下提供代码片段,以满足开发人员在代码审查中的特定信息需求,从而促进并加速代码审查流程。