Some code smells have a significant but small effect on faults

Hall, Tracy and Bowes, David and Sun, Yi and Zhang, Min (2014) Some code smells have a significant but small effect on faults. ACM Transactions on Software Engineering and Methodology, 23 (4): 33. ISSN 1049-331X

[thumbnail of Tosem code smells]
Preview
PDF (Tosem code smells)
Tosem_code_smells.pdf - Accepted Version
Available under License Creative Commons Attribution-NonCommercial.

Download (759kB)

Abstract

We investigate the relationship between faults and five of Fowler et al.'s least-studied smells in code: Data Clumps, Switch Statements, Speculative Generality, Message Chains, and Middle Man. We developed a tool to detect these five smells in three open-source systems: Eclipse, ArgoUML, and Apache Commons. We collected fault data from the change and fault repositories of each system. We built Negative Binomial regression models to analyse the relationships between smells and faults and report the McFadden effect size of those relationships. Our results suggest that Switch Statements had no effect on faults in any of the three systems; Message Chains increased faults in two systems; Message Chains which occurred in larger files reduced faults; Data Clumps reduced faults in Apache and Eclipse but increased faults in ArgoUML; Middle Man reduced faults only in ArgoUML, and Speculative Generality reduced faults only in Eclipse. File size alone affects faults in some systems but not in all systems. Where smells did significantly affect faults, the size of that effect was small (always under 10 percent). Our findings suggest that some smells do indicate fault-prone code in some circumstances but that the effect that these smells have on faults is small. Our findings also show that smells have different effects on different systems. We conclude that arbitrary refactoring is unlikely to significantly reduce fault-proneness and in some cases may increase fault-proneness.

Item Type:
Journal Article
Journal or Publication Title:
ACM Transactions on Software Engineering and Methodology
Additional Information:
© ACM, 2014. This is the author's version of the work. It is posted here for your personal use. Not for redistribution. The definitive Version of Record was published in ACM Transactions on Software Engineering and Methodology (TOSEM) - Special Issue International Conference on Software Engineering (ICSE 2012) and Regular Papers TOSEM http://dx.doi.org/10.1145/2629648
Uncontrolled Keywords:
/dk/atira/pure/subjectarea/asjc/1700/1712
Subjects:
?? defectssoftware code smellssoftware ??
ID Code:
127419
Deposited By:
Deposited On:
11 Sep 2018 13:42
Refereed?:
Yes
Published?:
Published
Last Modified:
21 Sep 2024 00:52