Two-Pass Technique for Clone Detection and Type Classification Using Tree-Based Convolution Neural Network

被引:11
作者
Jo, Young-Bin [1 ]
Lee, Jihyun [1 ]
Yoo, Cheol-Jung [1 ]
机构
[1] Jeonbuk Natl Univ, Dept Software Engn, Jeonju 54896, South Korea
来源
APPLIED SCIENCES-BASEL | 2021年 / 11卷 / 14期
基金
新加坡国家研究基金会;
关键词
clone detection; clone type classification; CNN; TBCNN; clone-and-own approach; CODE;
D O I
10.3390/app11146613
中图分类号
O6 [化学];
学科分类号
0703 ;
摘要
Appropriate reliance on code clones significantly reduces development costs and hastens the development process. Reckless cloning, in contrast, reduces code quality and ultimately adds costs and time. To avoid this scenario, many researchers have proposed methods for clone detection and refactoring. The developed techniques, however, are only reliably capable of detecting clones that are either entirely identical or that only use modified identifiers, and do not provide clone-type information. This paper proposes a two-pass clone classification technique that uses a tree-based convolution neural network (TBCNN) to detect multiple clone types, including clones that are not wholly identical or to which only small changes have been made, and automatically classify them by type. Our method was validated with BigCloneBench, a well-known and wildly used dataset of cloned code. Our experimental results validate that our technique detected clones with an average rate of 96% recall and precision, and classified clones with an average rate of 78% recall and precision.
引用
收藏
页数:18
相关论文
共 36 条
  • [1] code2vec: Learning Distributed Representations of Code
    Alon, Uri
    Zilberstein, Meital
    Levy, Omer
    Yahav, Eran
    [J]. PROCEEDINGS OF THE ACM ON PROGRAMMING LANGUAGES-PACMPL, 2019, 3 (POPL):
  • [2] [Anonymous], 2001, P 18 ACM S OP SYST P
  • [3] BAKER BS, 1995, SECOND WORKING CONFERENCE ON REVERSE ENGINEERING, PROCEEDINGS, P86, DOI 10.1109/WCRE.1995.514697
  • [4] Clone detection using abstract syntax trees
    Baxter, ID
    Yahin, A
    Moura, L
    Sant'Anna, M
    Bier, L
    [J]. INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE, PROCEEDINGS, 1998, : 368 - 377
  • [5] Comparison and evaluation of clone detection tools
    Bellon, Stefan
    Koschke, Rainer
    Antoniol, Giuliano
    Krinke, Jens
    Merlo, Ettore
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2007, 33 (09) : 577 - 591
  • [6] Bui, 2018, WORKSHOPS 32 AAAI C, P758
  • [7] Achieving Accuracy and Scalability Simultaneously in Detecting Application Clones on Android Markets
    Chen, Kai
    Liu, Peng
    Zhang, Yingjun
    [J]. 36TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2014), 2014, : 175 - 186
  • [8] Clone detection via structural abstraction
    Evans, William S.
    Fraser, Christopher W.
    Ma, Fei
    [J]. SOFTWARE QUALITY JOURNAL, 2009, 17 (04) : 309 - 330
  • [9] Fang C., 2020, P 29 ACM SIGSOFT INT, P516
  • [10] Gabel M, 2008, ICSE'08 PROCEEDINGS OF THE THIRTIETH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, P321, DOI 10.1145/1368088.1368132