Rearranging the order of program statements for code clone detection

Yusuke Sabi, Yoshiki Higo, S. Kusumoto
{"title":"Rearranging the order of program statements for code clone detection","authors":"Yusuke Sabi, Yoshiki Higo, S. Kusumoto","doi":"10.1109/IWSC.2017.7880503","DOIUrl":null,"url":null,"abstract":"A code clone is a code fragment identical or similar to another code fragment in source code. Some of code clones are considered as a factor of bug replications and make it more difficult to maintain software. Various code clone detection tools have been proposed so far. However, in most algorithms adopted by existing clone detection tools, if program statements are reordered, they are not detected as code clones. In this research, we examined how clone detection results change by rearranging the order of program statements. We performed preprocessing to rearranging the order of program statements using program dependency graph (PDG). We compared clone detection results with and without preprocessing. As a result, by rearranging the order of program statements, the number of detected code clones is almost the same in most projects. We classified newly detected or disappeared clones manually. From our experimental results, we show that there is no newly detected clone whose statements are reordered and that there are four disappeared clones whose statements are reordered. We think three out of the four clones occurred by copy-and-paste operations. Therefore, we conclude that rearranging the order of program statements is not effective to detect reordered code clones.","PeriodicalId":222231,"journal":{"name":"2017 IEEE 11th International Workshop on Software Clones (IWSC)","volume":"88 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-02-21","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2017 IEEE 11th International Workshop on Software Clones (IWSC)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/IWSC.2017.7880503","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5

Abstract

A code clone is a code fragment identical or similar to another code fragment in source code. Some of code clones are considered as a factor of bug replications and make it more difficult to maintain software. Various code clone detection tools have been proposed so far. However, in most algorithms adopted by existing clone detection tools, if program statements are reordered, they are not detected as code clones. In this research, we examined how clone detection results change by rearranging the order of program statements. We performed preprocessing to rearranging the order of program statements using program dependency graph (PDG). We compared clone detection results with and without preprocessing. As a result, by rearranging the order of program statements, the number of detected code clones is almost the same in most projects. We classified newly detected or disappeared clones manually. From our experimental results, we show that there is no newly detected clone whose statements are reordered and that there are four disappeared clones whose statements are reordered. We think three out of the four clones occurred by copy-and-paste operations. Therefore, we conclude that rearranging the order of program statements is not effective to detect reordered code clones.
重新排列程序语句的顺序以进行代码克隆检测
代码克隆是与源代码中的另一个代码片段相同或相似的代码片段。一些代码克隆被认为是bug复制的一个因素,使维护软件变得更加困难。到目前为止,已经提出了各种代码克隆检测工具。然而,在现有克隆检测工具采用的大多数算法中,如果程序语句被重新排序,它们不会被检测为代码克隆。在本研究中,我们考察了通过重新排列程序语句的顺序如何改变克隆检测结果。我们使用程序依赖图(PDG)对程序语句进行预处理,重新排列程序语句的顺序。我们比较了预处理和不预处理的克隆检测结果。因此,通过重新排列程序语句的顺序,在大多数项目中检测到的代码克隆的数量几乎是相同的。我们手动对新检测到的或消失的克隆进行分类。实验结果表明,没有新检测到语句被重新排序的克隆,有四个语句被重新排序的克隆消失了。我们认为四分之三的克隆是通过复制-粘贴操作发生的。因此,我们得出结论,重新排列程序语句的顺序不能有效地检测重新排序的代码克隆。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信