Deciphering Refactoring Branch Dynamics in Modern Code Review: An Empirical Study on Qt

Eman Abdullah AlOmar
2024-10-07
Abstract: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.
Software Engineering
What problem does this paper attempt to address?
### What problems does this paper attempt to solve? This paper aims to solve the specific challenges and lack of understanding in refactoring - related code review in Modern Code Review (MCR). Specifically, the research focuses on: 1. **Understanding the refactoring code review process**: How is the refactoring code review process different from ordinary code review? What aspects do developers focus on when reviewing refactoring code? 2. **Identifying the factors that developers prioritize**: When reviewing refactoring code from the dedicated 'Refactor' branch, what do developers care about the most? 3. **Revealing the unique challenges of refactoring review**: Are there any special challenges in refactoring code review compared to other types of code review? How do these challenges affect the review time, the number of discussions, and the final decision? 4. **Establishing refactoring review standards**: Through quantitative and qualitative analysis, construct a comprehensive refactoring review standard classification system to help developers conduct refactoring code review more efficiently. #### Research background - **The importance of code review**: Code review is an important means to improve software quality, share knowledge, and ensure compliance with coding standards. - **The role of refactoring**: Refactoring is a key practice for maintaining code quality, especially during software evolution. However, there is relatively little research on refactoring code review, especially in the dedicated 'Refactor' branch. #### Research objectives By in - depth analysis of refactoring code review data in the Qt open - source project, researchers hope to answer the following research questions: - **RQ1**: What are the differences in review workload between refactoring code review and non - refactoring code review? - **RQ2**: What text patterns do developers use when describing refactoring requirements in the 'Refactor' branch? - **RQ3**: What quality attributes do developers consider when describing refactoring? - **RQ4**: What topics do developers discuss when reviewing refactoring tasks? #### Method overview - **Data collection**: 296,372 code change records were extracted from the Gerrit code review system of the Qt project, including 718 review records from the 'Refactor' branch. - **Data analysis**: A combination of quantitative analysis (such as statistical tests) and qualitative analysis (such as topic analysis) was used to compare various indicators of refactoring and non - refactoring code review and construct a classification system of refactoring review standards. #### Main findings - **Shorter review time**: Code reviews involving refactoring usually take less time to complete. - **Sparse documentation**: In the 'Refactor' branch, the documentation of developers' intentions is significantly insufficient. - **Review standard classification**: Through topic analysis, researchers constructed a refactoring review standard classification system with 12 sub - categories. #### Conclusion The research shows that it is crucial to develop efficient tools and techniques to support refactoring code review. This not only helps improve review efficiency but also ensures the quality and correctness of refactoring code.