We use cookies to improve your experience with our site.
Fan-Long Zhang, Yu-Chen Chen, Siau-Cheng Khoo, Wen-Chao Jiang. CHANN: A Hierarchical Neural Network for Clone Consistent Change Prediction[J]. Journal of Computer Science and Technology. DOI: 10.1007/s11390-023-2831-8
Citation: Fan-Long Zhang, Yu-Chen Chen, Siau-Cheng Khoo, Wen-Chao Jiang. CHANN: A Hierarchical Neural Network for Clone Consistent Change Prediction[J]. Journal of Computer Science and Technology. DOI: 10.1007/s11390-023-2831-8

CHANN: A Hierarchical Neural Network for Clone Consistent Change Prediction

  • 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 the 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, thus enhancing the effectiveness of clone consistency prediction. To assess the effectiveness of CHANN, we conducted 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 is available at the early stage of software development.
  • loading

Catalog

    /

    DownLoad:  Full-Size Img  PowerPoint
    Return
    Return