Quantifying the Effect of Code Smells on Maintenance Effort

被引:222
作者
Sjoberg, Dag I. K. [1 ]
Yamashita, Aiko [1 ]
Anda, Bente C. D. [1 ]
Mockus, Audris [2 ]
Dyba, Tore [3 ]
机构
[1] Univ Oslo, Dept Informat, NO-0316 Oslo, Norway
[2] Avaya Labs Res, Basking Ridge, NJ 07920 USA
[3] Univ Oslo, Dept Informat, N-0316 Oslo, Norway
关键词
Maintainability; object-oriented design; product metrics; code churn; BAD SMELLS; SOFTWARE; SKILL;
D O I
10.1109/TSE.2012.89
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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: This paper investigates 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. Regression analysis was used to explain the effort using file properties, including the number of smells. Result: 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 almost all of the modeled variation in effort. Conclusion: The effects of the 12 smells on maintenance effort were limited. To reduce maintenance effort, a focus on reducing code size and the work practices that limit the number of changes may be more beneficial than refactoring code smells.
引用
收藏
页码:1144 / 1156
页数:13
相关论文
共 42 条
[1]   An Empirical Study of the Impact of Two Antipatterns, Blob and Spaghetti Code, On Program Comprehension [J].
Abbes, Marwen ;
Khomh, Foutse ;
Gueheneuc, Yann-Gael ;
Antoniol, Giuliano .
2011 15TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING (CSMR), 2011, :181-190
[2]  
Anda Bente, 2007, 2007 IEEE International Conference on Software Maintenance, P204, DOI 10.1109/ICSM.2007.4362633
[3]   Variability and Reproducibility in Software Engineering: A Study of Four Companies that Developed the Same System [J].
Anda, Bente C. D. ;
Sjoberg, Dag I. K. ;
Mockus, Audris .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2009, 35 (03) :407-429
[4]  
[Anonymous], 2008, BORL TOG
[5]  
[Anonymous], 2010, 2010 IEEE International Conference on Software Maintenance, DOI [10.1109/ICSM.2010.5609564, DOI 10.1109/ICSM.2010.5609564]
[6]   Towards a framework for empirical assessment of changeability decay [J].
Arisholm, E ;
Sjoberg, DIK .
JOURNAL OF SYSTEMS AND SOFTWARE, 2000, 53 (01) :3-14
[7]   Evaluating the effect of a delegated versus centralized control style on the maintainability of object-oriented software [J].
Arisholm, E ;
Sjoberg, DIK .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2004, 30 (08) :521-534
[8]   Inferring Skill from Tests of Programming Performance: Combining Time and Quality [J].
Bergersen, Gunnar R. ;
Hannay, Jo E. ;
Sjoberg, Dag I. K. ;
Dyba, Tore ;
Karahasanovic, Amela .
2011 FIFTH INTERNATIONAL SYMPOSIUM ON EMPIRICAL SOFTWARE ENGINEERING AND MEASUREMENT (ESEM 2011), 2011, :305-314
[9]   Programming Skill, Knowledge, and Working Memory Among Professional Software Developers from an Investment Theory Perspective [J].
Bergersen, Gunnar Rye ;
Gustafsson, Jan-Eric .
JOURNAL OF INDIVIDUAL DIFFERENCES, 2011, 32 (04) :201-209
[10]  
D'Ambros Marco, 2010, Proceedings of the Tenth International Conference on Quality Software (QSIC 2010), P23, DOI 10.1109/QSIC.2010.58