Incidence of code smells in the application of design patterns: a method-level analysis
Abstract
Design patterns are reusable solutions that can be applied to solve specific problems in software design. Such patterns can be misapplied, though, and give rise to code smells, i.e., fragments in the code that indicate possible design flaws. In this study, we aim to understand how often code smells co-occur with design patterns, as well as to determine the most common co-occurrences. To this end, we identified instances of code smells and design patterns in methods of 25 open source Java projects, by using automated detection tools. We also manually inspected fragments of the projects' source code to gather insight on the relationship between specific pairs of smells and patterns. Among other findings, we found that methods that are part of the Adapter pattern are more likely to contain code smells, especially the Feature Envy smell, although it can be argued that the detection of this smell in this context is a false positive.
Keywords:
Code Smells, Design Patterns, Software Design
Published
2019-09-23
How to Cite
ASSUNÇÃO, Ederson; SOUZA, Rodrigo.
Incidence of code smells in the application of design patterns: a method-level analysis. In: BRAZILIAN SYMPOSIUM ON SOFTWARE COMPONENTS, ARCHITECTURES, AND REUSE (SBCARS), 13. , 2019, Salvador/BA.
Anais [...].
Porto Alegre: Sociedade Brasileira de Computação,
2019
.
p. 73–82.
