Font Size: a A A

Research On Harmfulness Prediction Of Clone Code Based On Bayesian Network

Posted on:2016-10-14Degree:MasterType:Thesis
Country:ChinaCandidate:R X ZhangFull Text:PDF
GTID:2308330464466287Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Code clone has always been a popular research field of software engineering and it has important impact in software development and maintenance. In recent years, scholars at home and abroad have conducted a lot of research on the pros and cons of code clones and they agreed that code clones have both positive and negative impacts on the development and maintenance of software systems. However, code clones cannot be avoided at times during the software development process and not all clones are really removable through refactoring. Due to the negative impact of code clones in the maintenance effort, researchers and practitioners have agreed that code clones should be managed efficiently. Moreover, it is not realistic that developers manage all the clones because there are a huge number of clones and all the clones are not necessarily harmful. Therefore, it is necessary to take care of only harmful clones out of all the clones in order to manage clones efficiently.To evaluate effectively the harmfulness of clone code, we propose a method to predict harmful code clones by using bayesian network. From the viewpoint that Inconsistent code changes may raise program errors and then Induce additional costs, we regard Inconsistent change clones as harmful clones. Based on available results, the focus of research is mainly on the determination and extraction of software metrics, the construction of prediction model. First, referring to correlation research on software defects prediction and clone evolution, we propose two software metrics-static metrics and evolution metrics to characterize the information of clone code. Second, we propose a novel approach based on topic modeling for clone group mapping to extract evolution metrics. Finally, by using K fold cross-validation method, we evaluate the performance of our prediction model with bayesian network as the core algorithm.In the last section of this paper, we respectively verify and assess our method for clone group mapping and our method for predicting harmfulness for clones. First, Experiments on four open source software show that the recall and precision are up to 0.99, thus the method can effectively and accurately be used to extract evolution metrics for constructing prediction model. Second, we experiment on five different types of open-source software system written in C languages to assess our method. The experiment results show that the method proposed in this paper can predict harmfulness for clones with better applicability and higher accuracy.
Keywords/Search Tags:code clone, harmfulness prediction, bayesian network, clone evolution, topic model
PDF Full Text Request
Related items