SILVA, J. R. F.; http://lattes.cnpq.br/1925880064747564; SILVA, José Ramon Fragoso da.
Résumé:
Pull-based development is a fundamental practice that constitutes Modern Code Review (MCR) as
developers can contribute to code improvements such as edits to refactorings. An analysis of
comments made by reviewers on pull requests provides new insight into doing refactorings in Open
Source projects. In this article we define pull requests into RIPRs (Refactoring-Inducing Pull Request),
when a Pull Request has refactorings in any of its commits and this refactoring happened because of
some reviewer comment, and nonRIPRs (non-Refactoring-Inducing Pull Request), that is a Pull
Request that has comments but no refactoring happened. The objective of this study is to analyse Pull
Requests from repositories written in Java, all of them collected from Apache’s Software Foundation
most popular repositories. With the results collected from this analysis our focus is to characterize
review comments, and understand how these comments affect on how the author or Pull Requests
modify their code, making refactorings when needed. In order to achieve these goals, 3 questions were
developed by the research team, involved in this work: (i) How do reviewers suggest refactorings in
review comments in RIPRs? (ii) Do the reviewers justify their reasons? (iii) What is the relation
between refactoring recommendations and actual refactorings? With these questions we can
characterize review comments, understanding the components that compose a comment, and how
these components affect change in code. After analysis, some results were observed by the researchers
in both RIPRs and nonRIPRS; comments had characteristics and patterns that could occur. These
patterns were compared with the occurrence of refactorings and the results were shown in the Results
section. The results showed that RIPRs and nonRIPRs had similar or different characteristics: In all of
Pull Requests we observed that the reviewers showed the exact location in code where the changes
should be made. In RIPRs the patterns observed were: Comments can directly suggest a refactoring, or
can suggest other changes in code that indirectly can result in refactorings. Comments can also have
the presence of justifications about the suggestions and it also can be written in a more polite way,
asking the author if changes could be made, or more directly, when an obvious refactoring should be
made. In nonRIPRs it was observed that there are reasons a refactoring could not occur: The presence
of a discussion between the author and the reviewer after a suggestion, making this suggestion not
implemented. The other reason is when a reviewer suggests changes that don’t result in refactoring,
and other changes were made. The main impact of this research is to expand the knowledge about
contemporary code review in Pull Requests, providing implications that can contribute to other
researchers, developers and programmers.