Font Size: a A A

Research On The Approach Of Clone Consistency-maintenance Requirement Prediction Based On Copy-and-paste Operation

Posted on:2017-05-14Degree:MasterType:Thesis
Country:ChinaCandidate:Y YuanFull Text:PDF
GTID:2308330503487198Subject:Computer Science and Technology
Abstract/Summary:PDF Full Text Request
Code clones have already existed in software widely, which can improve the speed of software development, but also can cause some problems. When a fragment needs to be modified, maintainers have to find all clone fragments similar to this one and determine whether they need to be modified in order to ensure the consistency between the code clones, which increases the cost of software maintenance. An empirical study shows that only a few code clones need consistency-maintenance when they are modified in future. Therefore, it is not worthwhile to search and analyze all the fragments that constitute clones with each modified clone fragment, to ensure the consistency of the small part of clones.To solve the above problem, the paper puts forward an approach of clone consistency-maintenance requirement prediction based on cope-and-paste operation. When developers perform a copy-paste operation in the process of development, which generates code clones, the approach can predict whether the clones will need consistency-maintenance in the future and give developers a prompt, by the way to avoid code clones which can cause the difficulty of the software maintenance. The paper has mainly completed the following work. First, we use the Nicad clone detection tool to detect code clones in the multi-version software, and then construct the clone genealogy for the clones in the multi-version system. Second, construct the prediction model using the machine learning algorithm and the paper extracts code features and context features characterizing clones to construct the prediction model. Finally, we design and implement an Eclipse plug-in, which is for the system in Java development language. The prediction approach of consistency-maintenance requirement proposed in this paper is embedded into the plug-in, to implement a complete preventive clone maintenance method.The paper chooses four open-source systems in Java with different scales and field to verify the prediction approach of clone consistency-maintenance requirement. The experiment results show that the proposed method has higher accuracy rate and recall rate. In practice, this approach can provide a certain valuable reference for developers in the copy and paste operation decisions.
Keywords/Search Tags:Clone Clones, Feature Extraction, Consistency Maintenance, Prediction Model, Eclipse Plug-in
PDF Full Text Request
Related items