Are all code smells harmful? A study of God Classes and Brain Classes in the evolution of three open source systems

Steffen M. Olbrich, D. Cruzes, Dag I.K. Sjøberg
{"title":"Are all code smells harmful? A study of God Classes and Brain Classes in the evolution of three open source systems","authors":"Steffen M. Olbrich, D. Cruzes, Dag I.K. Sjøberg","doi":"10.1109/ICSM.2010.5609564","DOIUrl":null,"url":null,"abstract":"Code smells are particular patterns in object-oriented systems that are perceived to lead to difficulties in the maintenance of such systems. It is held that to improve maintainability, code smells should be eliminated by refactoring. It is claimed that classes that are involved in certain code smells are liable to be changed more frequently and have more defects than other classes in the code. We investigated the extent to which this claim is true for God Classes and Brain Classes, with and without normalizing the effects with respect to the class size. We analyzed historical data from 7 to 10 years of the development of three open-source software systems. The results show that God and Brain Classes were changed more frequently and contained more defects than other kinds of class. However, when we normalized the measured effects with respect to size, then God and Brain Classes were less subject to change and had fewer defects than other classes. Hence, under the assumption that God and Brain Classes contain on average as much functionality per line of code as other classes, the presence of God and Brain Classes is not necessarily harmful; in fact, such classes may be an efficient way of organizing code.","PeriodicalId":101801,"journal":{"name":"2010 IEEE International Conference on Software Maintenance","volume":"28 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2010-09-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"210","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2010 IEEE International Conference on Software Maintenance","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICSM.2010.5609564","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 210

Abstract

Code smells are particular patterns in object-oriented systems that are perceived to lead to difficulties in the maintenance of such systems. It is held that to improve maintainability, code smells should be eliminated by refactoring. It is claimed that classes that are involved in certain code smells are liable to be changed more frequently and have more defects than other classes in the code. We investigated the extent to which this claim is true for God Classes and Brain Classes, with and without normalizing the effects with respect to the class size. We analyzed historical data from 7 to 10 years of the development of three open-source software systems. The results show that God and Brain Classes were changed more frequently and contained more defects than other kinds of class. However, when we normalized the measured effects with respect to size, then God and Brain Classes were less subject to change and had fewer defects than other classes. Hence, under the assumption that God and Brain Classes contain on average as much functionality per line of code as other classes, the presence of God and Brain Classes is not necessarily harmful; in fact, such classes may be an efficient way of organizing code.
所有的代码气味都有害吗?三个开源系统演化中的上帝类和大脑类研究
代码气味是面向对象系统中的特定模式,它被认为会导致系统维护方面的困难。人们认为,为了提高可维护性,应该通过重构来消除代码气味。据称,与代码中的其他类相比,涉及特定代码气味的类更容易被频繁更改,并且具有更多缺陷。我们调查了这种说法在多大程度上适用于上帝类和大脑类,以及是否对班级规模的影响进行了正常化。我们分析了三个开源软件系统7到10年的历史数据。结果表明,与其他类别相比,上帝类和大脑类的变化更频繁,缺陷也更多。然而,当我们根据大小将测量的效果标准化后,上帝类和大脑类比其他类更不容易改变,缺陷也更少。因此,假设God和Brain类每行代码包含的平均功能与其他类一样多,那么God和Brain类的存在并不一定是有害的;事实上,这样的类可能是组织代码的一种有效方式。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约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学术文献互助群
群 号:481959085
Book学术官方微信