Empirical study of the relationship between design patterns and code smells

被引:7
作者
Alfadel, Mahmoud [1 ]
Aljasser, Khalid [2 ]
Alshayeb, Mohammad [2 ]
机构
[1] Concordia Univ, Dept Comp Sci & Software Engn, Montreal, PQ, Canada
[2] King Fahd Univ Petr & Minerals, Informat & Comp Sci Dept, Dhahran, Saudi Arabia
来源
PLOS ONE | 2020年 / 15卷 / 04期
关键词
QUALITY; IMPACT; BAD;
D O I
10.1371/journal.pone.0231731
中图分类号
O [数理科学和化学]; P [天文学、地球科学]; Q [生物科学]; N [自然科学总论];
学科分类号
07 ; 0710 ; 09 ;
摘要
Software systems are often developed in such a way that good practices in the object-oriented paradigm are not met, causing the occurrence of specific disharmonies which are sometimes called code smells. Design patterns catalogue best practices for developing object-oriented software systems. Although code smells and design patterns are widely divergent, there might be a co-occurrence relation between them. The objective of this paper is to empirically evaluate if the presence of design patterns is related to the presence of code smells at different granularity levels. We performed an empirical study using 20 design patterns and 13 code smells in ten small-size to medium-size, open source Java-based systems. We applied statistical analysis and association rules. Results confirm that classes participating in design patterns have less smell-proneness and smell frequency than classes not participating in design patterns. We also noticed that every design pattern category act in the same way in terms of smell-proneness in the subject systems. However, we observed, based on the association rules learning and the proposed validation technique, that some patterns may be associated with certain smells in some cases. For instance, Command patterns can co-occur with God Class, Blob and External Duplication smell.
引用
收藏
页数:35
相关论文
共 86 条
[71]   An exploratory study on cooccurrence of design patterns and bad smells using software metrics [J].
Sousa, Bruno L. ;
Bigonha, Mariza A. S. ;
Ferreira, Kecia A. M. .
SOFTWARE-PRACTICE & EXPERIENCE, 2019, 49 (07) :1079-1113
[72]   Design pattern detection using similarity scoring [J].
Tsantalis, Nikolaos ;
Chatzigeorgiou, Alexander ;
Stephanides, George ;
Halkidis, Spyros T. .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2006, 32 (11) :896-909
[73]   Identification of Move Method Refactoring Opportunities [J].
Tsantalis, Nikolaos ;
Chatzigeorgiou, Alexander .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2009, 35 (03) :347-367
[74]   When and Why Your Code Starts to Smell Bad (and Whether the Smells Go Away) [J].
Tufano, Michele ;
Palomba, Fabio ;
Bavota, Gabriele ;
Oliveto, Rocco ;
Di Penta, Massimiliano ;
De Lucia, Andrea ;
Poshyvanyk, Denys .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2017, 43 (11) :1063-1088
[75]   Bad Smells in Software Product Lines: A Systematic Review [J].
Vale, Gustavo ;
Figueiredo, Eduardo ;
Abilio, Ramon ;
Costa, Heitor .
2014 EIGHTH BRAZILIAN SYMPOSIUM ON SOFTWARE COMPONENTS, ARCHITECTURES AND REUSE (SBCARS), 2014, :84-94
[76]   Defect frequency and design patterns:: An empirical study of industrial code [J].
Vokác, M .
IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2004, 30 (12) :904-917
[77]   A controlled experiment comparing the maintainability of programs designed with and without design patterns -: A replication in a real programming environment [J].
Vokác, M ;
Tichy, W ;
Sjoberg, DIK ;
Arisholm, E ;
Aldrin, M .
EMPIRICAL SOFTWARE ENGINEERING, 2004, 9 (03) :149-195
[78]  
Wagey BC, 2015, 2015 INTERNATIONAL CONFERENCE ON DATA AND SOFTWARE ENGINEERING (ICODSE), P25, DOI 10.1109/ICODSE.2015.7436966
[79]   The relationship between design patterns and code smells: An exploratory study [J].
Walter, Bartosz ;
Alkhaeir, Tarek .
INFORMATION AND SOFTWARE TECHNOLOGY, 2016, 74 :127-142
[80]  
Wendorff P, 2001, FIFTH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING, PROCEEDINGS, P77, DOI 10.1109/CSMR.2001.914971