Predicting change consistency in a clone group

被引:14
作者
Zhang, Fanlong [1 ]
Khoo, Siau-cheng [2 ]
Su, Xiaohong [1 ]
机构
[1] Harbin Inst Technol, Sch Comp Sci & Technol, Harbin, Heilongjiang, Peoples R China
[2] Natl Univ Singapore, Sch Comp, Singapore, Singapore
基金
中国国家自然科学基金;
关键词
Software reuse; Clone maintenance; Code clones; Consistency-requirement prediction; Bayesian network; Clone attributes; CODE;
D O I
10.1016/j.jss.2017.08.045
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code cloning has been accepted as one of the general code reuse methods in software development, thanks to the increasing demand in rapid software production. The introduction of clone groups and clone genealogies enable software developers to be aware of the presence of and changes to clones as a collective group; they also allow developers to understand how clone groups evolve throughout software life cycle. Due to similarity in codes within a clone group, a change in one piece of the code may require developers to make consistent change to other clones in the group. Failure in making such consistent change to a clone group when necessary is commonly known as "clone consistency-defect", which can adversely impact software reusability. In this work, we propose an approach to predict the need for making consistent change in clones within a clone group at the time when changes have been made to one of its clones. We build a variant of clone genealogies to collect all consistent/inconsistent changes to clone groups, and extract three attribute sets from clone groups as input for predicting the need for consistent clone change. These three attribute sets are code attributes, context attributes and evolution attributes respectively. Together, they provide a holistic view about clone changes. We conduct experiments on four open source projects. Our experiments show that our approach has reasonable precision and recall in predicting whether a clone group requires (or is free of) consistent change. This holistic approach can aid developers in maintaining clone changes, and avoid potential consistency-defect, which can improve software quality and reusability. (C) 2017 Elsevier Inc. All rights reserved.
引用
收藏
页码:105 / 119
页数:15
相关论文
共 38 条
[1]  
[Anonymous], 2007, QUEENS SCH COMPUT T
[2]  
Aversano L, 2007, CSMR 2007: 11TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING, PROCEEDINGS, P81
[3]  
Bakota Tibor, 2007, 2007 IEEE International Conference on Software Maintenance, P24, DOI 10.1109/ICSM.2007.4362615
[4]  
Barbour L., 2011, 2011 IEEE 27th International Conference on Software Maintenance, P273, DOI 10.1109/ICSM.2011.6080794
[5]   An Empirical Study on Inconsistent Changes to Code Clones at Release Level [J].
Bettenburg, Nicolas ;
Shang, Weyi ;
Ibrahim, Walid ;
Adams, Bram ;
Zou, Ying ;
Hassan, Ahmed E. .
16TH WORKING CONFERENCE ON REVERSE ENGINEERING (WCRE 2009), 2009, :85-94
[6]   A New Clone Group Mapping Algorithm for Extracting Clone Genealogy on Multi-Version Software [J].
Ci Meng ;
Su Xiao-hong ;
Wang Tian-tian ;
Ma Pei-jun .
2013 THIRD INTERNATIONAL CONFERENCE ON INSTRUMENTATION & MEASUREMENT, COMPUTER, COMMUNICATION AND CONTROL (IMCCC), 2013, :848-853
[7]   Clone Region Descriptors: Representing and Tracking Duplication in Source Code [J].
Duala-Ekoko, Ekwa ;
Robillard, Martin P. .
ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2010, 20 (01)
[8]  
Duala-Ekoko E, 2008, ICSE'08 PROCEEDINGS OF THE THIRTIETH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, P843, DOI 10.1145/1368088.1368218
[9]  
Fowler M., 1999, Refactoring: Improving the design of existing code
[10]   Bayesian network classifiers [J].
Friedman, N ;
Geiger, D ;
Goldszmidt, M .
MACHINE LEARNING, 1997, 29 (2-3) :131-163