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.
- Marwen Abbes, Foutse Khomh, Yann-Gael Gueheneuc, and Giuliano Antoniol. 2011. An empirical study of the impact of two antipatterns, blob and spaghetti code, on program comprehension. In Software maintenance and reengineering (CSMR), 2011 15th European conference on. IEEE, 181--190. Google ScholarDigital Library
- Mohammed Ghazi Al-Obeidallah, Miltos Petridis, and Stelios Kapetanakis. 2016. A survey on design pattern detection approaches. International Journal of Software Engineering (IJSE) 7, 3 (2016).Google Scholar
- Francesca Arcelli, Christian Tosi, Marco Zanoni, and Stefano Maggioni. 2008. The MARPLE project: A tool for design pattern detection and software architecture reconstruction. In 1st International Workshop on Academic Software Development Tools and Techniques (WASDeTT-1). 325--334.Google Scholar
- Bruno Cardoso and Eduardo Figueiredo. 2015. Co-occurrence of design patterns and bad smells in software systems: An exploratory study. In Proceedings of the annual conference on Brazilian symposium on information systems: Information systems: A computer socio-technical perspective. 347--354. Google ScholarDigital Library
- Francesca Arcelli Fontana, Jens Dietrich, Bartosz Walter, Aiko Yamashita, and Marco Zanoni. 2016. Antipattern and code smell false positives: Preliminary conceptualization and classification. In 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), Vol. 1. IEEE, 609--613.Google ScholarCross Ref
- Francesca Arcelli Fontana, Vincenzo Ferme, Alessandro Marino, Bartosz Walter, and Pawel Martenka. 2013. Investigating the impact of code smells on system's quality: An empirical study on systems of different application domains. In 2013 IEEE International Conference on Software Maintenance. IEEE, 260--269. Google ScholarDigital Library
- Francesca Arcelli Fontana and Marco Zanoni. 2011. A tool for design pattern detection and software architecture reconstruction. Information sciences 181, 7 (2011), 1306--1324. Google ScholarDigital Library
- Francesca Arcelli Fontana, Marco Zanoni, and Stefano Maggioni. 2011. Using Design Pattern Clues to Improve the Precision of Design Pattern Detection Tools. Journal of Object Technology 10, 4 (2011), 1--31.Google Scholar
- Martin Fowler and Kent Beck. 1999. Refactoring: improving the design of existing code. Addison-Wesley Professional. Google ScholarDigital Library
- Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. 1995. Design Patterns: Elements of Reusable Object-Oriented Software Addison-Wesley. Reading, MA (1995), 1995. Google ScholarDigital Library
- Robert B Grady. 1992. Practical software metrics for project management and process improvement. Prentice-Hall, Inc. Google ScholarDigital Library
- Fehmi Jaafar, Yann-Gaël Guéhéneuc, Sylvie Hamel, et al. 2013. Analysing antipatterns static relationships with design patterns. Electronic Communications of the EASST 59 (2013).Google Scholar
- Fehmi Jaafar, Yann-Gaël Guéhéneuc, Sylvie Hamel, and Foutse Khomh. 2013. Mining the relationship between anti-patterns dependencies and fault-proneness. In 2013 20th Working Conference on Reverse Engineering (WCRE). IEEE, 351--360.Google ScholarCross Ref
- Foutse Khomh, Massimiliano Di Penta, Yann-Gaël Guéhéneuc, and Giuliano Antoniol. 2012. An exploratory study of the impact of antipatterns on class change-and fault-proneness. Empirical Software Engineering 17, 3 (2012), 243--275. Google ScholarDigital Library
- Michele Lanza and Radu Marinescu. 2007. Object-oriented metrics in practice: using software metrics to characterize, evaluate, and improve the design of object-oriented systems. Springer Science & Business Media.Google Scholar
- Radu Marinescu. 2004. Detection strategies: Metrics-based rules for detecting design flaws. In Software Maintenance, 2004. Proceedings. 20th IEEE International Conference on. IEEE, 350--359. Google ScholarDigital Library
- Willian Oizumi, Alessandro Garcia, Leonardo da Silva Sousa, Bruno Cafeo, and Yixue Zhao. 2016. Code anomalies flock together: Exploring code anomaly agglomerations for locating design problems. In Software Engineering (ICSE), 2016 IEEE/ACM 38th International Conference on. IEEE, 440--451. Google ScholarDigital Library
- Zéphyrin Soh, Aiko Yamashita, Foutse Khomh, and Yann-Gaël Guéhéneuc. 2016. Do code smells impact the effort of different maintenance programming activities?. In 2016 IEEE 23rd International Conference on Software Analysis, Evolution, and Reengineering (SANER), Vol. 1. IEEE, 393--402.Google ScholarCross Ref
- Bruno L Sousa, Mariza AS Bigonha, and Kecia Ferreira. 2017. Evaluating Co-Ocorrence of GOF Design Patterns with God Class and Long Method Bad Smells. In XIII Brazilian Symposium on Information Systems (SBSI), Vol. 396.Google Scholar
- Bruno L Sousa, Mariza AS Bigonha, and Kecia AM Ferreira. 2018. A systematic literature mapping on the relationship between design patterns and bad smells. In Proceedings of the 33rd Annual ACM Symposium on Applied Computing. ACM, 1528--1535. Google ScholarDigital Library
- Ewan Tempero, Craig Anslow, Jens Dietrich, Ted Han, Jing Li, Markus Lumpe, Hayden Melton, and James Noble. 2010. The Qualitas Corpus: A curated collection of Java code for empirical studies. In 2010 Asia Pacific Software Engineering Conference. IEEE, 336--345. Google ScholarDigital Library
- Ricardo Terra, Luis Fernando Miranda, Marco Tulio Valente, and Roberto S Bigonha. 2013. Qualitas. class Corpus: A compiled version of the Qualitas Corpus. ACM SIGSOFT Software Engineering Notes 38, 5 (2013), 1--4. Google ScholarDigital Library
- Nikolaos Tsantalis, Alexander Chatzigeorgiou, George Stephanides, and Spyros T Halkidis. 2006. Design pattern detection using similarity scoring. IEEE transactions on software engineering 32, 11 (2006). Google ScholarDigital Library
- Arie Van Deursen, Leon Moonen, Alex Van Den Bergh, and Gerard Kok. {n. d.}. Refactoring test code.Google Scholar
- Santiago A. Vidal, Hernán Ceferino Vázquez, Jorge Andrés Díaz Pace, Claudia Marcos, Alessandro F. Garcia, and Willian Nalepa Oizumi. 2015. JSpIRIT: a flexible tool for the analysis of code smells. 2015 34th International Conference of the Chilean Computer Science Society (SCCC) (2015), 1--6.Google ScholarCross Ref
- Bartosz Walter and Tarek Alkhaeir. 2016. The relationship between design patterns and code smells: An exploratory study. Information and Software Technology 74 (2016), 127--142. Google ScholarDigital Library
- Aiko Yamashita and Leon Moonen. 2013. Exploring the impact of inter-smell relations on software maintainability: An empirical study. In Proceedings of the 2013 International Conference on Software Engineering. IEEE Press, 682--691. Google ScholarDigital Library
Index Terms
- Incidence of code smells in the application of design patterns: a method-level analysis
Recommendations
The relationship between design patterns and code smells
Context-Design patterns represent recommended generic solutions to various design problems, whereas code smells are symptoms of design issues that could hinder further maintenance of a software system. We can intuitively expect that both concepts are ...
Are architectural smells independent from code smells? An empirical study
Highlights- Case study analyzing the correlations among code smells, groups of code smells and architectural smells.
AbstractBackground. Architectural smells and code smells are symptoms of bad code or design that can cause different quality problems, such as faults, technical debt, or difficulties with maintenance and evolution. Some studies ...
An interactive ambient visualization for code smells
SOFTVIS '10: Proceedings of the 5th international symposium on Software visualizationCode smells are characteristics of software that indicate that code may have a design problem. Code smells have been proposed as a way for programmers to recognize the need for restructuring their software. Because code smells can go unnoticed while ...
Comments