A large-scale empirical study on the lifecycle of code smell co-occurrences

Autor: Fausto Fasano, Gabriele Bavota, Rocco Oliveto, Fabio Palomba, Andrea De Lucia, Massimiliano Di Penta
Rok vydání: 2018
Předmět:
Zdroj: Information and Software Technology. 99:1-10
ISSN: 0950-5849
DOI: 10.1016/j.infsof.2018.02.004
Popis: Context Code smells are suboptimal design or implementation choices made by programmers during the development of a software system that possibly lead to low code maintainability and higher maintenance costs. Objective Previous research mainly studied the characteristics of code smell instances affecting a source code file, while only few studies analyzed the magnitude and effects of smell co-occurrence, i.e., the co-occurrence of different types of smells on the same code component. This paper aims at studying in details this phenomenon. Method We analyzed 13 code smell types detected in 395 releases of 30 software systems to firstly assess the extent to which code smells co-occur, and then we analyze (i) which code smells co-occur together, and (ii) how and why they are introduced and removed by developers. Results 59% of smelly classes are affected by more than one smell, and in particular there are six pairs of smell types (e.g., Message Chains and Spaghetti Code) that frequently co-occur. Furthermore, we observed that method-level code smells may be the root cause for the introduction of class-level smells. Finally, code smell co-occurrences are generally removed together as a consequence of other maintenance activities causing the deletion of the affected code components (with a consequent removal of the code smell instances) as well as the result of a major restructuring or scheduled refactoring actions. Conclusions Based on our findings, we argue that more research aimed at designing co-occurrence-aware code smell detectors and refactoring approaches is needed.
Databáze: OpenAIRE