SEFeb 15, 2020

Recommendation of Move Method Refactoring Using Path-Based Representation of Code

arXiv:2002.06392v142 citationsHas Code
AI Analysis

This addresses the need for more accurate and less heuristic-dependent refactoring recommendations for software developers, though it is incremental as it builds on existing code representation methods.

The paper tackles the problem of automatically recommending Move Method refactoring in software by proposing a path-based code representation (code2vec) to train a machine learning classifier, resulting in outperforming state-of-the-art tools like JDeodorant and JMove on two datasets.

Software refactoring plays an important role in increasing code quality. One of the most popular refactoring types is the Move Method refactoring. It is usually applied when a method depends more on members of other classes than on its own original class. Several approaches have been proposed to recommend Move Method refactoring automatically. Most of them are based on heuristics and have certain limitations (e.g., they depend on the selection of metrics and manually-defined thresholds). In this paper, we propose an approach to recommend Move Method refactoring based on a path-based representation of code called code2vec that is able to capture the syntactic structure and semantic information of a code fragment. We use this code representation to train a machine learning classifier suggesting to move methods to more appropriate classes. We evaluate the approach on two publicly available datasets: a manually compiled dataset of well-known open-source projects and a synthetic dataset with automatically injected code smell instances. The results show that our approach is capable of recommending accurate refactoring opportunities and outperforms JDeodorant and JMove, which are state of the art tools in this field.

Foundations

The foundational work for this paper's niche, ranked by how specifically the neighbourhood builds on it — not by global fame.

Your Notes