When Are Smells Indicators of Architectural Refactoring Opportunities? A Study of 50 Software Projects

L. Sousa, W. Oizumi, Alessandro F. Garcia, Anderson Oliveira, Diego Cedrim, C. Lucena
{"title":"When Are Smells Indicators of Architectural Refactoring Opportunities? A Study of 50 Software Projects","authors":"L. Sousa, W. Oizumi, Alessandro F. Garcia, Anderson Oliveira, Diego Cedrim, C. Lucena","doi":"10.1145/3387904.3389276","DOIUrl":null,"url":null,"abstract":"Refactoring is a widely adopted practice for improving code comprehension and for removing severe structural problems in a project. When refactorings affect the system architecture, they are called architectural refactorings. Unfortunately, developers usually do not know when and how they should apply refactorings to remove architectural problems. Nevertheless, they might be more susceptible to applying architectural refactoring if they rely on code smells and code refactoring - two concepts that they usually deal with through their routine programming activities. To investigate if smells can serve as indicators of architectural refactoring opportunities, we conducted a retrospective study over the commit history of 50 software projects. We analyzed 52,667 refactored elements to investigate if they had architectural problems that could have been indicated by automatically-detected smells. We considered purely structural refactorings to identify elements that were likely to have architectural problems. We found that the proportion of refactored elements without smells is much lower than those refactored with smells. By analyzing the latter, we concluded that smells can be used as indicators of architectural refactoring opportunities when the affected source code is deteriorated, i.e., the code hosting two or more smells. For example, when God Class or Complex Class appear together with other smells, they are indicators of architectural refactoring opportunities. In general, smells that often co-occurred with other smells (67.53%) are indicators of architectural refactoring opportunities in most cases (88.53% of refactored elements). Our study also enables us to derive a catalog with patterns of smells that indicate refactoring opportunities to remove specific types of architectural problems. These patterns can guide developers and make them more susceptible to apply architectural refactorings.","PeriodicalId":231095,"journal":{"name":"2020 IEEE/ACM 28th International Conference on Program Comprehension (ICPC)","volume":"97 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-07-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"10","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2020 IEEE/ACM 28th International Conference on Program Comprehension (ICPC)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3387904.3389276","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 10

Abstract

Refactoring is a widely adopted practice for improving code comprehension and for removing severe structural problems in a project. When refactorings affect the system architecture, they are called architectural refactorings. Unfortunately, developers usually do not know when and how they should apply refactorings to remove architectural problems. Nevertheless, they might be more susceptible to applying architectural refactoring if they rely on code smells and code refactoring - two concepts that they usually deal with through their routine programming activities. To investigate if smells can serve as indicators of architectural refactoring opportunities, we conducted a retrospective study over the commit history of 50 software projects. We analyzed 52,667 refactored elements to investigate if they had architectural problems that could have been indicated by automatically-detected smells. We considered purely structural refactorings to identify elements that were likely to have architectural problems. We found that the proportion of refactored elements without smells is much lower than those refactored with smells. By analyzing the latter, we concluded that smells can be used as indicators of architectural refactoring opportunities when the affected source code is deteriorated, i.e., the code hosting two or more smells. For example, when God Class or Complex Class appear together with other smells, they are indicators of architectural refactoring opportunities. In general, smells that often co-occurred with other smells (67.53%) are indicators of architectural refactoring opportunities in most cases (88.53% of refactored elements). Our study also enables us to derive a catalog with patterns of smells that indicate refactoring opportunities to remove specific types of architectural problems. These patterns can guide developers and make them more susceptible to apply architectural refactorings.
查看原文
分享 分享
微信好友 朋友圈 QQ好友 复制链接
本刊更多论文
什么时候气味是架构重构机会的指示器?50个软件项目的研究
重构是一种被广泛采用的实践,用于提高代码的可理解性和消除项目中严重的结构性问题。当重构影响系统架构时,它们被称为架构重构。不幸的是,开发人员通常不知道何时以及如何应用重构来消除架构问题。然而,如果他们依赖于代码气味和代码重构——这是他们通常通过日常编程活动处理的两个概念——他们可能更容易应用架构重构。为了研究气味是否可以作为架构重构机会的指示器,我们对50个软件项目的提交历史进行了回顾性研究。我们分析了52,667个重构元素,以调查它们是否存在可以通过自动检测到的气味指出的架构问题。我们考虑纯粹的结构重构来识别可能存在架构问题的元素。我们发现,没有气味的重构元素的比例远低于带有气味的重构元素。通过分析后者,我们得出结论,当受影响的源代码恶化时,气味可以作为架构重构机会的指示器,例如,代码包含两个或更多气味。例如,当God Class或Complex Class与其他气味一起出现时,它们是架构重构机会的指示器。一般来说,气味经常与其他气味(67.53%)同时出现,在大多数情况下(88.53%的重构元素)是架构重构机会的指示器。我们的研究还使我们能够获得带有气味模式的目录,这些气味模式指示重构机会,以消除特定类型的体系结构问题。这些模式可以指导开发人员,并使他们更容易应用架构重构。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 去求助
来源期刊
自引率
0.00%
发文量
0
期刊最新文献
On the Equivalence of Information Retrieval Methods for Automated Traceability Link Recovery: A Ten-Year Retrospective Program Comprehension in Virtual Reality How Does Incomplete Composite Refactoring Affect Internal Quality Attributes? A Literature Review of Automatic Traceability Links Recovery for Software Change Impact Analysis Inheritance software metrics on smart contracts
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
已复制链接
已复制链接
快去分享给好友吧!
我知道了
×
扫码分享
扫码分享
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1