skip to main content
10.1145/3422392.3422419acmotherconferencesArticle/Chapter ViewAbstractPublication PagessbesConference Proceedingsconference-collections
research-article

Are Code Smell Co-occurrences Harmful to Internal Quality Attributes?: A Mixed-Method Study

Published:21 December 2020Publication History

ABSTRACT

Previous studies demonstrated how code smells (i.e., symptoms of the presence of system degradation) impact the software maintainability. However, few studies have investigated which code smell types tend to co-occur in the source code. Moreover, it is not clear to what extent the removal of code smell co-occurrences -through refactoring operations - has a positive impact on quality attributes such as cohesion, coupling, inheritance, complexity, and size. We aim at addressing these gaps through an empirical study. By investigating the impact of the smells co-occurrences in 11 releases of 3 closed-source systems, we observe (i) which code smells tend to co-occur together, (ii) the impact of the removal of code smell co-occurrences on quality internal attributes before and after refactoring, and (iii) which are the most difficult co-occurrences to refactoring from the developers' perspective. Our results show that 2 types of code smell co-occurrences generally tend to co-occur. Moreover, we observed that the removal of code smells co-occurrences lead to a significant reduction in the complexity of the systems studied was obtained. Conversely, cohesion and coupling tend to get worse. We also found that two code smells cooccurrences (God Class-Long Method and Disperse Coupling-Long Method) as the most difficult to refactor indicating that attention is needed not to insert these anomalies in the source code. Based on our findings, we argue that further research is needed on the impact of code smells co-occurrences on internal quality attributes.

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 15th CSMR. IEEE, 181--190.Google ScholarGoogle Scholar
  2. Jehad Al Dallal. 2013. Object-oriented class maintainability prediction using internal quality attributes. Inf. Softw. Technol. 55, 11 (2013), 2028--2048.Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Rafa E Al-Qutaish. 2010. Quality models in software engineering literature: an analytical and comparative study. Journal of American Science 6, 3 (2010), 166--175.Google ScholarGoogle Scholar
  4. Mamdouh Alenezi and Khaled Almustafa. 2015. Empirical analysis of the complexity evolution in open-source software systems. International Journal of Hybrid Information Technology 8, 2 (2015), 257--266.Google ScholarGoogle ScholarCross RefCross Ref
  5. Ajay Bandi, Byron J Williams, and Edward B Allen. 2013. Empirical evidence of code decay: A systematic mapping study. In 2013 20th Working Conference on Reverse Engineering (WCRE). IEEE, 341--350.Google ScholarGoogle ScholarCross RefCross Ref
  6. James M Bieman and Byung-Kyoo Kang. 1995. Cohesion and reuse in an object-oriented system. ACM SIGSOFT Software Engineering Notes 20, SI (1995), 259--262.Google ScholarGoogle Scholar
  7. Alexander Chávez, Isabella Ferreira, Eduardo Fernandes, Diego Cedrim, and Alessandro Garcia. 2017. How does refactoring affect internal quality attributes?: A multi-project study. In 31st SBES. ACM, 74--83.Google ScholarGoogle Scholar
  8. Shyam R Chidamber and Chris F Kemerer. 1994. A metrics suite for object oriented design. IEEE Trans. Softw. Eng. 20, 6 (1994), 476--493.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Istehad Chowdhury and Mohammad Zulkernine. 2010. Can complexity, coupling, and cohesion metrics be used as early indicators of vulnerabilities?. In Proceedings of the 2010 ACM Symposium on Applied Computing. ACM, 1963--1969.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. David P Darcy, Chris F Kemerer, Sandra A Slaughter, and James E Tomayko. 2005. The structural complexity of software an experimental test. IEEE Trans. Softw. Eng. 31, 11 (2005), 982--995.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Rafael de Mello, Anderson Uchôa, Roberto Oliveira, Willian Oizumi, Jairo Souza, Kleyson Mendes, Daniel Oliveira, Baldoino Fonseca, and Alessandro Garcia. 2019. Do Research and Practice of Code Smell Identification Walk Together? A Social Representations Analysis. In 13th ESEM. 1--6.Google ScholarGoogle Scholar
  12. Elder Vicente de Paulo Sobrinho, Andrea De Lucia, and Marcelo de Almeida Maia. 2018. A systematic literature review on bad smells---5 W's: which, when, what, who, where. IEEE Trans. Softw. Eng. (2018).Google ScholarGoogle Scholar
  13. Giuseppe Destefanis, Steve Counsell, Giulio Concas, and Roberto Tonelli. 2014. Software metrics in agile software: An empirical study. In International Conference on Agile Software Development. Springer, 157--170.Google ScholarGoogle ScholarCross RefCross Ref
  14. Robert Dyer, Hridesh Rajan, and Yuanfang Cai. 2012. An exploratory study of the design impact of language features for aspect-oriented interfaces. In 11th AOSD. ACM, 143--154.Google ScholarGoogle Scholar
  15. Eduardo Fernandes, Alexander Chávez, Alessandro Garcia, Isabella Ferreira, Diego Cedrim, Leonardo Sousa, and Willian Oizumi. 2020. Refactoring Effect on Internal Quality Attributes: What Haven't They Told You Yet? Inf. Softw. Technol. (2020), 106347.Google ScholarGoogle Scholar
  16. Eduardo Fernandes, Johnatan Oliveira, Gustavo Vale, Thanis Paiva, and Eduardo Figueiredo. 2016. A review-based comparative study of bad smell detection tools. In 20th EASE. ACM, 18.Google ScholarGoogle Scholar
  17. Eduardo Fernandes, Gustavo Vale, Leonardo Sousa, Eduardo Figueiredo, Alessandro Garcia, and Jaejoon Lee. 2017. No Code Anomaly is an Island. In 16th ICSR. Springer, 48--64.Google ScholarGoogle Scholar
  18. Francesca Arcelli Fontana, Vincenzo Ferme, and Marco Zanoni. 2015. Towards assessing software architecture quality by exploiting code smell relations. In 2015 IEEE/ACM 2nd International Workshop on Software Architecture and Metrics. IEEE, 1--7.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Francesca Arcelli Fontana, Valentina Lenarduzzi, Riccardo Roveda, and Davide Taibi.2019. Are architectural smells independent from code smells? An empirical study. J. Syst. Softw. 154 (2019), 139--156.Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Martin Fowler. 2018. Refactoring: improving the design of existing code. Addison-Wesley Professional.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. ISO. 2011. IEC 25010: 2011 systems and software engineering-systems and software quality requirements and evaluation (square)-system and software quality models. International Organization for Standardization 34 (2011), 2910.Google ScholarGoogle Scholar
  22. Fehmi Jaafar, Angela Lozano, Yann-Gaël Guéhéneuc, and Kim Mens. 2017. On the analysis of co-occurrence of anti-patterns and clones. In 2017 IEEE International Conference on Software Quality, Reliability and Security (QRS). IEEE, 274--284.Google ScholarGoogle ScholarCross RefCross Ref
  23. Amandeep Kaur. 2019. A Systematic Literature Review on Empirical Analysis of the Relationship Between Code Smells and Software Quality Attributes. Archives of Computational Methods in Engineering (2019), 1--30.Google ScholarGoogle Scholar
  24. Sharanpreet Kaur and Satwinder Singh. 2016. Spotting & eliminating type checking code smells using eclipse plug-in: Jdeodorant. International Journal of Computer Science and Communication Engineering 5, 1 (2016).Google ScholarGoogle Scholar
  25. V Krishnapriya and K Ramar. 2010. Exploring the difference between object oriented class inheritance and interfaces using coupling measures. In 2010 International Conference on Advances in Computer Engineering. IEEE, 207--211.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Guilherme Lacerda, Fabio Petrillo, Marcelo Pimenta, and Yann Gaël Guéhéneuc. 2020. Code smells and refactoring: a tertiary systematic review of challenges and observations. J. Syst. Softw. (2020), 110610.Google ScholarGoogle Scholar
  27. 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 ScholarDigital LibraryDigital Library
  28. Mark Lorenz and Jeff Kidd. 1994. Object-oriented software metrics: a practical guide. Prentice-Hall, Inc.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Angela Lozano, Kim Mens, and Jawira Portugal. 2015. Analyzing code evolution to uncover relations. In 2nd PPAP. IEEE, 1--4.Google ScholarGoogle Scholar
  30. Isela Macia, Joshua Garcia, Daniel Popescu, Alessandro Garcia, Nenad Medvidovic, and Arndt von Staa. 2012. Are automatically-detected code anomalies relevant to architectural modularity?. In 11th AOSD. 167--178.Google ScholarGoogle Scholar
  31. Ruchika Malhotra and Anuradha Chug. 2016. An empirical study to assess the effects of refactoring on software maintainability. In International Conference on Advances in Computing, Communications and Informatics (ICACCI). IEEE, 110--117.Google ScholarGoogle ScholarCross RefCross Ref
  32. Júlio Martins, Carla Ilane Moreira Bezerra, and Anderson Uchôa. 2019. Analyzing the Impact of Inter-smell Relations on Software Maintainability: An Empirical Study with Software Product Lines. In Proceedings of the XV Brazilian Symposium on Information Systems. 1--8.Google ScholarGoogle ScholarDigital LibraryDigital Library
  33. Thomas J McCabe. 1976. A complexity measure. IEEE Trans. Softw. Eng. 4 (1976), 308--320.Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Sandro Morasca. 2009. A probability-based approach for measuring external attributes of software artifacts. In 3rd ESEM. IEEE Computer Society, 44--55.Google ScholarGoogle Scholar
  35. Iulian Neamtiu, Guowu Xie, and Jianbo Chen. 2013. Towards a better understanding of software evolution: an empirical study on open-source software. J. Softw.: Evol. Process 25, 3 (2013), 193--218.Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. 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 38th ICSE. IEEE, 440--451.Google ScholarGoogle Scholar
  37. Willian Nalepa Oizumi, Alessandro Fabricio Garcia, Thelma Elita Colanzi, Manuele Ferreira, and Arndt von Staa. 2014. When code-anomaly agglomerations represent architectural problems? An exploratory study. In 28th SBES. IEEE, 91--100.Google ScholarGoogle Scholar
  38. Matheus Paixão, Anderson Uchôa, Ana Carla Bibiano, Daniel Oliveira, Alessandro Garcia, Jens Krinke, and Emilio Arvonio. 2020. Behind the Intents: An In-depth Empirical Study on Software Refactoring in Modern Code Review. In 17th MSR.Google ScholarGoogle Scholar
  39. Fabio Palomba, Gabriele Bavota, Massimiliano Di Penta, Fausto Fasano, Rocco Oliveto, and Andrea De Lucia. 2018. A large-scale empirical study on the life cycle of code smell co-occurrences. Inf. Softw. Technol. 99 (2018), 1--10.Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Fabio Palomba, Rocco Oliveto, and Andrea De Lucia. 2017. Investigating code smell co-occurrences using association rule learning: A replicated study. In 2017 IEEE Workshop on Machine Learning Techniques for Software Quality Evaluation (MaLTeSQuE). IEEE, 8--13.Google ScholarGoogle ScholarCross RefCross Ref
  41. Błażej Pietrzak and Bartosz Walter. 2006. Leveraging code smell detection with inter-smell relations. Extreme Programming and Agile Processes in Software Engineering (2006), 75--84.Google ScholarGoogle Scholar
  42. Benjamin Reilly. 2002. Social choice in the south seas: Electoral innovation and the borda count in the pacific island countries. International Political Science Review 23, 4 (2002), 355--372.Google ScholarGoogle ScholarCross RefCross Ref
  43. José Amancio M Santos, João B Rocha-Junior, Luciana Carla Lins Prates, Rogeres Santos do Nascimento, Mydiã Falcão Freitas, and Manoel Gomes de Mendonça. 2018. A systematic review on the code smell effect. J. Syst. Softw. 144 (2018), 450--477.Google ScholarGoogle ScholarDigital LibraryDigital Library
  44. Dag IK Sjøberg, Aiko Yamashita, Bente CD Anda, Audris Mockus, and Tore Dybå. 2012. Quantifying the effect of code smells on maintenance effort. IEEE Trans. Softw. Eng. 39, 8 (2012), 1144--1156.Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Ramanath Subramanyam and Mayuram S. Krishnan. 2003. Empirical analysis of ck metrics for object-oriented design complexity: Implications for software defects. IEEE Trans. Softw. Eng. 29, 4 (2003), 297--310.Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Sandhya Tarwani and Anuradha Chug. 2016. Sequencing of refactoring techniques by Greedy algorithm for maximizing maintainability. In Proceedings of the International Conference on Advances in Computing, Communications and Informatics (ICACCI). IEEE, 1397--1403.Google ScholarGoogle ScholarCross RefCross Ref
  47. Nikolaos Tsantalis, Theodoros Chaikalis, and Alexander Chatzigeorgiou. 2018. Ten years of JDeodorant: Lessons learned from the hunt for smells. In 25th SANER. IEEE, 4--14.Google ScholarGoogle Scholar
  48. Anderson Uchôa, Eduardo Fernandes, Ana Carla Bibiano, and Alessandro Garcia. 2017. Do Coupling Metrics Help Characterize Critical Components in Component-based SPL? An Empirical Study. In Proceedings of the 5th Workshop on Software Visualization, Evolution and Maintenance (VEM). 36--43.Google ScholarGoogle Scholar
  49. Anderson Uchôa, Caio Barbosa, Willian Oizumi, Publio Blenílio, Rafael Lima, Alessandro Garcia, and Carla Bezerra. 2020. How Does Modern Code Review Impact Software Design Degradation? An In-depth Empirical Study. In 36th ICSME. 1--12.Google ScholarGoogle Scholar
  50. Santiago Vidal, Hernan Vazquez, J Andres Diaz-Pace, Claudia Marcos, Alessandro Garcia, and Willian Oizumi. 2015. JSpIRIT: a flexible tool for the analysis of code smells. In 34th SCCC. IEEE, 1--6.Google ScholarGoogle Scholar
  51. Santiago A Vidal, Claudia Marcos, and J Andrés Díaz-Pace. 2016. An approach to prioritize code smells for refactoring. Automated Software Engineering 23, 3 (2016), 501--532.Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. Bartosz Walter, Francesca Arcelli Fontana, and Vincenzo Ferme. 2018. Code smells and their collocations: A large-scale experiment on open-source systems. J. Syst. Softw. 144 (2018), 1--21.Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Claes Wohlin, Per Runeson, Martin Höst, Magnus C Ohlsson, Björn Regnell, and Anders Wesslén. 2012. Experimentation in software engineering. Springer Science & Business Media.Google ScholarGoogle ScholarCross RefCross Ref
  54. Aiko Yamashita and Leon Moonen. 2013. Do developers care about code smells? An exploratory survey. In 20th WCRE. IEEE, 242--251.Google ScholarGoogle Scholar
  55. Aiko Yamashita and Leon Moonen. 2013. Exploring the impact of inter-smell relations on software maintainability: An empirical study. In 35th ICSE. IEEE, 682--691.Google ScholarGoogle Scholar
  56. Aiko Yamashita, Marco Zanoni, Francesca Arcelli Fontana, and Bartosz Walter. 2015. Inter-smell relations in industrial and open source systems: A replication and comparative analysis. In 31st ICSME. IEEE, 121--130.Google ScholarGoogle Scholar

Index Terms

  1. Are Code Smell Co-occurrences Harmful to Internal Quality Attributes?: A Mixed-Method Study

      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
        SBES '20: Proceedings of the XXXIV Brazilian Symposium on Software Engineering
        October 2020
        901 pages
        ISBN:9781450387538
        DOI:10.1145/3422392

        Copyright © 2020 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 ACM 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: 21 December 2020

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article
        • Research
        • Refereed limited

        Acceptance Rates

        Overall Acceptance Rate147of427submissions,34%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader