Cargando…
Empirical study of the relationship between design patterns and code smells
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. Althou...
Autores principales: | , , |
---|---|
Formato: | Online Artículo Texto |
Lenguaje: | English |
Publicado: |
Public Library of Science
2020
|
Materias: | |
Acceso en línea: | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7162509/ https://www.ncbi.nlm.nih.gov/pubmed/32298360 http://dx.doi.org/10.1371/journal.pone.0231731 |
_version_ | 1783523046485655552 |
---|---|
author | Alfadel, Mahmoud Aljasser, Khalid Alshayeb, Mohammad |
author_facet | Alfadel, Mahmoud Aljasser, Khalid Alshayeb, Mohammad |
author_sort | Alfadel, Mahmoud |
collection | PubMed |
description | 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. |
format | Online Article Text |
id | pubmed-7162509 |
institution | National Center for Biotechnology Information |
language | English |
publishDate | 2020 |
publisher | Public Library of Science |
record_format | MEDLINE/PubMed |
spelling | pubmed-71625092020-04-21 Empirical study of the relationship between design patterns and code smells Alfadel, Mahmoud Aljasser, Khalid Alshayeb, Mohammad PLoS One Research Article 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. Public Library of Science 2020-04-16 /pmc/articles/PMC7162509/ /pubmed/32298360 http://dx.doi.org/10.1371/journal.pone.0231731 Text en © 2020 Alfadel et al http://creativecommons.org/licenses/by/4.0/ This is an open access article distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/4.0/) , which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited. |
spellingShingle | Research Article Alfadel, Mahmoud Aljasser, Khalid Alshayeb, Mohammad Empirical study of the relationship between design patterns and code smells |
title | Empirical study of the relationship between design patterns and code smells |
title_full | Empirical study of the relationship between design patterns and code smells |
title_fullStr | Empirical study of the relationship between design patterns and code smells |
title_full_unstemmed | Empirical study of the relationship between design patterns and code smells |
title_short | Empirical study of the relationship between design patterns and code smells |
title_sort | empirical study of the relationship between design patterns and code smells |
topic | Research Article |
url | https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7162509/ https://www.ncbi.nlm.nih.gov/pubmed/32298360 http://dx.doi.org/10.1371/journal.pone.0231731 |
work_keys_str_mv | AT alfadelmahmoud empiricalstudyoftherelationshipbetweendesignpatternsandcodesmells AT aljasserkhalid empiricalstudyoftherelationshipbetweendesignpatternsandcodesmells AT alshayebmohammad empiricalstudyoftherelationshipbetweendesignpatternsandcodesmells |