计算机科学 ›› 2017, Vol. 44 ›› Issue (4): 165-168.doi: 10.11896/j.issn.1002-137X.2017.04.036

• NASAC 2015 • 上一篇    下一篇

基于贝叶斯网络预测克隆代码质量

刘冬瑞,刘东升,张丽萍,侯敏,王春晖   

  1. 内蒙古师范大学计算机与信息工程学院 呼和浩特010022,内蒙古师范大学计算机与信息工程学院 呼和浩特010022,内蒙古师范大学计算机与信息工程学院 呼和浩特010022,内蒙古师范大学计算机与信息工程学院 呼和浩特010022,内蒙古师范大学计算机与信息工程学院 呼和浩特010022
  • 出版日期:2018-11-13 发布日期:2018-11-13
  • 基金资助:
    本文受国家自然科学基金(61363017,61462071),内蒙古自然科学基金资助

Prediction of Code Clone Quality Based on Bayesian Network

LIU Dong-rui, LIU Dong-sheng, ZHANG Li-ping, HOU Min and WANG Chun-hui   

  • Online:2018-11-13 Published:2018-11-13

摘要: 针对软件中克隆代码的质量进行研究,评价软件当前所有版本中克隆代码的质量。在此基础上使用贝叶斯网络训练已有样本数据,得到克隆代码质量预测模型,其能预测软件未发布版本中克隆代码的质量,根据评价和预测结果给开发人员提供克隆代码重构和有效复用的建议,防止有害克隆代码的大量繁殖。 实验表明,该方法能够较准确地预测软件中克隆代码的质量。

关键词: 克隆代码,贝叶斯网络,质量评估模型,预测,重构

Abstract: This paper researched on the quality of code clone in the softwareand ,evaluated the code clone quality of the current versions.Then on this basis,Bayesian network was used to train the existing sample data gets the prediction model of code clone which is able to predict the quality.The prediction results are able to help developers make judgments that code clone should be reconstructed or efficiently reused.The experiment shows that the method can be used to predict the quality of code clone in software more accurately.

Key words: Code clone,Bayesian network,Quality evaluation model,Prediction,Reconstruct

[1] ZHANG S K,WANG L F,YANG F Q.Architecture Based Software Developing Model[J].World Sci-Tech,1999,21(3):31-35(in Chinese) 张世琨,王立福,杨芙清.基于体系结构的软件开发模式[J].世界科技研究与发展,1999,21(3):31-35.
[2] ZHANG R X,ZHANG L P,WANG H,et al.A Novel Approach for Clone Group Mapping by using Topic Modeling[J].International Journal of Software Engineering & Applications,2015,6(2).
[3] ROY C K.Detection and analysis of near-miss software clones[C]∥IEEE International Conference on Software Maintenance.2009:447-450.
[4] BALAZINSKA M,MERLO E,Dagenais M,et al.AdvancedClone-Analysis to Support Object-Oriented System Refactoring[C]∥Conference on Reverse Engineering.IEEE Computer Socie-ty,2000.
[5] KAPSER C J,GODFREY M W.“Cloning considered harmful” considered harmful:patterns of cloning in software[J].Empirical Software Engineering,2008,13(6):645-692.
[6] WEI W U,ZHANG M X.Research on the Application of Software Reuse Technology Based on Components[J].Journal of Shanxi Datong University(Natural Science Edition),2009,25(1):8-10.(in Chinese) 武伟,张明新.基于构件的软件复用技术应用研究[J].山西大同学报(自然科学版),2009,25(1):8-10.
[7] ZIBRAN M F,ROY C K.The Road to Software Clone Management:A Survey:Technical Report 2012-03[R].The University of Saskatchewan,Canada,2012:1-66.
[8] CHATTERJI D,CARVER J C,KRAFT N A.Cloning:Theneed to understand developer intent[C]∥2013 7th International Workshop on Software Clones (IWSC).IEEE,2013:14-15.
[9] MANDAL M,ROY C K,SCHNEIDER K A.Automatic ranking of clones for refactoring through mining association rules[C]∥IEEE Conference on Software Maintenance,Reengineering and Reverse Engineering.IEEE,2014:114-123.
[10] FOWLER M,BECK K,BRANT J,et al.Refactoring:Improving the Design of Existing Code[M].Addison Wesley,1999.
[11] ZIBRAN M F,ROY C K.Conflict-aware optimal scheduling of prioritized code clone refactoring[J].IET Software,2013:7(7):167-186.
[12] ROY K C,CORDY J.Near-miss function clones in open source software:an empirical study[J].Journal of Software Maintenance & Evolution Research & Practice,2010,22(3):165-189.
[13] LEE S,BAE G,CHAE H,et al.Automated scheduling forclone-based refactoring using a competent ga[J].Softw.Pract.Exper.,2010,41(5):521-550.
[14] MONDEN A,NAKAE D,KAMIYA T,et al.Software Quality Analysis by Code Clones in Industrial Legacy Software[C]∥IEEE International Symposium on Software Metrics.IEEE Computer Society,2002:1-8.
[15] PLSCH R,HENTSCHEL A,SAFT M,et al.The EMISQmethod and its tool support-expert-based evaluation of internal software quality[J].Innovations in Systems and Software Engineering,2008,4(1):3-15.
[16] VENKATASUBRAMANYAM R D,Gupta S,SINGH H K.Prioritizing code clone detection results for clone management[C]∥2013 7th International Workshop on Software Clones (IWSC).IEEE,2013:30-36.
[17] FRANK E,HALL M,HOLMES G,et al.Weka-A MachineLearning Workbench for Data Mining[M]∥Data Mining and Knowledge Discovery Handbook.Springer US,2009:1269-1277.
[18] KIM M,SAZAWAL V,NOTKIN D,et al.An empirical study of code clone genealogies[J].ACM Sigsoft Software Engineering Notes,2005,30(5):187-196.
[19] TU Y,ZHANG L P,WANG C H,et al.Clone genealogies extraction based on software evolution over multiple versions[J].Journal of Computer Applications,2015,35(4):1169-1173.(in Chinese) 涂颖,张丽萍,王春晖,等.基于软件多版本演化提取克隆谱系[J].计算机应用,2015,3(4):1169-1173.
[20] YUN L L,ZHANG L P,YU C H,et al.Predicting inconsistent change probability of code clone based on latent Dirichlet allocation model[J].Journal of Computer Applications,2014,4(6):1788-1791.(in Chinese) 尹丽丽,张丽萍,王春晖,等.基于潜在狄利克雷分配模型预测克隆代码不一致变化的可能性[J].计算机应用,2014,4(6):1788-1791.
[21] FlawFinder.http://www.dwheeler.com/flawfinder/.
[22] DALE M.Static analysis of the VoteHere VHTi reference implementation source code using Flawfinder and RATS.http://cisa.umbc.edu/courses/cmsc/444/fall05/studentprojects/dale.pdf.
[23] WEI Z Q,et al.Improved Bayesian Network Structure Learning with Node Ordering via K2 Algorithm[M]∥Intelligent Computing Methodologies.Springer International Publishing,2014:44-55.
[24] COOPER G F,HERSKOVITS E.A Bayesian method for the in-duction of probabilistic networks from data[J].Machine Lear-ning,1992,9(4):309-347.

No related articles found!
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!