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

02/15/2020
by   Zarina Kurbatova, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
12/23/2022

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

Incorrect placement of methods within classes is a typical code smell ca...
research
11/23/2020

Modeling Functional Similarity in Source Code with Graph-Based Siamese Networks

Code clones are duplicate code fragments that share (nearly) similar syn...
research
04/25/2020

Learning to Update Natural Language Comments Based on Code Changes

We formulate the novel task of automatically updating an existing natura...
research
06/20/2018

A Large-Scale Study on Source Code Reviewer Recommendation

Context: Software code reviews are an important part of the development ...
research
02/12/2020

Multi-Objective Optimization for Token-Based Clone Detection

Clone detection plays an important role in software engineering. Finding...
research
03/16/2022

Exploring Variational Graph Auto-Encoders for Extract Class Refactoring Recommendation

The code smell is a sign of design and development flaws in a software s...
research
03/15/2023

DACOS-A Manually Annotated Dataset of Code Smells

Researchers apply machine-learning techniques for code smell detection t...

Please sign up or login with your details

Forgot password? Click here to reset