Bug Replication in Code Clones: An Empirical Study

被引:26
|
作者
Islam, Judith F. [1 ]
Mondal, Manishankar [1 ]
Roy, Chanchal K. [1 ]
机构
[1] Univ Saskatchewan, Dept Comp Sci, Saskatoon, SK S7N 0W0, Canada
关键词
NICAD;
D O I
10.1109/SANER.2016.78
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Code clones are exactly or nearly similar code fragments in the code-base of a software system. Existing studies show that clones are directly related to bugs and inconsistencies in the code-base. Code cloning (making code clones) is suspected to be responsible for replicating bugs in the code fragments. However, there is no study on the possibilities of bug-replication through cloning process. Such a study can help us discover ways of minimizing bug-replication. Focusing on this we conduct an empirical study on the intensities of bug-replication in the code clones of the major clone-types: Type 1, Type 2, and Type 3. According to our investigation on thousands of revisions of six diverse subject systems written in two different programming languages, C and Java, a considerable proportion (i.e., up to 10%) of the code clones can contain replicated bugs. Both Type 2 and Type 3 clones have higher tendencies of having replicated bugs compared to Type 1 clones. Thus, Type 2 and Type 3 clones are more important from clone management perspectives. The extent of bug-replication in the buggy clone classes is generally very high (i.e., 100% in most of the cases). We also find that overall 55% of all the bugs experienced by the code clones can be replicated bugs. Our study shows that replication of bugs through cloning is a common phenomenon. Clone fragments having method-calls and if-conditions should be considered for refactoring with high priorities, because such clone fragments have high possibilities of containing replicated bugs. We believe that our findings are important for better maintenance of software systems, in particular, systems with code clones.
引用
收藏
页码:68 / 78
页数:11
相关论文
共 50 条
  • [1] Comparing Bug Replication in Regular and Micro Code Clones
    Islam, Judith F.
    Mondal, Manishankar
    Roy, Chanchal K.
    Schneider, Kevin A.
    2019 IEEE/ACM 27TH INTERNATIONAL CONFERENCE ON PROGRAM COMPREHENSION (ICPC 2019), 2019, : 81 - 92
  • [2] On the Relationships between Stability and Bug-proneness of Code Clones: An Empirical Study
    Rahman, Md Saidur
    Roy, Chanchal K.
    2017 IEEE 17TH INTERNATIONAL WORKING CONFERENCE ON SOURCE CODE ANALYSIS AND MANIPULATION (SCAM), 2017, : 131 - 140
  • [3] An empirical study on the maintenance of source code clones
    Suresh Thummalapenta
    Luigi Cerulo
    Lerina Aversano
    Massimiliano Di Penta
    Empirical Software Engineering, 2010, 15 : 1 - 34
  • [4] An empirical study on the maintenance of source code clones
    Thummalapenta, Suresh
    Cerulo, Luigi
    Aversano, Lerina
    Di Penta, Massimiliano
    EMPIRICAL SOFTWARE ENGINEERING, 2010, 15 (01) : 1 - 34
  • [5] An empirical study on bug propagation through code cloning
    Mondal, Manishankar
    Roy, Banani
    Roy, Chanchal K.
    Schneider, Kevin A.
    JOURNAL OF SYSTEMS AND SOFTWARE, 2019, 158
  • [6] Bug Propagation through Code Cloning: An Empirical Study
    Mondal, Manishankar
    Roy, Chanchal K.
    Schneider, Kevin A.
    2017 IEEE INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME), 2017, : 227 - 237
  • [7] A Comparative Study on the Bug-Proneness of Different Types of Code Clones
    Mondal, Manishankar
    Roy, Chanchal K.
    Schneider, Kevin A.
    2015 31ST INTERNATIONAL CONFERENCE ON SOFTWARE MAINTENANCE AND EVOLUTION (ICSME) PROCEEDINGS, 2015, : 91 - 100
  • [8] An Empirical Study of Long-Lived Code Clones
    Cai, Dongxiang
    Kim, Miryung
    FUNDAMENTAL APPROACHES TO SOFTWARE ENGINEERING, 2011, 6603 : 432 - +
  • [9] An empirical study of code clones: Density, entropy, and patterns
    Hu, Bin
    Yu, Dongjin
    Wu, Yijian
    Hu, Tianyi
    Cai, Yuanfang
    SCIENCE OF COMPUTER PROGRAMMING, 2025, 242
  • [10] An empirical study on inconsistent changes to code clones at the release level
    Bettenburg, Nicolas
    Shang, Weiyi
    Ibrahim, Walid M.
    Adams, Bram
    Zou, Ying
    Hassan, Ahmed E.
    SCIENCE OF COMPUTER PROGRAMMING, 2012, 77 (06) : 760 - 776