Look Ahead! Revealing Complete Composite Refactorings and their Smelliness Effects

Ana Carla Bibiano, W. K. Assunção, Daniel Coutinho, Kleber Santos, Vinícius Soares, Rohit Gheyi, Alessandro F. Garcia, B. Neto, Márcio Ribeiro, Daniel Oliveira, Caio Barbosa, João Lucas Marques, Anderson Oliveira
{"title":"Look Ahead! Revealing Complete Composite Refactorings and their Smelliness Effects","authors":"Ana Carla Bibiano, W. K. Assunção, Daniel Coutinho, Kleber Santos, Vinícius Soares, Rohit Gheyi, Alessandro F. Garcia, B. Neto, Márcio Ribeiro, Daniel Oliveira, Caio Barbosa, João Lucas Marques, Anderson Oliveira","doi":"10.1109/ICSME52107.2021.00033","DOIUrl":null,"url":null,"abstract":"Recent studies have revealed that developers often apply composite refactorings (or, simply, composites). A composite consists of two or more interrelated refactorings applied together. Previous studies investigated the effect of composites on code smells. A composite is considered “complete” whenever it completely removes one target code smell. They proposed descriptions of complete composites with recommendations to remove certain code smell types, such as Long Methods and Feature Envies. These studies also present different recommendations to remove the same code smell type. However, these studies: (i) are limited to composites only consisting of a small subset of Fowler's refactoring types, (ii) do not detail the scenarios in which each recommendation can be applied to remove the code smell, and (iii) fail in reporting possible side effects of the described composites, such as adversely introducing certain smell types. This paper aims to cover these limitations by performing a systematic analysis of 618 complete composites on removing four common smell types identified in 20 software projects. Our results indicated that: (i) 64% complete composites consisted of refactoring types not covered by existing descriptions of complete composites, and (ii) 36% complete composites formed by Extract Methods can introduce Feature Envies and Intensive Couplings. This information is not documented by existing descriptions, and it can alert developers about alternatives to remove Feature Envy, mainly in methods that are fully envious. These results suggest existing descriptions of complete composites should be either revisited or enhanced to explicitly highlight known side effects. We present a catalog of composites with details about side effects, recommendations to remove or minimize them, and some scenarios in which each recommendation can be applied to remove the code smell. Our catalog can be useful to improve existing tooling support for refactorings, such as IDEs, informing about possible side effects when refactorings are composed.","PeriodicalId":205629,"journal":{"name":"2021 IEEE International Conference on Software Maintenance and Evolution (ICSME)","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"5","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2021 IEEE International Conference on Software Maintenance and Evolution (ICSME)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICSME52107.2021.00033","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 5

Abstract

Recent studies have revealed that developers often apply composite refactorings (or, simply, composites). A composite consists of two or more interrelated refactorings applied together. Previous studies investigated the effect of composites on code smells. A composite is considered “complete” whenever it completely removes one target code smell. They proposed descriptions of complete composites with recommendations to remove certain code smell types, such as Long Methods and Feature Envies. These studies also present different recommendations to remove the same code smell type. However, these studies: (i) are limited to composites only consisting of a small subset of Fowler's refactoring types, (ii) do not detail the scenarios in which each recommendation can be applied to remove the code smell, and (iii) fail in reporting possible side effects of the described composites, such as adversely introducing certain smell types. This paper aims to cover these limitations by performing a systematic analysis of 618 complete composites on removing four common smell types identified in 20 software projects. Our results indicated that: (i) 64% complete composites consisted of refactoring types not covered by existing descriptions of complete composites, and (ii) 36% complete composites formed by Extract Methods can introduce Feature Envies and Intensive Couplings. This information is not documented by existing descriptions, and it can alert developers about alternatives to remove Feature Envy, mainly in methods that are fully envious. These results suggest existing descriptions of complete composites should be either revisited or enhanced to explicitly highlight known side effects. We present a catalog of composites with details about side effects, recommendations to remove or minimize them, and some scenarios in which each recommendation can be applied to remove the code smell. Our catalog can be useful to improve existing tooling support for refactorings, such as IDEs, informing about possible side effects when refactorings are composed.
向前看!揭示完全复合重构及其气味效应
最近的研究表明,开发人员经常应用复合重构(或者简单地说,复合)。复合由两个或多个相互关联的重构组合而成。之前的研究调查了复合材料对代码气味的影响。只要一个组合完全消除了一个目标代码气味,它就被认为是“完整的”。他们提出了完整组合的描述,并建议删除某些代码气味类型,如长方法和特征羡慕。这些研究还提出了消除相同代码气味类型的不同建议。然而,这些研究:(i)仅限于仅由Fowler重构类型的一小部分组成的组合,(ii)没有详细说明每种建议可以应用于去除代码气味的场景,以及(iii)未能报告所描述的组合可能的副作用,例如不利地引入某些气味类型。本文旨在通过对618个完整的复合材料进行系统分析,以消除20个软件项目中识别的四种常见气味类型,从而涵盖这些限制。研究结果表明:(1)64%的完整复合包含现有完整复合描述未涵盖的重构类型;(2)36%的提取方法形成的完整复合引入了特征羡慕和密集耦合。现有的描述中没有记录这些信息,它可以提醒开发人员关于删除功能羡慕的替代方法,主要是在完全羡慕的方法中。这些结果表明,现有的完整复合材料的描述应该重新审视或加强,以明确强调已知的副作用。我们提供了一个组合的目录,其中包含有关副作用的详细信息,删除或最小化它们的建议,以及可以应用每种建议来删除代码气味的一些场景。我们的目录有助于改进现有的重构工具支持,比如ide,在构建重构时通知可能的副作用。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术官方微信