Skip to main content

On the Diffusion and Impact of Code Smells in Web Applications

  • Conference paper
  • First Online:
Services Computing – SCC 2020 (SCC 2020)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 12409))

Included in the following conference series:

Abstract

Web applications (web apps) have become one of the largest parts of the current software market over years. Modern web apps offer several business benefits over other traditional and standalone applications. Mainly, cross-platform compatibility and data integration are some of the critical features that encouraged businesses to shift towards the adoption of Web apps. Web apps are evolving rapidly to acquire new features, correct errors or adapt to new environment changes especially with the volatile context of the web development. These ongoing amends often affect software quality due to poor coding and bad design practices, known as code smells or anti-patterns. The presence of code smells in a software project is widely considered as form of technical debt and makes the software harder to understand, maintain and evolve, besides leading to failures and unforeseen costs. Therefore, it is critical for web apps to monitor the existence and spread of such anti-patterns. In this paper, we specifically target web apps built with PHP being the most used server-side programming language. We conduct the first empirical study to investigate the diffuseness of code smells in Web apps and their relationship with the change proneness of affected code. We detect 12 types of common code smells across a total of 223 releases of 5 popular and long-lived open-source web apps. The key findings of our study include: 1) complex and large classes and methods are frequently committed in PHP files, 2) smelly files are more prone to change than non-smelly files, and 3) Too Many Methods and High Coupling are the most associated smells with files change-proneness.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://developers.google.com/web/updates/2015/12/getting-started-pwa.

  2. 2.

    https://w3techs.com/technologies/overview/programming_language.

  3. 3.

    https://phpmd.org.

  4. 4.

    https://github.com/phpmyadmin/phpmyadmin.

  5. 5.

    https://github.com/joomla/joomla-cms.

  6. 6.

    https://github.com/WordPress/WordPress.

  7. 7.

    https://github.com/matomo-org/matomo.

  8. 8.

    https://github.com/laravel/laravel.

  9. 9.

    https://github.com/sebastianbergmann/phploc.

  10. 10.

    https://developer.github.com/v3/.

