Automatic ranking of clones for refactoring through mining association rules
- 1 February 2014
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 114-123
Abstract
In this paper, we present an in-depth empirical study on identifying clone fragments that can be important refactoring candidates. We mine association rules among clones in order to detect clone fragments that belong to the same clone class and have a tendency of changing together during software evolution. The idea is that if two or more clone fragments from the same class often change together (i.e., are likely to co-change) preserving their similarity, they might be important candidates for refactoring. Merging such clones into one (if possible) can potentially decrease future clone maintenance effort. We define a particular clone change pattern, the Similarity Preserving Change Pattern (SPCP), and consider the cloned fragments that changed according to this pattern (i.e., the SPCP clones) as important candidates for refactoring. For the purpose of our study, we implement a prototype tool called MARC that identifies SPCP clones and mines association rules among these. The rules as well as the SPCP clones are ranked for refactoring on the basis of their change-proneness. We applied MARC on thirteen subject systems and retrieved the refactoring candidates for three types of clones (Type 1, Type 2, and Type 3) separately. Our experimental results show that SPCP clones can be considered important candidates for refactoring. Clones that do not follow SPCP either evolve independently or are rarely changed. By considering SPCP clones for refactoring we not only can minimize refactoring effort considerably but also can reduce the possibility of delayed synchronizations among clones and thus, can minimize inconsistencies in software systems.Keywords
This publication has 22 references indexed in Scilit:
- Prioritizing code clone detection results for clone management2013
- Increasing clone maintenance support by unifying clone detection and refactoring activitiesInformation and Software Technology, 2012
- Comparative stability of cloned and non-cloned code2012
- Ranking Refactoring Suggestions Based on Historical Volatility2011
- Comparison and evaluation of code clone detection techniques and tools: A qualitative approachScience of Computer Programming, 2009
- An empirical study on the maintenance of source code clonesEmpirical Software Engineering, 2009
- A Mutation/Injection-Based Automatic Framework for Evaluating Code Clone Detection Tools2009
- Assessing the effect of clones on changeability2008
- Is Cloned Code More Stable than Non-cloned Code?2008
- NICAD: Accurate Detection of Near-Miss Intentional Clones Using Flexible Pretty-Printing and Code Normalization2008