AuthorsD. I. K. Sjøberg, A. Yamashita, B. C. D. Anda, A. Mockus and T. Dybå
TitleQuantifying the Effect of Code Smells on Maintenance Effort
AfilliationSoftware Engineering, Software Engineering
StatusPublished
Publication TypeJournal Article
Year of Publication2012
JournalIEEE Transactions on Software Engineering
Volume39
Number8
Pagination1144-1156
Abstract

Context: Code smells are assumed to indicate bad design that leads to less maintainable code. However, this assumption has not been investigated in controlled studies with professional software developers. Aim: Our aim was to investigate the relationship between code smells and maintenance effort. Method: Six developers were hired to perform three maintenance tasks each on four functionally equivalent Java systems originally implemented by different companies. Each developer spent three to four weeks. In total, they modified 298 Java files in the four systems. An Eclipse IDE plug-in measured the exact amount of time a developer spent maintaining each file. A regression was used to explain the effort using file properties, including the number of smells. Results: None of the 12 investigated smells was significantly associated with increased effort after we adjusted for file size and the number of changes; Refused Bequest was significantly associated with decreased effort. File size and the number of changes explained most of the variation in effort. Conclusion: The effects of code smells on maintenance effort are limited. In general, to reduce maintenance effort, focusing on code size and the work practices that limit the number of changes may be more beneficial than refactoring code smells.

DOI10.1109/TSE.2012.89
Citation KeySimula.simula.1460