Clone-Seeker: Effective Code Clone Search Using Annotations

被引:4
作者
Hammad, Muhammad [1 ]
Babur, Onder [1 ,2 ]
Basit, Hamid Abdul [3 ]
Van den Brand, Mark [1 ]
机构
[1] Eindhoven Univ Technol, Dept Math & Comp Sci, NL-5612 AZ Eindhoven, Netherlands
[2] Wageningen Univ & Res, Informat Technol Grp, NL-6708 PB Wageningen, Netherlands
[3] Prince Sultan Univ, Dept Software Engn, Riyadh 12435, Saudi Arabia
关键词
Codes; Cloning; Natural languages; Software; Search engines; Semantics; Writing; Annotation; code clone; code clone search; keyword extraction; information retrieval; SOFTWARE;
D O I
10.1109/ACCESS.2022.3145686
中图分类号
TP [自动化技术、计算机技术];
学科分类号
0812 ;
摘要
Source code search plays an important role in software development, e.g. for exploratory development or opportunistic reuse of existing code from a code base. Often, exploration of different implementations with the same functionality is needed for tasks like automated software transplantation, software diversification, and software repair. Code clones, which are syntactically or semantically similar code fragments, are perfect candidates for such tasks. Searching for code clones involves a given search query to retrieve the relevant code fragments. We propose a novel approach called Clone-Seeker that focuses on utilizing clone class features in retrieving code clones. For this purpose, we generate metadata for each code clone in the form of a natural language document. The metadata includes a pre-processed list of identifiers from the code clones augmented with a list of keywords indicating the semantics of the code clone. This keyword list can be extracted from a manually annotated general description of the clone class, or automatically generated from the source code of the entire clone class. This approach helps developers to perform code clone search based on a search query written either as source code terms, or as natural language. With various experiments, we show that (1) Clone-Seeker is effective in finding clones from BigCloneBench dataset by applying code queries and natural language queries; 2) Clone-Seeker has a higher recall when searching for semantic code clones (i.e., Type-4) in BigCloneBench than the state-of-the-art; 3) Clone-Seeker is a generalized technique as it is effective in finding clones in Project CodeNet dataset by applying code queries and natural language queries. 4) Clone-Seeker with manual annotation outperforms other variants in finding clones on the basis of natural language queries
引用
收藏
页码:11696 / 11713
页数:18
相关论文
共 50 条
  • [31] CloneTracker: Tool Support for Code Clone Management
    Duala-Ekoko, Ekwa
    Robillard, Martin P.
    ICSE'08 PROCEEDINGS OF THE THIRTIETH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, 2008, : 843 - 846
  • [32] Comparison and Visualization of Code Clone Detection Results
    Matsushima, Kazuki
    Inoue, Katsuro
    PROCEEDINGS OF THE 2020 IEEE 14TH INTERNATIONAL WORKSHOP ON SOFTWARE CLONES (IWSC '20), 2020, : 45 - 51
  • [33] Code Clone Graph Metrics for Detecting Diffused Code Clones
    Fukushima, Yoshihiko
    Kula, Raula
    Kawaguchi, Shinji
    Fushida, Kyohei
    Nagura, Masataka
    Iida, Hajimu
    APSEC 09: SIXTEENTH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE, PROCEEDINGS, 2009, : 373 - 380
  • [34] Semantic code clone detection for Internet of Things applications using reaching definition and liveness analysis
    Tekchandani, Rajkumar
    Bhatia, Rajesh
    Singh, Maninder
    JOURNAL OF SUPERCOMPUTING, 2018, 74 (09) : 4199 - 4226
  • [35] SeClone - A Hybrid Approach to Internet-scale Real-time Code Clone Search
    Keivanloo, Iman
    Rilling, Juergen
    Charland, Philippe
    2011 IEEE 19TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC), 2011, : 223 - +
  • [36] Java']Java Code Clone Detection by Exploiting Semantic and Syntax Information From Intermediate Code-Based Graph
    Yuan, Dawei
    Fang, Sen
    Zhang, Tao
    Xu, Zhou
    Luo, Xiapu
    IEEE TRANSACTIONS ON RELIABILITY, 2023, 72 (02) : 511 - 526
  • [37] Procedural x OO A Corporative Experiment on Source Code Clone Mining
    Barreto Torres, Jose Jorge
    Methanias, C. R. Junior
    de Freitas Farias, Mario Andre
    ICEIS: PROCEEDINGS OF THE 19TH INTERNATIONAL CONFERENCE ON ENTERPRISE INFORMATION SYSTEMS - VOL 2, 2017, : 395 - 402
  • [38] FCCA: Hybrid Code Representation for Functional Clone Detection Using Attention Networks
    Hua, Wei
    Sui, Yulei
    Wan, Yao
    Liu, Guangzhong
    Xu, Guandong
    IEEE TRANSACTIONS ON RELIABILITY, 2021, 70 (01) : 304 - 318
  • [39] Structural Function Based Code Clone Detection Using A New Hybrid Technique
    Yang, Yanming
    Ren, Zhilei
    Chen, Xin
    Jiang, He
    2018 IEEE 42ND ANNUAL COMPUTER SOFTWARE AND APPLICATIONS CONFERENCE (COMPSAC), VOL 1, 2018, : 286 - 291
  • [40] A systematic literature review on source code similarity measurement and clone detection: Techniques, applications, and challenges
    Zakeri-Nasrabadi, Morteza
    Parsa, Saeed
    Ramezani, Mohammad
    Roy, Chanchal
    Ekhtiarzadeh, Masoud
    JOURNAL OF SYSTEMS AND SOFTWARE, 2023, 204