On the Documentation of Refactoring Types

12/02/2021
by   Eman Abdullah AlOmar, et al.
0

Commit messages are the atomic level of software documentation. They provide a natural language description of the code change and its purpose. Messages are critical for software maintenance and program comprehension. Unlike documenting feature updates and bug fixes, little is known about how developers document their refactoring activities. Developers can perform multiple refactoring operations, including moving methods, extracting classes, for various reasons. Yet, there is no systematic study that analyzes the extent to which the documentation of refactoring accurately describes the refactoring operations performed at the source code level. Therefore, this paper challenges the ability of refactoring documentation to adequately predict the refactoring types, performed at the commit level. Our analysis relies on the text mining of commit messages to extract the corresponding features that better represent each class. The extraction of text patterns, specific to each refactoring allows the design of a model that verifies the consistency of these patterns with their corresponding refactoring. Such verification process can be achieved via automatically predicting the method-level type of refactoring being applied, namely Extract Method, Inline Method, Move Method, Pull-up Method, Push-down Method, and Rename Method. We compared various classifiers, and a baseline keyword-based approach, in terms of their prediction performance, using a dataset of 5,004 commits. Our main findings show that the complexity of refactoring type prediction varies from one type to another. Rename method and Extract method were found to be the best documented refactoring activities, while Pull-up Method and Push-down Method were the hardest to be identified via textual descriptions. Such findings bring the attention of developers to the necessity of paying more attention to the documentation of these types.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
10/29/2020

Unveiling process insights from refactoring practices

Context : Software comprehension and maintenance activities, such as ref...
research
02/07/2023

Just-in-Time Code Duplicates Extraction

Refactoring is a critical task in software maintenance, and is usually p...
research
11/11/2022

Using Developer Discussions to Guide Fixing Bugs in Software

Automatically fixing software bugs is a challenging task. While recent w...
research
01/12/2022

Towards a Catalog of Composite Refactorings

Catalogs of refactoring have key importance in software maintenance and ...
research
10/26/2020

How We Refactor and How We Document it? On the Use of Supervised Machine Learning Algorithms to Classify Refactoring Documentation

Refactoring is the art of improving the design of a system without alter...
research
09/19/2020

Toward the Automatic Classification of Self-Affirmed Refactoring

The concept of Self-Affirmed Refactoring (SAR) was introduced to explore...
research
03/24/2023

Testability Refactoring in Pull Requests: Patterns and Trends

To create unit tests, it may be necessary to refactor the production cod...

Please sign up or login with your details

Forgot password? Click here to reset