Do Bad Smells Lead to Defects?
Tarih
Yazarlar
Dergi Başlığı
Dergi ISSN
Cilt Başlığı
Yayıncı
Erişim Hakkı
Özet
Code that disregards fundamental sound design practices is said to 'smell.' While a code smell is not normally a bug, conventional wisdom suggests that it could lead to bugs when the software is later modified. This makes logical sense, but is there empirical evidence that supports this argument? If code smells can be shown to metastasize over time, are there some code smells that more virulent than others? We set out to address these questions by examining five popular Python open-source software projects to determine if recorded defects traced back to segments of code containing a smell. Our study focused on eight code smells: Large Class, Long Parameter List, Feature Envy, Parallel Inheritance Hierarchy, Data Class, Lazy Class, Refused Bequest, and Long Method. We analyzed GitHub change and defect logs for defects, then identified how the code as repaired. A smell was assumed to be the cause of the defect if changes resulted in removal of the smell. We counted the number of code smells in the project and used the ratio of the count of smells to the count of defects to quantify the influence of smells on defects. Our results indicate that the Long Parameter List code smell has the highest positive correlation, the Long Method and Large Class smells have a moderate correlation, and the Parallel Inheritance Hierarchy, Data Class, Lazy Class, Feature Envy and Refused Bequest smells have no significant correlation on the presence of defects. © 2023 IEEE.











