A qualitative approach for refactoring of code clone opportunities using graph and tree methods

Chaitanya Kulkarni
{"title":"A qualitative approach for refactoring of code clone opportunities using graph and tree methods","authors":"Chaitanya Kulkarni","doi":"10.1109/INCITE.2016.7857608","DOIUrl":null,"url":null,"abstract":"Reusing of code has been a very common practice in software development. This practice has been implemented to reduce programming time and efforts greatly. This copying and pasting behavior of programmers leads to cloning of codes and therefore has a very serious impact on the maintenance of the software systems. Many clone detection tool has been proposed to find out the copied code. However, refactoring of code is still a challenging part as most of the ongoing tools depend on detection of clone rather than the ability to make decision on refactorability. These tools do not guarantee whether such codes can be safely refactored or not. Our aim mainly lies on detecting the possibility of refactoring a code. To find out whether the code clone can be securely refactored or not, three methods are applied: Nesting Structure Mapping, Statement Mapping and Precondition Examination. In order to refactor the code, we apply some techniques like Pull-Up Method and Push-Down Method. In our approach, we have tried to find the refactorable code using the methods and also refactored the code so as to remove the problem of code cloning.","PeriodicalId":59618,"journal":{"name":"下一代","volume":"27 1","pages":"154-159"},"PeriodicalIF":0.0000,"publicationDate":"2016-10-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"下一代","FirstCategoryId":"1092","ListUrlMain":"https://doi.org/10.1109/INCITE.2016.7857608","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2

Abstract

Reusing of code has been a very common practice in software development. This practice has been implemented to reduce programming time and efforts greatly. This copying and pasting behavior of programmers leads to cloning of codes and therefore has a very serious impact on the maintenance of the software systems. Many clone detection tool has been proposed to find out the copied code. However, refactoring of code is still a challenging part as most of the ongoing tools depend on detection of clone rather than the ability to make decision on refactorability. These tools do not guarantee whether such codes can be safely refactored or not. Our aim mainly lies on detecting the possibility of refactoring a code. To find out whether the code clone can be securely refactored or not, three methods are applied: Nesting Structure Mapping, Statement Mapping and Precondition Examination. In order to refactor the code, we apply some techniques like Pull-Up Method and Push-Down Method. In our approach, we have tried to find the refactorable code using the methods and also refactored the code so as to remove the problem of code cloning.
使用图和树方法重构代码克隆机会的定性方法
代码重用在软件开发中是一种非常普遍的做法。实现这种做法是为了大大减少编程时间和工作量。程序员的这种复制和粘贴行为导致了代码的克隆,因此对软件系统的维护产生了非常严重的影响。为了找出被复制的代码,已经提出了许多克隆检测工具。然而,代码重构仍然是一个具有挑战性的部分,因为大多数正在使用的工具依赖于克隆检测,而不是根据可重构性做出决策的能力。这些工具不能保证这些代码是否可以安全地重构。我们的目标主要在于检测重构代码的可能性。为了确定代码克隆是否可以安全重构,采用了嵌套结构映射、语句映射和前提条件检查三种方法。为了重构代码,我们使用了一些技术,如上拉方法和下拉方法。在我们的方法中,我们尝试使用方法找到可重构的代码,并重构代码以消除代码克隆的问题。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
6212
×
引用
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学术文献互助群
群 号:481959085
Book学术官方微信