A User Feedback Centric Approach for Detecting and Mitigating God Class Code Smell Using Frequent Usage Patterns
Abstract
Code smells are the fragments in the source code that indicates deeper problems in the underlying software design. These code smells can hinder software evolution and maintenance. Out of different code smell types, the God Class (GC) code smell is one of the many important code smells that directly affects the software evolution and maintenance. The GC is commonly defined as a much larger class in systems that either know too much or do too much as compared to other classes in the system. God Classes are generally accidentally created overtime during software evolution because of the incremental addition of functionalities to it. Generally, a GC indicates a bad design choice and it must be detected and mitigated in order to enhance the quality of the underlying software. However, sometimes the presence of a GC is also considered a good design choice, especially in compiler design, interpreter design and parser implementation. This makes the developer’s feedback important for the correct classification of a class as a GC or a normal class. Therefore, this paper proposes a new approach that detects and proposes refactoring opportunities for GC code smell. The proposed approach makes use of different code metrics in combination along with utilizing user feedback as an important aspect while correctly identifying the GC code smell. The proposed approach that considers combined use of code metrics, is based on two newly proposed code metrics in this paper. The first newly proposed metric is a new approach of measuring the connectivity of a given class with other classes in the system (also termed as coupling). The second newly proposed code metric is proposed to measure the extent to which a given classes make use of foreign member variables. Finally, the proposed approach is also empirically evaluated on two standard open-source commonly used software systems. The obtained result indicates that the proposed approach is capable of correctly identifying the GC code smell.
Keywords
Code Smell, God Class, Refactoring, Software Evolution, maintenanceThis work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.
R. Singh, A. Bindal and A. Kumar, "A User Feedback Centric Approach for Detecting and Mitigating God Class Code Smell Using Frequent Usage Patterns," in Journal of Communications Software and Systems, vol. 15, no. 3, pp. 245-253, July 2019, doi: 10.24138/jcomss.v15i3.720
@article{singh2019userfeedback, author = {Randeep Singh and Amit Bindal and Ashok Kumar}, title = {A User Feedback Centric Approach for Detecting and Mitigating God Class Code Smell Using Frequent Usage Patterns}, journal = {Journal of Communications Software and Systems}, month = {7}, year = {2019}, volume = {15}, number = {3}, pages = {245--253}, doi = {10.24138/jcomss.v15i3.720}, url = {https://doi.org/10.24138/jcomss.v15i3.720} }