AI Chat Paper
Note: Please note that the following content is generated by AMiner AI. SciOpen does not take any responsibility related to this content.
{{lang === 'zh_CN' ? '文章概述' : 'Summary'}}
{{lang === 'en_US' ? '中' : 'Eng'}}
Chat more with AI
Article Link
Collect
Submit Manuscript
Show Outline
Outline
Show full outline
Hide outline
Outline
Show full outline
Hide outline
Regular Paper

CHANN: A Hierarchical Neural Network for Clone Consistency Prediction

School of Computer Science and Technology, Guangdong University of Technology, Guangzhou 510006, China
School of Computing, National University of Singapore, Singapore 119077, Singapore
Show Author Information

Abstract

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.

Electronic Supplementary Material

Download File(s)
JCST-2209-12831-Highlights.pdf (208.7 KB)

References

【1】
【1】
 
 
Journal of Computer Science and Technology
Pages 178-195

{{item.num}}

Comments on this article

Go to comment

< Back to all reports

Review Status: {{reviewData.commendedNum}} Commended , {{reviewData.revisionRequiredNum}} Revision Required , {{reviewData.notCommendedNum}} Not Commended Under Peer Review

Review Comment

Close
Close
Cite this article:
Zhang F-L, Chen Y-C, Khoo S-C, et al. CHANN: A Hierarchical Neural Network for Clone Consistency Prediction. Journal of Computer Science and Technology, 2025, 40(1): 178-195. https://doi.org/10.1007/s11390-023-2831-8

521

Views

0

Crossref

0

Web of Science

0

Scopus

0

CSCD

Received: 14 September 2022
Accepted: 07 December 2023
Published: 23 February 2025
© Institute of Computing Technology, Chinese Academy of Sciences 2025