Empirical study of the relationship between design patterns and code smells

被引:6
作者
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 条
  • [1] An Empirical Study of the Impact of Two Antipatterns, Blob and Spaghetti Code, On Program Comprehension
    Abbes, Marwen
    Khomh, Foutse
    Gueheneuc, Yann-Gael
    Antoniol, Giuliano
    [J]. 2011 15TH EUROPEAN CONFERENCE ON SOFTWARE MAINTENANCE AND REENGINEERING (CSMR), 2011, : 181 - 190
  • [2] Agrawal R., 1993, SIGMOD Record, V22, P207, DOI 10.1145/170036.170072
  • [3] AL-Fadel M., 2017, THESIS
  • [5] Ampatzoglou Apostolos, 2011, P 15 INT ACAD MINDTR, P214, DOI [10.1145/2181037.2181074, DOI 10.1145/2181037.2181074]
  • [6] [Anonymous], 2010, 2010 IEEE International Conference on Software Maintenance, DOI DOI 10.1109/ICSM.2010.5609564
  • [7] [Anonymous], 2016, INFUSION
  • [8] [Anonymous], 2009, EXPLORATORY STUDY IM
  • [9] Aversano Lerina., 2007, Proceedings of the 6th Joint Meeting of the European Software Engineering Conference and the ACM SIGSOFT Symposium on the Foundations of Software Engineering, ESEC-FSE '07, P385, DOI [DOI 10.1145/1287624.1287680, 10.1145/1287624.1287680.]
  • [10] Beck DJS, 1996, INEC SER, P103, DOI 10.1109/ICSE.1996.493406