A qualitative study on refactorings induced by code review

Flávia Coelho,Nikolaos Tsantalis,Tiago Massoni,Everton L. G. Alves
DOI: https://doi.org/10.1007/s10664-024-10560-7
IF: 3.762
2024-11-01
Empirical Software Engineering
Abstract:Modern Code Review (MCR) has become an essential practice in pull-based development since reviewers may provide insights for improvements, such as code refactoring, in Pull Requests (PRs). A recent study explored PRs in light of refactoring-inducement, discovering statistical differences in the number of review comments and discussions between refactoring-inducing and non-refactoring-inducing PRs. In refactoring-inducing PRs, the refactoring edits emerge after the initial commit(s) as a result of review comments and/or spontaneous initiative by the PR developer. In this paper, we report a qualitative study that examines code reviewing-related aspects (review comments and discussion) to characterize code review in refactoring-inducing PRs. We conjecture that code reviews differ in refactoring-inducing from non-refactoring-inducing PRs, which has interesting implications. To investigate our hypothesis, we manually scrutinized 923 review comments and 361 refactoring edits from a purposive sample of 118 Apache's merged PRs, hosted on GitHub. Our results reveal motivating factors behind refactoring-inducing PRs, technical aspects around the structure of review comments in refactoring-inducing and non-refactoring-inducing PRs, and guidelines for a more productive code reviewing settled on code enhancements through refactoring. Accordingly, we suggest directions for researchers, practitioners, tool builders, and educators to assist code review effectiveness in pull-based development.
computer science, software engineering
What problem does this paper attempt to address?