Font Size: a A A

Identify And Recommend Refactoring Clones Using Software Evolution History

Posted on:2020-03-06Degree:MasterType:Thesis
Country:ChinaCandidate:R R SheFull Text:PDF
GTID:2428330596971427Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Faced with the complexity of a large number of cloned code in software,simply detecting these clone code does not reduce software maintenance costs.Therefore,based on the results of clonal detection,the researchers have carried out research on clone management,clone and reconstruction.In order to effectively manage clone code,refactoring has gradually become a focus of attention.Refactoring is closely related to the quality of software,such as maintainability,stability,and robustness.Refactored clone code tends to be of higher quality than unreconstructed clone code,so refactoring for software quality Guarantee has important theoretical significance and application value.Refactoring all clone code in a software system is impractical,and not all clone code needs to be refactored.Blind refactoring can affect other useful code in the software,resulting in a decline in software quality.Therefore,it is especially important to identify clone code suitable for refactoring before effectively maintaining the clone code.The existing methods have certain limitations in the recognition and recommendation of clone code reconstruction.There is a need for a new and effective method to identify and recommend the reconstructed clone code.This study takes ?clone code for refactoring‘as an entry point and provides valuable reference information for software development and maintenance personnel.The specific work is as follows:1.Clone code evolution history information needs to be extracted from four aspects: clone detection,clone mapping,clone family,and maintenance submission log.First use the NiCad detection tool to obtain the clone code detection result.Secondly,a hierarchical mapping method based on word frequency vector calculation,clone position distance relationship and clone feature is used to obtain the mapping relationship.Then,based on the pre-research results of the FCGE clone family tool,eight evolution models were extracted.Finally,the clone code maintenance log is extracted according to SVN.2.On the basis of obtaining the evolution history information of the cloned code,it is necessary to identify the cloned code reconstruction and tracking candidate set.Focusing on the consistency of the cloned fragments in the clonal population after maintenance in the evolutionary history process,this situation is included in the reconstruction candidate set.Focusing on the process of evolution history,cloned fragments are separated after maintenance,and recombined into a clone after subsequent maintenance operations.This situation is included in the tracking candidate set.3.After the reconstructed candidate set is identified,a feature database is constructed in the reconstructed candidate set.In the reconstruction candidate set,the three major static features of the cloned code segment,the clone relationship and the clone context are extracted,and the three major static features are extracted by using the reconstruction tool SourceMonitor.At the same time,FCGE is used to extract evolutionary features such as evolution patterns and frequency changes.4.After building the feature database,use the machine learning method to recommend the clone code that needs to be refactored.In this paper,the feature data set is divided into four subsets,which are four subsets of clone code segment,clone relationship,clone context and evolution information.Then use the machine learning method such as decision tree and Bayesian network to predict these four subsets separately,and finally select the best machine learning to recommend refactoring clone code.Experiments show that the proposed method of reconstructing clone achieves 90% accuracy,and the decision tree is recommended to reconstruct the clones best.
Keywords/Search Tags:Code clone, Clone detection, Feature extraction, Clone reconstruction, Recommended reconstruction
PDF Full Text Request
Related items