Font Size: a A A

Research On Clone Code Consistency Maintenance Base On Clone Genealogy

Posted on:2018-09-11Degree:MasterType:Thesis
Country:ChinaCandidate:Z ChenFull Text:PDF
GTID:2348330512496464Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
In the software development process,developers frequently copy-paste code to reduce software development costs,resulting in more repeat or similar code,this code is used repeatedly called code clone.The present research thinks that the clone code has the dual nature.To reuse better quality code can improve development efficiency,and play a positive role in software development maintenance of,is useful clone.To reuse poor quality code or the potential threat of the code may lead to a large number of defects,affecting the stability of the software,is harmful clone.Refactoring is the most common methods for maintenance personnel to deal with the code clone,but it will not only waste a large amount of maintenance cost,but also destroy the beneficial code clone.From the view of the research purpose,it is the key to understand and analyze the evolution process of code clone and improves the quality of the harmful clone,the understanding and analysis of the evolution process of clone code is the key to improve the quality of the harmful clones and maintain and manage them.Tracking the evolution process of clone code based on the multiple version of software,which can not only analyze the change characteristics of clone code,but also provide the information needed for the software maintainer.This paper aims to Type-1,Type-2 and Type-3 function clones as the research object,to construct clone code mapping,clone evolution pattern recognition,clone genealogy and consistency maintenance.The specific work as follows:1.To obtain clone code detection results base on the research detection tools-FClones,combined with the methods of word frequency vector space,clone feature and code line distance,and making full use of the text,structure and feature information of clone code to obtain the mapping relation of the clone code in the software more accurately and efficiently.Meanwhile,the mapping results are stored in the XML file,to provide the basis research for evolution pattern recognition and clone genealogy construction.2.Based on the mapping results between multiple versions,to define and identify clone evolution patterns from the perspective of the number and content of the clone fragments in the clone group according to the needs of the later research.The types of evolution patterns include eight kinds: Static,Same,Add,Subtract,Separate,Merge,Consistent and Inconsistent.For 5 open source software to carry out the experiment,found that the average ratio of the above eight evolution patterns were 41.98%,47.5%,1.46%,1.28%,1.06%,0.59%,3.48%.3.The identified patterns of evolution are combined and connected in series according to the mapping relationship,so as to construct the clone genealogy and store it in the XML file.This study carried out experiments on 4 open-source software,the statistics of the repertoire each software system in clones,clones,clone and direct the life cycle and other aspects of information,find that the number of clone genealogy is proportional to the number of the software versions.4.Based on the constructed clone genealogy,to extract clone group evolution characteristics,including life cycle,clone type,function size,and the number of evolution patterns,and add consistency maintenance levels to clone fragments by maintaining level algorithm.After four open source software experiments,it was found that the number of clone fragments that were labeled as R1,R2,R3 and R4 in the life cycle was low and easy to maintain,there was a positive correlation between clone type and evolution pattern,which proved that this method is feasible and effective.
Keywords/Search Tags:code clone, clone mapping, evolution pattern, clone genealogy, consistency maintenance
PDF Full Text Request
Related items