Using Self Organized Mapping to Seek Refactorable Code Clone
Meng Fanqi · 2014
Code reuse in the process of software development led to the generation of code clone. A large number of identical or similar code clones brought difficulties for the software maintenance. Sometimes bug may be introduced into software due to the inconsistent changes of code clones. In order to reduce the adverse impact that code clone made on the quality of software, refactorable code clones need to be found and then eliminated through refactoring. Aiming at the problem of how to find the refactorable code clone, this paper proposes a method based on SOM (Self Organized Mapping) clustering. Firstly, the samples of refactorable code clones are selected manually. Then, the values of the samples are normalized for creating SOM model. Finally, some probable refactorable code clones are found by SOM clustering, and the results will be recommended to programmer to verify which really refactorable code clones are. The experimental results show that the method has more precision than the method using single metric, and has more validity than the method using multiple metrics.