DOI: 10.35377/saucis...1797149 ISSN: 2636-8129

God Class Detection using Thresholds of Software Code Metrics Derived from Metaheuristic Optimization

Kapil Sharma, Jitender Kumar Chhabra
The detection of God Class code smells is necessary for maintaining the quality, maintainability, and evolution of the software. Traditional code smell detection methods often rely on static and developer intuition-based thresholds of the software metrics, which may not be applicable to projects of different sizes and domains. This study proposes a new methodology for God Class detection by calculating thresholds of software metrics (Chidamber and Kemerer (CK) metrics suite) WMC, RFC, CBO, LCOM, and LOC for more accurate detection of God Class smells. The optimal thresholds for these metrics were derived using four metaheuristic algorithms: Genetic Algorithm (GA), Particle Swarm Optimization (PSO), Differential Evolution (DE), and Artificial Bee Colony (ABC), with the objective of maximizing the harmonic mean of sensitivity and specificity. Experimental findings compare the proposed approach with existing methods of thresholds derivation, using evaluation parameters including Accuracy, AUC, and the harmonic mean of sensitivity and specificity. Universal thresholds were also derived using weighted clustering for the software where project specific tuning is not possible. These results highlight the importance of metaheuristic optimization for improved detection of God Class code smells.