Detecting Differences across Multiple Instances of Code Clones

被引:28
|
作者
Lin, Yun [1 ,2 ]
Xing, Zhenchang [3 ]
Xue, Yinxing [4 ]
Liu, Yang [3 ]
Peng, Xin [1 ,2 ]
Sun, Jun [5 ]
Zhao, Wenyun [1 ,2 ]
机构
[1] Fudan Univ, Sch Comp Sci, Shanghai, Peoples R China
[2] Fudan Univ, Shanghai Key Lab Data Sci, Shanghai, Peoples R China
[3] Nanyang Technol Univ, Sch Comp Engn, Singapore, Singapore
[4] Natl Univ Singapore, Sch Comp, Singapore, Singapore
[5] Singapore Univ Technol & Design, Singapore, Singapore
关键词
Code clone; Program differencing; Human study;
D O I
10.1145/2568225.2568298
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Clone detectors find similar code fragments (i.e., instances of code clones) and report large numbers of them for industrial systems. To maintain or manage code clones, developers often have to investigate differences of multiple cloned code fragments. However, existing program differencing techniques compare only two code fragments at a time. Developers then have to manually combine several pairwise differencing results. In this paper, we present an approach to automatically detecting differences across multiple clone instances. We have implemented our approach as an Eclipse plugin and evaluated its accuracy with three Java software systems. Our evaluation shows that our algorithm has precision over 97.66% and recall over 95.63% in three open source Java projects. We also conducted a user study of 18 developers to evaluate the usefulness of our approach for eight clone-related refactoring tasks. Our study shows that our approach can significantly improve developers' performance in refactoring decisions, refactoring details, and task completion time on clone-related refactoring tasks. Automatically detecting differences across multiple clone instances also opens opportunities for building practical applications of code clones in software maintenance, such as auto-generation of application skeleton, intelligent simultaneous code editing.
引用
收藏
页码:164 / 174
页数:11
相关论文
共 50 条
  • [21] Problematic Code Clones Identification using Multiple Detection Results
    Higo, Yoshiki
    Sawa, Ken-ichi
    Kusumoto, Shinji
    APSEC 09: SIXTEENTH ASIA-PACIFIC SOFTWARE ENGINEERING CONFERENCE, PROCEEDINGS, 2009, : 365 - 372
  • [22] A novel code representation for detecting Java']Java code clones using high-level and abstract compiled code representations
    Quradaa, Fahmi H.
    Shahzad, Sara
    Saeed, Rashad
    Sufyan, Mubarak M.
    PLOS ONE, 2024, 19 (05):
  • [23] A comparative study of test code clones and production code clones?
    van Bladel, Brent
    Demeyer, Serge
    JOURNAL OF SYSTEMS AND SOFTWARE, 2021, 176
  • [24] Staged Tree Matching for Detecting Code Move across Files
    Fujimoto, Akira
    Higo, Yoshiki
    Matsumoto, Junnosuke
    Kusumoto, Shinji
    2020 IEEE/ACM 28TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION, ICPC, 2020, : 396 - 400
  • [25] Relaying a fountain code across multiple nodes
    Gummadi, Ramakrishna
    Sreenivas, R. S.
    2008 IEEE INFORMATION THEORY WORKSHOP, 2008, : 149 - 153
  • [26] Detecting spatial differences in thermal stress across China
    Jie Zhang
    Wenli Lai
    Zhizhong Zhao
    Hongrui Wang
    Theoretical and Applied Climatology, 2019, 138 : 541 - 552
  • [27] Detecting spatial differences in thermal stress across China
    Zhang, Jie
    Lai, Wenli
    Zhao, Zhizhong
    Wang, Hongrui
    THEORETICAL AND APPLIED CLIMATOLOGY, 2019, 138 (1-2) : 541 - 552
  • [28] Detecting Semantic Code Clones by Building AST-based Markov Chains Model
    Wu, Yueming
    Feng, Siyue
    Zou, Deqing
    Jin, Hai
    ACM International Conference Proceeding Series, 2022,
  • [29] Assessing and Improving an Evaluation Dataset for Detecting Semantic Code Clones via Deep Learning
    Yu, Hao
    Hu, Xing
    Li, Ge
    Li, Ying
    Wang, Qianxiang
    Xie, Tao
    ACM TRANSACTIONS ON SOFTWARE ENGINEERING AND METHODOLOGY, 2022, 31 (04)
  • [30] Detecting Semantic Code Clones by Building AST-based Markov Chains Model
    Wu, Yueming
    Feng, Siyue
    Zou, Deqing
    Jin, Hai
    PROCEEDINGS OF THE 37TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING, ASE 2022, 2022,