RMove: Recommending Move Method Refactoring Opportunities using Structural and Semantic Representations of Code

12/23/2022
by   Di Cui, et al.
0

Incorrect placement of methods within classes is a typical code smell called Feature Envy, which causes additional maintenance and cost during evolution. To remove this design flaw, several Move Method refactoring tools have been proposed. To the best of our knowledge, state-of-the-art related techniques can be broadly divided into two categories: the first line is non-machine-learning-based approaches built on software measurement, while the selection and thresholds of software metrics heavily rely on expert knowledge. The second line is machine learning-based approaches, which suggest Move Method refactoring by learning to extract features from code information. However, most approaches in this line treat different forms of code information identically, disregarding their significant variation on data analysis. In this paper, we propose an approach to recommend Move Method refactoring named RMove by automatically learning structural and semantic representation from code fragment respectively. We concatenate these representations together and further train the machine learning classifiers to guide the movement of method to suitable classes. We evaluate our approach on two publicly available datasets. The results show that our approach outperforms three state-of-the-art refactoring tools including PathMove, JDeodorant, and JMove in effectiveness and usefulness. The results also unveil useful findings and provide new insights that benefit other types of feature envy refactoring techniques.

READ FULL TEXT
research
02/15/2020

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

Software refactoring plays an important role in increasing code quality....
research
10/17/2019

Deep Learning Anti-patterns from Code Metrics History

Anti-patterns are poor solutions to recurring design problems. Number of...
research
05/03/2020

A Machine Learning Based Framework for Code Clone Validation

A code clone is a pair of code fragments, within or between software sys...
research
10/09/2020

An ensemble learning approach for software semantic clone detection

Code clone is a serious problem in software and has the potential to sof...
research
02/07/2023

Just-in-Time Code Duplicates Extraction

Refactoring is a critical task in software maintenance, and is usually p...
research
03/03/2020

Benchmark Performance of Machine And Deep Learning Based Methodologies for Urdu Text Document Classification

In order to provide benchmark performance for Urdu text document classif...
research
01/20/2023

Baechi: Fast Device Placement of Machine Learning Graphs

Machine Learning graphs (or models) can be challenging or impossible to ...

Please sign up or login with your details

Forgot password? Click here to reset