Abstract
Modern web applications have become one of the largest parts of the current software market over years, bringing cross-platform compatibility and data integration advantages that encouraged businesses to shift toward their adoption. Like any software application, code smells can be manifested as violations of implementation and design standards which could impact the maintainability, comprehensibility and performance of web applications. While there have been extensive studies on traditional code smells recently, little knowledge is available on code smells in web-based applications (web apps). As web applications are split into their client and server sides, we present in this study a first step in exploring the code smells diffuseness and effect on the server side of web applications. To this end, we conduct an exploratory study on a total of 430 releases from 10 long-lived open-source web-based applications on 12 common code smell types. We aim to better understand and gain insights into the diffuseness of code smells, their co-occurrences and effects on the change- and fault-proneness in server side code. Our study delivers several important findings. First, code smells are not equally diffused in web apps server side, among which smells related to complex, and large code components display high diffuseness and frequency rates. Second, the co-occurrence phenomenon is highly common, but the association degree between code smell pairs is weak. Code smells related to large size and high complexity exhibit a higher degree of co-occurrences. Third, smelly files are more likely to change than smell-free files, whereas not all smell types are likely to cause equal change sizes in the code base. Fourth, smelly files are more vulnerable to faults than smell-free files, and 86% of smelly files are more likely to manifest more faults than other files. Hence, developers should be aware of the existence of code smells in their web applications and consider detecting and refactoring them from their code bases, using appropriate tools.
Similar content being viewed by others
Notes
The commits exhibiting faults are the commits that touched the faulty code excluding the fault-inducing commit, which is considered the last change (cf. Sect. 2.4).
References
Abbes, M., Khomh, F., Gueheneuc, Y.- G., & Antoniol, G. (2011). An empirical study of the impact of two antipatterns, blob and spaghetti code, on program comprehension. In European Conference on Software Maintenance and Reengineering, 181–190.
Agrawal, R., Imieliński, T., & Swami, A. (1993). Mining association rules between sets of items in large databases. In ACM SIGMOD international conference on Management of data, 207–216.
Agrawal, R., Srikant, R., et al. (1994). Fast algorithms for mining association rules. In 20th international conference on very large data bases, VLDB, 1215, 487–499.
Antoniol, G., Ayari, K., Di Penta, M., Khomh, F., & Guéhéneuc, Y. -G. (2008). Is it a bug or an enhancement? a text-based approach to classify change requests. In Conference of the center for advanced studies on collaborative research: meeting of minds, 304–318.
Muse, B. A., Rahman, M. M., Nagy, C., Cleve, A., Khomh, F., & Antoniol, G. (2020). On the prevalence, impact, and evolution of sql code smells in data-intensive systems. In International Conference on Mining Software Repositories (MSR).
Bessghaier, N., Ouni, A., & Mkaouer, M. W. (2020). On the Diffusion and Impact of Code Smells in Web Applications. In International Conference on Services Computing (SCC), 67–84.
Borg, M., Svensson, O., Berg, K., & Hansson, D. (2019). Szz unleashed: an open implementation of the szz algorithm-featuring example usage in a study of just-in-time bug prediction for the jenkins project. In 3rd ACM SIGSOFT International Workshop on Machine Learning Techniques for Software Quality Evaluation, 7–12.
Brin, S., Motwani, R., Ullman, J. D., & Tsur, S. (1997). Dynamic itemset counting and implication rules for market basket data. In ACM SIGMOD international conference on Management of data, 255–264.
Chatzigeorgiou, A., & Manakos, A. (2010). Investigating the evolution of bad smells in object-oriented code. In Seventh International Conference on the Quality of Information and Communications Technology, 106–115.
Conover, W. J. (1973). On methods of handling ties in the wilcoxon signed-rank test. Journal of the American Statistical Association, 68(344), 985–988.
Conover, W. J. (1998). Practical nonparametric statistics, 350. John Wiley & Sons.
Cousineau, T. M., & Domar, A. D. (2007). Psychological impact of infertility. Best Practice & Research. Clinical Obstetrics & Gynaecology, 21(2), 293–308.
Cramir, H. (1946). Mathematical methods of statistics (p. 500). Princeton U. Press: Princeton.
Da Costa, D. A., McIntosh, S., Shang, W., Kulesza, U., Coelho, R., & Hassan, A. E. (2016). A framework for evaluating the results of the szz approach for identifying bug-introducing changes. IEEE Transactions on Software Engineering, 43(7), 641–657.
Dataset. (2020). https://www.github.com/stilab-ets/CodeSmells_WebApps.
Delchev, M., & Harun, M. F. (2015). Investigation of code smells in different software domains. Full-scale Software Engineering, 31.
Fontana, F. A., Ferme, V., & Zanoni, M. (2015). Towards assessing software architecture quality by exploiting code smell relations. In Second International Workshop on Software Architecture and Metrics, 1–7.
Fowler, M. (1999). Refactoring: improving the design of existing code. Addison-Wesley Professional.
Garg, A., Gupta, M., Bansal, G., Mishra, B., & Bajpai, V. (2016). Do bad smells follow some pattern? In International Congress on Information and Communication Technology, 39–46.
Grissom, R. J., & Kim, J. J. (2005). Effect sizes for research: A broad practical approach. Lawrence Erlbaum Associates Publishers.
Group, I., et al. (2010). Ieee standard classification for software anomalies. IEEE Std 1044-2009 (Revision of IEEE Std 1044-1993) 104(2), 1–23.
Habchi, S., Rouvoy, R., & Moha, N. (2019). On the survival of android code smells in the wild. In IEEE/ACM 6th International Conference on Mobile Software Engineering and Systems (MOBILESoft), pp. 87–98.
Hamdi, O., Ouni, A., AlOmar, E. A., Ó Cinnéide, M., & Mkaouer, M. W. (2021). An empirical study on the impact of refactoring on quality metrics in android applications. In IEEE/ACM International Conference on Mobile Software Engineering and Systems (MOBILESoft), pp. 1–12.
Hecht, G., Benomar, O., Rouvoy, R., Moha, N., & Duchien, L. (2015). Tracking the software quality of android applications along their evolution (t). In International Conference on Automated Software Engineering (ASE), pp. 236–247.
Hosmer, D. W., Lemeshow, S., & Cook, E. (2000). Applied logistic regression (2nd ed.). NY: John Wiley & Sons.
Kampstra, P., et al. (2008). Beanplot: A boxplot alternative for visual comparison of distributions. Journal of Statistical Software, 28(1), 1–9.
Kendall, M. G. (1938). A new measure of rank correlation. Biometrika, 30(1/2), 81–93.
Khomh, F., Di Penta, M., & Gueheneuc, Y. G. (2009). An exploratory study of the impact of code smells on software change-proneness. In Working Conference on Reverse Engineering, pp. 75–84.
Khomh, F., Di Penta, M., Guéhéneuc, Y. G., & Antoniol, G. (2012). An exploratory study of the impact of antipatterns on class change-and fault-proneness. Empirical Software Engineering, 17(3), 243–275.
Kienle, H., & Distante, D. (2014). Evolution of web systems. In Evolving Software Systems.
Kim, S., Zimmermann, T., Pan, K., James Jr, E., et al. (2006). Automatic identification of bug-introducing changes. In IEEE/ACM International Conference on Automated Software Engineering, pp. 81–90.
Lenarduzzi, V., Palomba, F., Taibi, D., & Tamburri, D. A. (2020). Openszz: A free, open-source, web-accessible implementation of the szz algorithm. In International Conference on Program Comprehension (ICPC).
Lenarduzzi, V., Saarimäki, N., & Taibi, D. (2019). The technical debt dataset. In International Conference on Predictive Models and Data Analytics in Software Engineering, pp. 2–11.
Liu, X., & Zhang, C. (2017). The detection of code smell on software development: a mapping study. In International Conference on Machinery, Materials and Computing Technology (ICMMCT 2017), Atlantis Press.
Macbeth, G., Razumiejczyk, E., & Ledesma, R. D. (2011). Cliff’s delta calculator: A non-parametric effect size program for two groups of observations. Universitas Psychologica, 10(2), 545–555.
Mannan, U. A., Ahmed, I., Almurshed, R. A. M., Dig, D., & Jensen, C. (2016). Understanding code smells in android applications. In IEEE/ACM International Conference on Mobile Software Engineering and Systems (MOBILESoft), pp. 225–236.
Martin, R. C. (2009). Clean code: a handbook of agile software craftsmanship. Pearson Education.
Mazinanian, D., Tsantalis, N., & Mesbah, A. (2014). Discovering refactoring opportunities in cascading style sheets. In 22nd ACM SIGSOFT International Symposium on Foundations of Software Engineering, pp. 496–506.
McHugh, M. L. (2013). The chi-square test of independence. Biochemia medica: Biochemia medica, 23(2), 143–149.
Mon, C. T., Hlaing, S., Tin, M., Khin, M., Lwin, T. M., & Myo, K. M. (2019). Code readability metric for php. In International Conference on Consumer Electronics, pp. 929–930.
Mon, C. T., & Myo, K. M. (2015). A practical model for measuring code complexity of php. In Thirteenth International Conferences on Computer Applications (ICCA 2015).
Olbrich, S., Cruzes, D. S., Basili, V., & Zazworka, N. (2009). 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.
Olbrich, S. M., Cruzes, D. S., & Sjøberg, D. I. (2010). Are all code smells harmful? a study of god classes and brain classes in the evolution of three open source systems. In IEEE International Conference on Software Maintenance, pp. 1–10.
Ouni, A., Kessentini, M., Bechikh, S., & Sahraoui, H. (2015a). Prioritizing code-smells correction tasks using chemical reaction optimization. Software Quality Journal, 23(2), 323–361.
Ouni, A., Kessentini, M., Inoue, K., & Cinnéide, M. O. (2017). Search-based web service antipatterns detection. IEEE Transactions on Services Computing, 10(4), 603–617.
Ouni, A., Kessentini, M., Sahraoui, H., Inoue, K., & Deb, K. (2016). Multi-criteria code refactoring using search-based software engineering: An industrial case study. ACM Transactions on Software Engineering and Methodology, 25(3), 1–53.
Ouni, A., Kessentini, M., Sahraoui, H., Inoue, K., & Hamdi, M. S. (2015b). Improving multi-objective code-smells correction using development history. Journal of Systems and Software, 105, 18–39.
Palomba, F., Bavota, G., Di Penta, M., Fasano, F., Oliveto, R., & De Lucia, A. (2018a). A large-scale empirical study on the lifecycle of code smell co-occurrences. Information and Software Technology, 99, 1–10.
Palomba, F., Bavota, G., Di Penta, M., Fasano, F., Oliveto, R., & De Lucia, A. (2018b). On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation. Empirical Software Engineering, 23(3), 1188–1221.
Palomba, F., Di Nucci, D., Panichella, A., Zaidman, A., & De Lucia, A. (2019). On the impact of code smells on the energy consumption of mobile applications. Information and Software Technology, 105, 43–55.
Palomba, F., Oliveto, R., & De Lucia, A. (2017). Investigating code smell co-occurrences using association rule learning: A replicated study. In IEEE Workshop on Machine Learning Techniques for Software Quality Evaluation (MaLTeSQuE), pp. 8–13.
Pecorelli, F., Palomba, F., Khomh, F., & De Lucia, A. (2020). Developer-driven code smell prioritization. In International Conference on Mining Software Repositories.
PHPMD. (2021).PHP Mess Detector, available at https://phpmd.org
Piatetsky-Shapiro, G. (1991). Discovery, analysis, and presentation of strong rules. Knowledge discovery in databases, 229–238.
Planning, S. (2002). The economic impacts of inadequate infrastructure for software testing. National Institute of Standards and Technology.
Rio, A., & e Abreu, F. B. (2019). Code smells survival analysis in web apps. In International Conference on the Quality of Information and Communications Technology, Springer, pp. 263–271.
Rodríguez-Pérez, G., Robles, G., & González-Barahona, J. M. (2018). Reproducibility and credibility in empirical software engineering: A case study based on a systematic literature review of the use of the szz algorithm. Information and Software Technology, 99, 164–176.
Rodríguez-Pérez, G., Robles, G., Serebrenik, A., Zaidman, A., Germán, D. M., & Gonzalez-Barahona, J. M. (2020). How bugs are born: a model to identify how bugs are introduced in software components. Empirical Software Engineering, 1–47.
Rossi, G., Pastor, O., Schwabe, D., & Olsina, L. (2007). Web engineering: modelling and implementing web applications. Springer Science & Business Media.
Saboury, A., Musavi, P., Khomh, F., & Antoniol, G. (2017). An empirical study of code smells in javascript projects. In International conference on software analysis, evolution and reengineering (SANER), pp. 294–305.
Saidani, I., Ouni, A., Mkaouer, M. W., & Palomba, F. (2021). On the impact of continuous integration on refactoring practice: An exploratory study on travistorrent. Information and Software Technology, 106618.
Śliwerski, J., Zimmermann, T., & Zeller, A. (2005). When do changes induce fixes? ACM sigsoft software engineering notes, 30(4), 1–5.
Spadini, D., Aniche, M., & Bacchelli, A. (2018). Pydriller: Python framework for mining software repositories. In ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering, pp. 908–911.
Spadini, D., Palomba, F., Zaidman, A., Bruntink, M., & Bacchelli, A. (2018). On the relation of test smells to software code quality. In IEEE International Conference on Software Maintenance and Evolution (ICSME), pp. 1–12.
Statistics, P. https://w3techs.com/technologies/overview/programming_language. Accessed Jul 7 2020.
Tufano, M., Palomba, F., Bavota, G., Oliveto, R., Di Penta, M., De Lucia, A., & Poshyvanyk, D. (2015). When and why your code starts to smell bad. International Conference on Software Engineering, 1, 403–414.
Williams, C., & Spacco, J. (2008). Szz revisited: verifying when changes induce fixes. In Workshop on Defects in large software systems, pp. 32–36.
Yulianto, S. V., & Liem, I. (2014). Automatic grader for programming assignment using source code analyzer. In International Conference on Data and Software Engineering (ICODSE), pp. 1–4.
Zimmermann, T., Premraj, R., & Zeller, A. (2007). Predicting defects for eclipse. In Third International Workshop on Predictor Models in Software Engineering (PROMISE’07: ICSE Workshops 2007), IEEE, pp. 9–9.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
About this article
Cite this article
Bessghaier, N., Ouni, A. & Mkaouer, M.W. A longitudinal exploratory study on code smells in server side web applications. Software Qual J 29, 901–941 (2021). https://doi.org/10.1007/s11219-021-09567-w
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s11219-021-09567-w