On the Relationships Between Stability and Bug-Proneness of Code Clones: An Empirical Study

M. S. Rahman, C. Roy
{"title":"On the Relationships Between Stability and Bug-Proneness of Code Clones: An Empirical Study","authors":"M. S. Rahman, C. Roy","doi":"10.1109/SCAM.2017.26","DOIUrl":null,"url":null,"abstract":"Exact or similar copies of code fragments in a code base are known as code clones. Code clones are considered as one of the serious code smells. Stability is a widely investigated perspective of assessing the impacts of clones on software systems. A number of existing studies show that clones are often less stable than non-cloned code. This suggests that clones change more frequently than non-cloned code and thus may require comparatively more maintenance efforts. Again, frequent changes to clones may increase the likelihood of missing change propagation to the co-change candidates leading to inconsistencies or bugs. However, none of the existing studies investigate whether stability of clones is related to the bug-proneness. In this paper, we present an empirical study that analyzes the relationships between stability and bug-proneness of clones. We identify bug-fix commits by analyzing the commit messages from software repositories. We then identify the clones those are changed in the bug-fix commits as bug-prone clones. We then compare the stability of buggy and non-buggy clones considering the fine-grained syntactic change types and their significance.,,Our experimental results based on five open-source Java systems of different size and application domains show that (1) stability and bug-proneness of code clones are related and this relationship is statistically significant, (2) for both exact (Type 1) and near-miss (Type 2 and Type 3) clones, buggy clones tend to have higher frequency of changes than non-buggy clones, (3) the bug-proneness of Type 2 and Type 3 clones tend to be strongly related with their stability compared to Type 1 clones, and (4) the relation between the stability and the bug-proneness of clones with respect to fine-grained change types is likely to be influenced by the changes of low to medium significance. We believe that our findings are important and potentially useful in identifying and prioritizing candidate clones for management.","PeriodicalId":306744,"journal":{"name":"2017 IEEE 17th International Working Conference on Source Code Analysis and Manipulation (SCAM)","volume":null,"pages":null},"PeriodicalIF":0.0000,"publicationDate":"2017-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"14","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2017 IEEE 17th International Working Conference on Source Code Analysis and Manipulation (SCAM)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/SCAM.2017.26","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 14

Abstract

Exact or similar copies of code fragments in a code base are known as code clones. Code clones are considered as one of the serious code smells. Stability is a widely investigated perspective of assessing the impacts of clones on software systems. A number of existing studies show that clones are often less stable than non-cloned code. This suggests that clones change more frequently than non-cloned code and thus may require comparatively more maintenance efforts. Again, frequent changes to clones may increase the likelihood of missing change propagation to the co-change candidates leading to inconsistencies or bugs. However, none of the existing studies investigate whether stability of clones is related to the bug-proneness. In this paper, we present an empirical study that analyzes the relationships between stability and bug-proneness of clones. We identify bug-fix commits by analyzing the commit messages from software repositories. We then identify the clones those are changed in the bug-fix commits as bug-prone clones. We then compare the stability of buggy and non-buggy clones considering the fine-grained syntactic change types and their significance.,,Our experimental results based on five open-source Java systems of different size and application domains show that (1) stability and bug-proneness of code clones are related and this relationship is statistically significant, (2) for both exact (Type 1) and near-miss (Type 2 and Type 3) clones, buggy clones tend to have higher frequency of changes than non-buggy clones, (3) the bug-proneness of Type 2 and Type 3 clones tend to be strongly related with their stability compared to Type 1 clones, and (4) the relation between the stability and the bug-proneness of clones with respect to fine-grained change types is likely to be influenced by the changes of low to medium significance. We believe that our findings are important and potentially useful in identifying and prioritizing candidate clones for management.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
代码克隆稳定性与bug易感性关系的实证研究
代码库中代码片段的精确或相似副本称为代码克隆。代码克隆被认为是严重的代码异味之一。稳定性是评估克隆对软件系统影响的一个广泛研究的角度。许多现有的研究表明,克隆代码通常比非克隆代码更不稳定。这表明克隆代码比非克隆代码更改更频繁,因此可能需要相对更多的维护工作。同样,对克隆的频繁更改可能会增加遗漏更改传播到共同更改候选项的可能性,从而导致不一致或错误。然而,目前还没有研究表明克隆的稳定性是否与细菌倾向有关。本文对克隆的稳定性与虫性之间的关系进行了实证研究。我们通过分析来自软件存储库的提交消息来识别bug修复提交。然后,我们将在bug修复提交中更改的克隆标识为容易出现bug的克隆。然后,考虑到细粒度语法变化类型及其重要性,我们比较了有bug和无bug克隆的稳定性。基于5个不同规模和应用领域的开源Java系统,我们的实验结果表明:(1)代码克隆的稳定性和bug倾向是相关的,并且这种关系具有统计学意义;(2)对于精确(类型1)和近距离(类型2和类型3)克隆,有bug的克隆比无bug的克隆具有更高的更改频率。(3)与1型克隆相比,2型和3型克隆的bug-proneness与其稳定性有较强的相关性;(4)对于细粒度变化类型,克隆的稳定性与bug-proneness的关系很可能受到中低等显著性变化的影响。我们相信,我们的发现对于识别和确定候选克隆的管理优先级是重要的和潜在的有用的。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
How do Scratch Programmers Name Variables and Procedures? Extracting Timed Automata from Java Methods An Exploratory Study of Functional Redundancy in Code Repositories Investigating the Use of Code Analysis and NLP to Promote a Consistent Usage of Identifiers Supporting Analysis of SQL Queries in PHP AiR
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1