References

  1. Replication package. https://github.com/Narjes-b/SmellsAnalysis-WebApps

  2. Aniche, M., Bavota, G., Treude, C., Gerosa, M.A., van Deursen, A.: Code smells for model-view-controller architectures. Empirical Soft. Eng. 23(4), 2121–2157 (2018)

    Article  Google Scholar 

  3. Boukharata, S., Ouni, A., Kessentini, M., Bouktif, S., Wang, H.: Improving web service interfaces modularity using multi-objective optimization. Autom. Sofw. Eng. 26(2), 275–312 (2019)

    Article  Google Scholar 

  4. Brown, W.H., Malveau, R.C., McCormick, H.W., Mowbray, T.J.: AntiPatterns: Refactoring Software, Architectures, and Projects In Crisis. Wiley, New York (1998)

    Google Scholar 

  5. Chatzigeorgiou, A., Manakos, A.: Investigating the evolution of bad smells in object-oriented code. In: Seventh International Conference on the Quality of Information and Communications Technology, pp. 106–115. IEEE (2010)

    Google Scholar 

  6. Cohen, J.: Statistical Power Analysis for The Behavioral Sciences. Erihaum, Hillsdale (1988)

    MATH  Google Scholar 

  7. Delchev, M., Harun, M.F.: Investigation of code smells in different software domains. Full-scale Softw. Eng. 31, 31–36 (2015)

    Google Scholar 

  8. Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional, Boston (2018)

    MATH  Google Scholar 

  9. Hecht, G., Benomar, O., Rouvoy, R., Moha, N., Duchien, L.: Tracking the software quality of android applications along their evolution (t). In: International Conference on Automated Software Engineering (ASE), pp. 236–247 (2015)

    Google Scholar 

  10. Hosmer, D.W., Lemeshow, S., Cook, E.: Applied Logistic Regression, 2nd edn. Wiley, New York (2000)

    Book  Google Scholar 

  11. Kampstra, P., et al.: Beanplot: a boxplot alternative for visual comparison of distributions. J. Stat. Softw. 28(1), 1–9 (2008)

    Google Scholar 

  12. Khomh, F., Di Penta, M., Gueheneuc, Y.G.: An exploratory study of the impact of code smells on software change-proneness. In: WCRE, pp. 75–84 (2009)

    Google Scholar 

  13. Khomh, F., Di Penta, M., Guéhéneuc, Y.G., Antoniol, G.: An exploratory study of the impact of antipatterns on class change-and fault-proneness. Empirical Softw. Eng. 17(3), 243–275 (2012). https://doi.org/10.1007/s10664-011-9171-y

    Article  Google Scholar 

  14. Kim, T.K.: T test as a parametric statistic. Korean J. Anesthesiol. 68(6), 540 (2015)

    Article  Google Scholar 

  15. Liu, X., Zhang, C.: The detection of code smell on software development: a mapping study. In: 5th International Conference on Machinery, Materials and Computing Technology (ICMMCT 2017). Atlantis Press (2017)

    Google Scholar 

  16. Mannan, U.A., Ahmed, I., Almurshed, R.A.M., Dig, D., Jensen, C.: Understanding code smells in android applications. In: IEEE/ACM International Conference on Mobile Software Engineering and Systems (MOBILESoft), pp. 225–236 (2016)

    Google Scholar 

  17. Martin, R.C.: Clean Code: A Handbook of Agile Software Craftsmanship. Pearson Education, London (2009)

    Google Scholar 

  18. Mon, C.T., Hlaing, S., Tin, M., Khin, M., Lwin, T.M., Myo, K.M.: Code readability metric for PHP. In: IEEE 8th Global Conference on Consumer Electronics (GCCE), pp. 929–930 (2019)

    Google Scholar 

  19. Nguyen, H.V., Nguyen, H.A., Nguyen, T.T., Nguyen, A.T., Nguyen, T.N.: Detection of embedded code smells in dynamic web applications. In: IEEE/ACM International Conference on Automated Software Engineering, pp. 282–285 (2012)

    Google Scholar 

  20. Olbrich, S., Cruzes, D.S., Basili, V., Zazworka, N.: The evolution and impact of code smells: a case study of two open source systems. In: International Symposium on Empirical Software Engineering and Measurement, pp. 390–400 (2009)

    Google Scholar 

  21. Olbrich, S.M., Cruzes, D.S., Sjøberg, D.I.: Are all code smells harmful? A study of god classes and brain classes in the evolution of three open source systems. In: International Conference on Software Maintenance, pp. 1–10 (2010)

    Google Scholar 

  22. Ouni, A., Gaikovina Kula, R., Kessentini, M., Inoue, K.: Web service antipatterns detection using genetic programming. In: Annual Conference on Genetic and Evolutionary Computation (GECCO), pp. 1351–1358 (2015)

    Google Scholar 

  23. Ouni, A., Kessentini, M., Bechikh, S., Sahraoui, H.: Prioritizing code-smells correction tasks using chemical reaction optimization. Softw. Qual. J. 23(2), 323–361 (2015)

    Article  Google Scholar 

  24. Ouni, A., Kessentini, M., Inoue, K., Cinnéide, M.O.: Search-based web service antipatterns detection. IEEE Trans. Serv. Comput. 10(4), 603–617 (2017)

    Article  Google Scholar 

  25. Ouni, A., Kessentini, M., Ó cinnéide, M., Sahraoui, H., Deb, K., Inoue, K.: MORE: a multi-objective refactoring recommendation approach to introducing design patterns and fixing code smells. Softw. Evol. Process 29(5), e1843 (2017)

    Article  Google Scholar 

  26. Ouni, A., Kessentini, M., Sahraoui, H., Inoue, K., Deb, K.: Multi-criteria code refactoring using search-based software engineering: an industrial case study. ACM Trans. Softw. Eng. Methodol. 25(3), 1–53 (2016)

    Article  Google Scholar 

  27. Ouni, A., Kessentini, M., Sahraoui, H., Inoue, K., Hamdi, M.S.: Improving multi-objective code-smells correction using development history. J. Syst. Softw. 105, 18–39 (2015)

    Article  Google Scholar 

  28. Palomba, F., Bavota, G., Di Penta, M., Fasano, F., Oliveto, R., De Lucia, A.: On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation. Empirical Softw. Eng. 23(3), 1188–1221 (2018). https://doi.org/10.1007/s10664-017-9535-z

    Article  Google Scholar 

  29. PHPMD (2020). https://phpmd.org

  30. Pressman, R.S.: Software engineering: a practitioner’s approach. Palgrave Macmillan, London (2005)

    MATH  Google Scholar 

  31. Rio, A., Brito e Abreu, F.: Code smells survival analysis in web apps. In: Piattini, M., Rupino da Cunha, P., García Rodríguez de Guzmán, I., Pérez-Castillo, R. (eds.) QUATIC 2019. CCIS, vol. 1010, pp. 263–271. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-29238-6_19

    Chapter  Google Scholar 

  32. Saboury, A., Musavi, P., Khomh, F., Antoniol, G.: An empirical study of code smells in Javascript projects. In: International Conference on Software Analysis, Evolution and Reengineering, pp. 294–305 (2017)

    Google Scholar 

  33. Spadini, D., Palomba, F., Zaidman, A., Bruntink, M., Bacchelli, A.: On the relation of test smells to software code quality. In: IEEE International Conference on Software Maintenance and Evolution (ICSME), pp. 1–12. IEEE (2018)

    Google Scholar 

  34. Tufano, M., et al.: An empirical investigation into the nature of test smells. In: International Conference on Automated Software Engineering, pp. 4–15 (2016)

    Google Scholar 

  35. Tufano, M., et al.: When and why your code starts to smell bad. In: IEEE International Conference on Software Engineering, vol. 1, pp. 403–414 (2015)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Narjes Bessghaier .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Bessghaier, N., Ouni, A., Mkaouer, M.W. (2020). On the Diffusion and Impact of Code Smells in Web Applications. In: Wang, Q., Xia, Y., Seshadri, S., Zhang, LJ. (eds) Services Computing – SCC 2020. SCC 2020. Lecture Notes in Computer Science(), vol 12409. Springer, Cham. https://doi.org/10.1007/978-3-030-59592-0_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-59592-0_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-59591-3

  • Online ISBN: 978-3-030-59592-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics