Abstract

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.

Highlights

  • Design patterns (DP), are recurring solutions to common software design problems

  • Inspired by the study of Walter and Alkhaeir [24], we focus on the occurrence of code bad smells in code fragments that are part of design patterns, where more systems, design patterns, and code smells are analyzed

  • The results indicate that the presence of DPs is not strongly associated with code smells, i.e., classes that participate in design patterns most likely are not smelly classes

Read more

Summary

Introduction

Design patterns (DP), are recurring solutions to common software design problems. DPs can ease communication among team members by using terminology instead of using traditional explanations [2]. Gamma et al [3] identified 23 design patterns which can be divided into three categories: creational, structural and behavioral. Creational design patterns are those that deal with creating objects so that the created objects serve a purpose that is suitable to the situation. Structural design patterns are design techniques that facilitate software design by identifying simple ways to realize relationships among the different entities. Design patterns or design motifs refer to several classes of different roles. Each design motif plays role in source code [4].

Objectives
Methods
Discussion
Conclusion
Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.