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 条
  • [11] An Empirical Study on Accidental Cross-Project Code Clones
    Pyl, Mitchel
    van Bladel, Brent
    Demeyer, Serge
    PROCEEDINGS OF THE 2020 IEEE 14TH INTERNATIONAL WORKSHOP ON SOFTWARE CLONES (IWSC '20), 2020, : 33 - 37
  • [12] An Empirical Study on Inconsistent Changes to Code Clones at Release Level
    Bettenburg, Nicolas
    Shang, Weyi
    Ibrahim, Walid
    Adams, Bram
    Zou, Ying
    Hassan, Ahmed E.
    16TH WORKING CONFERENCE ON REVERSE ENGINEERING (WCRE 2009), 2009, : 85 - 94
  • [13] Development nature matters: An empirical study of code clones in JavaScript applications
    Wai Ting Cheung
    Sukyoung Ryu
    Sunghun Kim
    Empirical Software Engineering, 2016, 21 : 517 - 564
  • [14] Measuring the Efficacy of Code Clone Information in a Bug Localization Task: An Empirical Study
    Chatterji, Debarshi
    Carver, Jeffrey C.
    Massengill, Beverly
    Oslin, Jason
    Kraft, Nicholas A.
    2011 FIFTH INTERNATIONAL SYMPOSIUM ON EMPIRICAL SOFTWARE ENGINEERING AND MEASUREMENT (ESEM 2011), 2011, : 20 - 29
  • [15] A comparative study of test code clones and production code clones?
    van Bladel, Brent
    Demeyer, Serge
    JOURNAL OF SYSTEMS AND SOFTWARE, 2021, 176
  • [16] Granularity-based Comparison of the Bug-proneness of Code Clones
    Mondal, Smritikana
    Mondal, Manishankar
    Debnath, Rameswar
    2023 IEEE 17TH INTERNATIONAL WORKSHOP ON SOFTWARE CLONES, IWSC 2023, 2023, : 8 - 14
  • [17] How are functionally similar code clones syntactically different? An empirical study and a benchmark
    Wagner, Stefan
    Abdulkhaleq, Asim
    Bogicevic, Ivan
    Ostberg, Jan-Peter
    Ramadani, Jasmin
    PEERJ COMPUTER SCIENCE, 2016,
  • [18] Security Vulnerabilities in Categories of Clones and Non-Cloned Code: An Empirical Study
    Islam, Md Rakibul
    Zibran, Minhaz F.
    Nagpal, Aayush
    11TH ACM/IEEE INTERNATIONAL SYMPOSIUM ON EMPIRICAL SOFTWARE ENGINEERING AND MEASUREMENT (ESEM 2017), 2017, : 20 - 29
  • [19] Development nature matters: An empirical study of code clones in Java']JavaScript applications
    Cheung, Wai Ting
    Ryu, Sukyoung
    Kim, Sunghun
    EMPIRICAL SOFTWARE ENGINEERING, 2016, 21 (02) : 517 - 564
  • [20] An Empirical Study on Bug Severity Estimation using Source Code Metrics and Static Analysis
    Mashhadi, Ehsan
    Chowdhury, Shaiful
    Modaberi, Somayeh
    Hemmati, Hadi
    Uddin, Gias
    arXiv, 2022,