代码克隆中接口相似性的探索性研究

Md Rakib Hossain Misu, A. Satter, K. Sakib
{"title":"代码克隆中接口相似性的探索性研究","authors":"Md Rakib Hossain Misu, A. Satter, K. Sakib","doi":"10.1109/APSECW.2017.24","DOIUrl":null,"url":null,"abstract":"Code cloning is one of the most popular code reusing techniques where similar pieces of code are replicated within or between code repositories. Interface similarity is a kind of replication that refers to the similarity of method names, return types and parameter types which repeat across the code repositories. Two methods with similar interfaces are prone to be cloned if those perform analogous functions either entirely or at least partially. An exploratory study is performed in this paper, to explore the relationship and effects of interface similarity in code clones. It is investigated that interface similarity can be helpful for code clone detection. First, clone methods are detected in code repositories. Then, interface information is extracted from source code and several interface similarities are measured using that information. The experimental corpus contains three different types of code repositories with 35, 109 and 24,558 Java projects respectively. The detected clone pairs in three code repositories are, on average 57,457, 102,745 and 123,576 respectively. Promising results are found as it shows on average 87.91% intra-project and 59.17% inter-project clones contain similar interfaces (i.e., return types and at least one keyword and one parameter type are similar). Besides, the average similarity of interfaces in Type-1, Type-2 and Type-3 clones are 100%, 83.47% and 81.90% respectively. These results prove the strong relationship between code clones and interface similarities. In future, it can be useful to design and develop interface driven clone detection tools.","PeriodicalId":172357,"journal":{"name":"2017 24th Asia-Pacific Software Engineering Conference Workshops (APSECW)","volume":"432 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2017-12-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":"{\"title\":\"An Exploratory Study on Interface Similarities in Code Clones\",\"authors\":\"Md Rakib Hossain Misu, A. Satter, K. Sakib\",\"doi\":\"10.1109/APSECW.2017.24\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Code cloning is one of the most popular code reusing techniques where similar pieces of code are replicated within or between code repositories. Interface similarity is a kind of replication that refers to the similarity of method names, return types and parameter types which repeat across the code repositories. Two methods with similar interfaces are prone to be cloned if those perform analogous functions either entirely or at least partially. An exploratory study is performed in this paper, to explore the relationship and effects of interface similarity in code clones. It is investigated that interface similarity can be helpful for code clone detection. First, clone methods are detected in code repositories. Then, interface information is extracted from source code and several interface similarities are measured using that information. The experimental corpus contains three different types of code repositories with 35, 109 and 24,558 Java projects respectively. The detected clone pairs in three code repositories are, on average 57,457, 102,745 and 123,576 respectively. Promising results are found as it shows on average 87.91% intra-project and 59.17% inter-project clones contain similar interfaces (i.e., return types and at least one keyword and one parameter type are similar). Besides, the average similarity of interfaces in Type-1, Type-2 and Type-3 clones are 100%, 83.47% and 81.90% respectively. These results prove the strong relationship between code clones and interface similarities. In future, it can be useful to design and develop interface driven clone detection tools.\",\"PeriodicalId\":172357,\"journal\":{\"name\":\"2017 24th Asia-Pacific Software Engineering Conference Workshops (APSECW)\",\"volume\":\"432 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2017-12-01\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"6\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"2017 24th Asia-Pacific Software Engineering Conference Workshops (APSECW)\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.1109/APSECW.2017.24\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"2017 24th Asia-Pacific Software Engineering Conference Workshops (APSECW)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/APSECW.2017.24","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 6

摘要

代码克隆是最流行的代码重用技术之一,在代码存储库内部或之间复制相似的代码片段。接口相似性是一种复制,指的是方法名、返回类型和参数类型的相似性,这些相似性在代码库中重复。具有相似接口的两个方法如果完全或至少部分执行类似的功能,则容易被克隆。本文进行了一项探索性研究,探讨了代码克隆中接口相似度的关系和影响。研究了接口相似度对代码克隆检测的帮助。首先,在代码存储库中检测克隆方法。然后,从源代码中提取接口信息,并使用该信息测量几个接口的相似度。实验语料库包含三种不同类型的代码库,分别包含35,109和24,558个Java项目。在三个代码库中检测到的克隆对平均分别为57,457,102,745和123,576。结果显示,平均87.91%的项目内克隆和59.17%的项目间克隆包含相似的接口(即返回类型、至少一个关键字和一个参数类型相似)。Type-1、Type-2和Type-3克隆的平均接口相似度分别为100%、83.47%和81.90%。这些结果证明了代码克隆和接口相似性之间的密切关系。将来,它可以用于设计和开发接口驱动的克隆检测工具。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
An Exploratory Study on Interface Similarities in Code Clones
Code cloning is one of the most popular code reusing techniques where similar pieces of code are replicated within or between code repositories. Interface similarity is a kind of replication that refers to the similarity of method names, return types and parameter types which repeat across the code repositories. Two methods with similar interfaces are prone to be cloned if those perform analogous functions either entirely or at least partially. An exploratory study is performed in this paper, to explore the relationship and effects of interface similarity in code clones. It is investigated that interface similarity can be helpful for code clone detection. First, clone methods are detected in code repositories. Then, interface information is extracted from source code and several interface similarities are measured using that information. The experimental corpus contains three different types of code repositories with 35, 109 and 24,558 Java projects respectively. The detected clone pairs in three code repositories are, on average 57,457, 102,745 and 123,576 respectively. Promising results are found as it shows on average 87.91% intra-project and 59.17% inter-project clones contain similar interfaces (i.e., return types and at least one keyword and one parameter type are similar). Besides, the average similarity of interfaces in Type-1, Type-2 and Type-3 clones are 100%, 83.47% and 81.90% respectively. These results prove the strong relationship between code clones and interface similarities. In future, it can be useful to design and develop interface driven clone detection tools.
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
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学术官方微信