CHANN:A Hierarchical Neural Network for Clone Consistency Prediction  

在线阅读下载全文

作  者:Fan-Long Zhang Yu-Chen Chen Siau-Cheng Khoo Wen-Chao Jiang 张凡龙;陈宇琛;邱少青;姜文超

机构地区:[1]School of Computer Science and Technology,Guangdong University of Technology,Guangzhou 510006,China [2]School of Computing,National University of Singapore,Singapore 119077,Singapore

出  处:《Journal of Computer Science & Technology》2025年第1期178-195,共18页计算机科学技术学报(英文版)

基  金:supported by the National Natural Science Foundation of China under Grant Nos.U20A6003 and 62237001;the Guangdong Science and Technology Plan Project under Grant No.2021B1212100004;the Guangdong Natural Science Fund Project under Grant No.2021A1515011243;Guangdong Joint Fund of the National Natural Science Foundation of China underGrant Nos.U1801263and U1701262.

摘  要:Modifying a code segment may give rise to a consistency issue when the code segment belongs to a clone group comprising closely similar code segments.Recent studies have demonstrated that such consistent changes can incur extra maintenance costs when clones are checked for consistency and introduce defects if developers forget to change clones consistently when needed.To address this problem,researchers have proposed an approach to predict clone consistency in advance with handcrafted attributes,notably using machine learning methods.Although these attributes can help predict clone consistency to some extent,the capability of such an approach is generally weak and unsatisfactory in practice.Such limitations in capability are especially severe at a project's infancy stage when there is not sufficient within-project data to model clone consistency behavior,and cross-project data have not been helpful in supporting prediction.In this paper,we propose the Clone Hierarchical Attention Neural Network(CHANN)to represent code clones and their evolution by adopting a hierarchical perspective of code,context,and code evolution,and thus enhancing the effectiveness of clone consistency prediction.To assess the effectiveness of CHANN,we conduct experiments on the dataset collected from eight open-source projects.The experimental results show that CHANN is highly effective in predicting clone consistency,and the precision,recall,and F-measure attained in prediction are around 82%.These findings support our hypothesis that the hierarchical neural network can help developers predict clone consistency effectively in the case of cross-project incubation when insufficient data are available at the early stage of software development.

关 键 词:code clone clone consistent change clone consistency prediction software maintenance deep learning 

分 类 号:TP311.5[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象