A longitudinal exploratory study on code smells in server side web applications

Published in Software Quality Journal, 2021

Recommended citation: Bessghaier, N., Ouni, A., & Mkaouer, M. W. (2021). A longitudinal exploratory study on code smells in server side web applications. Software Quality Journal, 29, 901-941. http://NarjesBessghaier.github.io/files/Bessghaier2021-CodeSmells.pdf

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.