skip to main content
10.1145/3357141.3357143acmotherconferencesArticle/Chapter ViewAbstractPublication PagessbcarsConference Proceedingsconference-collections
research-article

Incidence of code smells in the application of design patterns: a method-level analysis

Published:23 September 2019Publication History

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.

References

  1. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  2. 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 ScholarGoogle Scholar
  3. 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 ScholarGoogle Scholar
  4. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  5. 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 ScholarGoogle ScholarCross RefCross Ref
  6. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  7. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  8. 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 ScholarGoogle Scholar
  9. Martin Fowler and Kent Beck. 1999. Refactoring: improving the design of existing code. Addison-Wesley Professional. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  11. Robert B Grady. 1992. Practical software metrics for project management and process improvement. Prentice-Hall, Inc. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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 ScholarGoogle Scholar
  13. 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 ScholarGoogle ScholarCross RefCross Ref
  14. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  15. 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 ScholarGoogle Scholar
  16. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  18. 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 ScholarGoogle ScholarCross RefCross Ref
  19. 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 ScholarGoogle Scholar
  20. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  21. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  22. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  23. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  24. Arie Van Deursen, Leon Moonen, Alex Van Den Bergh, and Gerard Kok. {n. d.}. Refactoring test code.Google ScholarGoogle Scholar
  25. 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 ScholarGoogle ScholarCross RefCross Ref
  26. 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 ScholarGoogle ScholarDigital LibraryDigital Library
  27. 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 ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Incidence of code smells in the application of design patterns: a method-level analysis

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Other conferences
      SBCARS '19: Proceedings of the XIII Brazilian Symposium on Software Components, Architectures, and Reuse
      September 2019
      145 pages
      ISBN:9781450376372
      DOI:10.1145/3357141

      Copyright © 2019 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 23 September 2019

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article
      • Research
      • Refereed limited

      Acceptance Rates

      Overall Acceptance Rate23of79submissions,29%
    • Article Metrics

      • Downloads (Last 12 months)11
      • Downloads (Last 6 weeks)0

      Other Metrics

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader