CloneRipples: predicting change propagation between code clone instances by graph-based deep learning

被引:0
作者
Wu, Yijian [1 ,2 ]
Chen, Yuan [1 ,2 ]
Peng, Xin [1 ,2 ]
Hu, Bin [1 ,2 ]
Wang, Xiaochen [1 ,2 ]
Fu, Baiqiang [1 ,2 ]
Zhao, Wenyun [1 ,2 ]
机构
[1] Fudan Univ, Sch Comp Sci, Shanghai, Peoples R China
[2] Fudan Univ, Shanghai Key Lab Data Sci, Shanghai, Peoples R China
基金
中国国家自然科学基金;
关键词
Code clone; Change propagation; Consistent changes; Clone dataset; CONSISTENCY; PRONENESS;
D O I
10.1007/s10664-024-10567-0
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code clones are recognized as a code smell that may require additional effort for simultaneous changes of multiple clone instances during software maintenance. To alleviate quality threats caused by inconsistent changes in clone instances, it is essential to accurately and efficiently make the decisions of change propagation between code clone instances. Our exploratory study has revealed that a clone class can have both propagation-required changes and propagation-free changes and thus fine-grained change propagation decisions are required. Based on the findings, we propose a graph-based deep learning approach to predict the change propagation requirements of clone instances. We design a deep learning model that employs a Relational Graph Convolutional Network (R-GCN) to predict the clone change propagation requirement. In order to evaluate our approach, we construct a dataset that includes 24,672 pairs of matched changes and 38,041 non-matched changes based on 51 open-source Java projects. Experiment results show that the approach achieves high precision (83.1%), recall (81.2%), and F1-score (82.1%). We implemented an IntelliJ IDEA tool called CloneRipples to assist developers to decide the necessity of change propagation between code clone instances seamlessly in development environment. Manual inspection identified the chances for purifying the dataset by rectifying the data labels of non-matched changes. Extended experiments for various data purification strategies reveal feasible ways to improve the prediction effectiveness and generality.
引用
收藏
页数:31
相关论文
共 53 条
[31]   Clone-Based and Interactive Recommendation for Modifying Pasted Code [J].
Lin, Yun ;
Peng, Xin ;
Xing, Zhenchang ;
Zheng, Diwen ;
Zhao, Wenyun .
2015 10TH JOINT MEETING OF THE EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND THE ACM SIGSOFT SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING (ESEC/FSE 2015) PROCEEDINGS, 2015, :520-531
[32]  
Lozano A, 2007, 4 INT WORKSH MIN SOF, pp18
[33]   Bug-proneness and late propagation tendency of code clones: A Comparative study on different clone types [J].
Mondal, Manishankar ;
Roy, Chanchal K. ;
Schneider, Kevin A. .
JOURNAL OF SYSTEMS AND SOFTWARE, 2018, 144 :41-59
[34]   Is cloned code really stable? [J].
Mondal, Manishankar ;
Rahman, Md Saidur ;
Roy, Chanchal K. ;
Schneider, Kevin A. .
EMPIRICAL SOFTWARE ENGINEERING, 2018, 23 (02) :693-770
[35]   A comparative study on the intensity and harmfulness of late propagation in near-miss code clones [J].
Mondal, Manishankar ;
Roy, Chanchal K. ;
Schneider, Kevin A. .
SOFTWARE QUALITY JOURNAL, 2016, 24 (04) :883-915
[36]  
Mondal M, 2014, 2014 SOFTWARE EVOLUTION WEEK - IEEE CONFERENCE ON SOFTWARE MAINTENANCE, REENGINEERING, AND REVERSE ENGINEERING (CSMR-WCRE), P114, DOI 10.1109/CSMR-WCRE.2014.6747161
[37]  
Mondal Manishankar, 2014, PROC MSR 2014, P32
[38]   Clone-aware Configuration Management [J].
Nguyen, Tung Thanh ;
Nguyen, Hoan Anh ;
Pham, Nam H. ;
Al-Kofahi, Jafar M. ;
Nguyen, Tien N. .
2009 IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, PROCEEDINGS, 2009, :123-134
[39]   A comparison of code similarity analysers [J].
Ragkhitwetsagul, Chaiyong ;
Krinke, Jens ;
Clark, David .
EMPIRICAL SOFTWARE ENGINEERING, 2018, 23 (04) :2464-2519
[40]   Clones: what that smell? [J].
Rahman, Foyzur ;
Bird, Christian ;
Devanbu, Premkumar .
EMPIRICAL SOFTWARE ENGINEERING, 2012, 17 (4-5) :503-530