Automatic Clone Recommendation for Refactoring Based on the Present and the Past
Not on the map. Why?
Abstract (arXiv)
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 76% F-scores in the within-project and cross-project settings. CREC significantly outperforms a state-of-the-art similar approach on our data set, with the latter one achieving 70% and 50% F-scores. We also compared the effectiveness of different factors and different learning algorithms.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). First posted on arXiv 30 Jul 2018.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 2; 2022: 0; 2023: 1; 2024: 1; 2025: 0; 2026: 1.
5 papers.
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 24
- 2023REINFOREST: Reinforcing Semantic Code Similarity for Cross-Lingual Code Search Modelscited by 3
- 2024Unraveling Code Clone Dynamics in Deep Learning Frameworkscited by 2
- 2021A Mining Software Repository Extended Cookbook: Lessons learned from a literature reviewcited by 0
- 2026Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebasecited by 0
- 2026Super Library Agent: Joint Generation and Maintenance of Multiple Applications Beyond the Single Codebase29 Aug 2026
- 2024Unraveling Code Clone Dynamics in Deep Learning Frameworks25 Apr 2024
- 2023REINFOREST: Reinforcing Semantic Code Similarity for Cross-Lingual Code Search Models5 May 2023
- 2021A Survey on Machine Learning Techniques for Source Code Analysis18 Oct 2021
- 2021A Mining Software Repository Extended Cookbook: Lessons learned from a literature review8 Oct 2021