How We Refactor and How We Document it? On the Use of Supervised Machine
Learning Algorithms to Classify Refactoring Documentation
- URL: http://arxiv.org/abs/2010.13890v1
- Date: Mon, 26 Oct 2020 20:33:17 GMT
- Title: How We Refactor and How We Document it? On the Use of Supervised Machine
Learning Algorithms to Classify Refactoring Documentation
- Authors: Eman Abdullah AlOmar, Anthony Peruma, Mohamed Wiem Mkaouer, Christian
Newman, Ali Ouni, Marouane Kessentini
- Abstract summary: Refactoring is the art of improving the design of a system without altering its external behavior.
This study categorizes commits into 3 categories, namely, Internal QA, External QA, and Code Smell Resolution, along with the traditional BugFix and Functional categories.
To better understand our classification results, we analyzed commit messages to extract patterns that developers regularly use to describe their smells.
- Score: 25.626914797750487
- License: http://arxiv.org/licenses/nonexclusive-distrib/1.0/
- Abstract: Refactoring is the art of improving the design of a system without altering
its external behavior. Refactoring has become a well established and
disciplined software engineering practice that has attracted a significant
amount of research presuming that refactoring is primarily motivated by the
need to improve system structures. However, recent studies have shown that
developers may incorporate refactorings in other development activities that go
beyond improving the design. Unfortunately, these studies are limited to
developer interviews and a reduced set of projects. To cope with the
above-mentioned limitations, we aim to better understand what motivates
developers to apply refactoring by mining and classifying a large set of
111,884 commits containing refactorings, extracted from 800 Java projects. We
trained a multi-class classifier to categorize these commits into 3 categories,
namely, Internal QA, External QA, and Code Smell Resolution, along with the
traditional BugFix and Functional categories. This classification challenges
the original definition of refactoring, being exclusive to improving the design
and fixing code smells. Further, to better understand our classification
results, we analyzed commit messages to extract textual patterns that
developers regularly use to describe their refactorings. The results show that
(1) fixing code smells is not the main driver for developers to refactoring
their codebases. Refactoring is solicited for a wide variety of reasons, going
beyond its traditional definition; (2) the distribution of refactorings differs
between production and test files; (3) developers use several patterns to
purposefully target refactoring; (4) the textual patterns, extracted from
commit messages, provide better coverage for how developers document their
refactorings.
Related papers
- Deciphering Refactoring Branch Dynamics in Modern Code Review: An Empirical Study on Qt [5.516979718589074]
This study aims to understand the review process for changes in the Refactor branch and to identify what developers care about when reviewing code in this branch.
We find that reviews involving from the Refactor branch take significantly less time to resolve in terms of code review.
Additionally, documentation of developer intent is notably sparse within the Refactor branch compared to other branches.
arXiv Detail & Related papers (2024-10-07T01:18:56Z) - In Search of Metrics to Guide Developer-Based Refactoring Recommendations [13.063733696956678]
Motivation is a well-established approach to improving source code quality without compromising its external behavior.
We propose an empirical study into the metrics that study the developer's willingness to apply operations.
We will quantify the value of product and process metrics in grasping developers' motivations to perform.
arXiv Detail & Related papers (2024-07-25T16:32:35Z) - What's Wrong with Your Code Generated by Large Language Models? An Extensive Study [80.18342600996601]
Large language models (LLMs) produce code that is shorter yet more complicated as compared to canonical solutions.
We develop a taxonomy of bugs for incorrect codes that includes three categories and 12 sub-categories, and analyze the root cause for common bug types.
We propose a novel training-free iterative method that introduces self-critique, enabling LLMs to critique and correct their generated code based on bug types and compiler feedback.
arXiv Detail & Related papers (2024-07-08T17:27:17Z) - CodeRAG-Bench: Can Retrieval Augment Code Generation? [78.37076502395699]
We conduct a systematic, large-scale analysis of code generation using retrieval-augmented generation.
We first curate a comprehensive evaluation benchmark, CodeRAG-Bench, encompassing three categories of code generation tasks.
We examine top-performing models on CodeRAG-Bench by providing contexts retrieved from one or multiple sources.
arXiv Detail & Related papers (2024-06-20T16:59:52Z) - On The Importance of Reasoning for Context Retrieval in Repository-Level Code Editing [82.96523584351314]
We decouple the task of context retrieval from the other components of the repository-level code editing pipelines.
We conclude that while the reasoning helps to improve the precision of the gathered context, it still lacks the ability to identify its sufficiency.
arXiv Detail & Related papers (2024-06-06T19:44:17Z) - A Survey of Deep Learning Based Software Refactoring [5.716522445049744]
Dozens of deep learning-based approaches have been proposed forfactoring software.
There is a lack of comprehensive reviews on such works as well as a taxonomy for deep learning-based approaches.
Most of the deep learning techniques have been used for the detection of code smells and the recommendation of solutions.
arXiv Detail & Related papers (2024-04-30T03:07:11Z) - ReGAL: Refactoring Programs to Discover Generalizable Abstractions [59.05769810380928]
Generalizable Abstraction Learning (ReGAL) is a method for learning a library of reusable functions via codeization.
We find that the shared function libraries discovered by ReGAL make programs easier to predict across diverse domains.
For CodeLlama-13B, ReGAL results in absolute accuracy increases of 11.5% on LOGO, 26.1% on date understanding, and 8.1% on TextCraft, outperforming GPT-3.5 in two of three domains.
arXiv Detail & Related papers (2024-01-29T18:45:30Z) - State of Refactoring Adoption: Better Understanding Developer Perception
of Refactoring [5.516979718589074]
We aim to explore how developers document their activities during the software life cycle.
We call such activity Self-Affirmed Refactoring (SAR), which indicates developers' documentation of their activities.
We propose an approach to identify whether a commit describes developer-related events to classify them according to the common quality improvement categories.
arXiv Detail & Related papers (2023-06-09T16:38:20Z) - RefBERT: A Two-Stage Pre-trained Framework for Automatic Rename
Refactoring [57.8069006460087]
We study automatic rename on variable names, which is considered more challenging than other rename activities.
We propose RefBERT, a two-stage pre-trained framework for rename on variable names.
We show that the generated variable names of RefBERT are more accurate and meaningful than those produced by the existing method.
arXiv Detail & Related papers (2023-05-28T12:29:39Z) - Do code refactorings influence the merge effort? [80.1936417993664]
Multiple contributors frequently change the source code in parallel to implement new features, fix bugs, existing code, and make other changes.
These simultaneous changes need to be merged into the same version of the source code.
Studies show that 10 to 20 percent of all merge attempts result in conflicts, which require the manual developer's intervention to complete the process.
arXiv Detail & Related papers (2023-05-10T13:24:59Z) - Toward the Automatic Classification of Self-Affirmed Refactoring [22.27416971215152]
Self-Affirmed Refactoring (SAR) was introduced to explore how developers document their activities in commit messages.
We propose a two-step approach to first identify whether a commit describes developer-related events, then to classify it according to the common quality improvement categories.
Our model is able to accurately classify commits, outperforming the pattern-based random approaches, and allowing the discovery of 40 more relevant SAR patterns.
arXiv Detail & Related papers (2020-09-19T18:35:21Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.