Automatic Clone Recommendation for Refactoring Based on the Present and the Past

07/30/2018
by   Ruru Yue, et al.
0

When many clones are detected in software programs, not all clones are equally important to developers. To help developers refactor code and improve software quality, various tools were built to recommend clone-removal refactorings based on the past and the present information, such as the cohesion degree of individual clones or the co-evolution relations of clone peers. The existence of these tools inspired us to build an approach that considers as many factors as possible to more accurately recommend clones. This paper introduces CREC, a learning-based approach that recommends clones by extracting features from the current status and past history of software projects. Given a set of software repositories, CREC first automatically extracts the clone groups historically refactored (R-clones) and those not refactored (NR-clones) to construct the training set. CREC extracts 34 features to characterize the content and evolution behaviors of individual clones, as well as the spatial, syntactical, and co-change relations of clone peers. With these features, CREC trains a classifier that recommends clones for refactoring. We designed the largest feature set thus far for clone recommendation, and performed an evaluation on six large projects. The results show that our approach suggested refactorings with 83 and cross-project settings. CREC significantly outperforms a state-of-the-art similar approach on our data set, with the latter one achieving 70 F-scores. We also compared the effectiveness of different factors and different learning algorithms.

READ FULL TEXT

page 8

page 9

research
10/15/2022

Code Recommendation for Open Source Software Developers

Open Source Software (OSS) is forming the spines of technology infrastru...
research
08/12/2021

Automating the Removal of Obsolete TODO Comments

TODO comments are very widely used by software developers to describe th...
research
02/04/2022

Using Large-scale Heterogeneous Graph Representation Learning for Code Review Recommendations

Code review is an integral part of any mature software development proce...
research
04/15/2021

Automated Evolution of Feature Logging Statement Levels Using Git Histories and Degree of Interest

Logging – used for system events and security breaches to more informati...
research
02/19/2021

Exploring Factors and Measures to Select Open Source Software

[Context] Open Source Software (OSS) is nowadays used and integrated in ...
research
03/03/2021

TaskAllocator: A Recommendation Approach for Role-based Tasks Allocation in Agile Software Development

In this paper, we propose a recommendation approach – TaskAllocator – in...

Please sign up or login with your details

Forgot password? Click here to reset