How do Code Smell Co-occurrences Removal Impact Internal Quality Attributes? A Developers’ Perspective - Martins, Júlio; Bezerra, Carla; Uchôa, Anderson; Garcia, Alessandro (Anais do Simpósio Brasileiro de Engenharia de Software (SBES); 2021: Anais do XXXV Simpósio Brasileiro de Engenharia de Software, 2021)
Code smells are poor code structures that might harm the software quality and evolution. However, previous studies has shown that only individual occurrences of smells may not be enough to assess the real impact that these smells can bring on systems. In this context, the co-occurrences of code smells, i.e., occurrences of more than one code smell in the same class or same method, can be better indicators of design problems for software quality. Despite its importance as an indicator of design problems, we have little known about the impact of removing the co-occurrence of smells via software refactoring on internal quality attributes, such as coupling, cohesion, complexity, and inheritance. It is even less clear on what is the developers’ perspective on the co-occurrences removal. We aim at addressing this gap through a qualitative study with 14 developers. To this end, we analyze the refactorings employed by developers during the removal of 60 code smells co-occurrences, during 3 months in 5 closed-source projects. We observe (i) impact of code smells co-occurrences on internal quality attributes, (ii) which are the most harmful co-occurrences from the developers’ perspective, (iii) developers’ perceptions during the removal of code smells co-occurrence via refactoring activities; and (iv) what are the main difficulties faced by developers during the removal of code smells co-occurrences in practice. Our findings indicate that: (i) the refactoring of some types of code smells co-occurrences (e.g., Dispersed Coupling–God Class) indicated improvement for the quality attributes; (ii) refactoring code smells co-occurrences according to the developers is difficult mainly due to the understanding of the code and complexity refactoring methods; and (iii) developers still have insecurities regarding the identification and refactoring of code smells and their co-occurrences.