Back to Search Start Over

FCCA: Hybrid Code Representation for Functional Clone Detection Using Attention Networks.

Authors :
Hua, Wei
Sui, Yulei
Wan, Yao
Liu, Guangzhong
Xu, Guandong
Source :
IEEE Transactions on Reliability; Mar2021, Vol. 70 Issue 1, p304-318, 15p
Publication Year :
2021

Abstract

Code cloning, which reuses a fragment of source code via copy-and-paste with or without modifications, is a common way for code reuse and software prototyping. However, the duplicated code fragments often affect software quality, resulting in high maintenance cost. The existing clone detectors using shallow textual or syntactical features to identify code similarity are still ineffective in accurately finding sophisticated functional code clones in real-world code bases. This article proposes functional code clone detector using attention (FCCA), a deep-learning-based code clone detection approach on top of a hybrid code representation by preserving multiple code features, including unstructured (code in the form of sequential tokens) and structured (code in the form of abstract syntax trees and control-flow graphs) information. Multiple code features are fused into a hybrid representation, which is equipped with an attention mechanism that pays attention to important code parts and features that contribute to the final detection accuracy. We have implemented and evaluated FCCA using 275 777 real-world code clone pairs written in Java. The experimental results show that FCCA outperforms several state-of-the-art approaches for detecting functional code clones in terms of accuracy, recall, and F1 score. [ABSTRACT FROM AUTHOR]

Details

Language :
English
ISSN :
00189529
Volume :
70
Issue :
1
Database :
Complementary Index
Journal :
IEEE Transactions on Reliability
Publication Type :
Academic Journal
Accession number :
149122293
Full Text :
https://doi.org/10.1109/TR.2020.3001918