God Class Detection Using Thresholds of Software Code Metrics Derived from Metaheuristic Optimization
Abstract
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 threshold 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.
Keywords
Ethical Statement
References
- A. Chatzigeorgiou and A. Manakos, “Investigating the evolution of code smells in object-oriented systems,” Innov. Syst. Softw. Eng., vol. 10, no. 1, pp. 3–18, 2014, doi:10.1007/s11334-013-0205-z.
- F. Khomh, M. Di Penta, and Y.-G. Gueheneuc, “An exploratory study of the impact of code smells on software change-proneness,” in 2009 16th Working Conference on Reverse Engineering, pp. 75–84, 2009.
- A. Yamashita and L. Moonen, “Do code smells reflect important maintainability aspects?,” in 2012 28th IEEE International Conference on Software Maintenance (ICSM), pp. 306–315, 2012.
- M. Fowler, Refactoring: Improving the Design of Existing Code. Boston, MA, USA: Addison-Wesley, 1999.
- S. M. Olbrich, D. S. Cruzes, and D. I. K. Sjøberg, “Are all code smells harmful? A study of God Classes and Brain Classes in the evolution of three open source systems,” in 2010 IEEE International Conference on Software Maintenance, pp. 1–10, 2010.
- J. A. M. Santos, M. G. De Mendonça, and C. V. A. Silva, “An exploratory study to investigate the impact of conceptualization in god class detection,” ACM Int. Conf. Proceeding Ser., pp. 48–59, 2013, doi:10.1145/2460999.2461007.
- S. Dewangan, R. S. Rao, A. Mishra, and M. Gupta, “A novel approach for code smell detection: An empirical study,” IEEE Access, vol. 9, pp. 162869–162883, 2021, doi:10.1109/ACCESS.2021.3133810.
- F. Arcelli Fontana, M. V. Mäntylä, M. Zanoni, and A. Marino, “Comparing and experimenting with machine learning techniques for code smell detection,” Empir. Softw. Eng., vol. 21, no. 3, pp. 1143–1191, 2016, doi:10.1007/s10664-015-9378-4.
Details
Primary Language
English
Subjects
Software Engineering (Other)
Journal Section
Research Article
Authors
Jitender Kumar Chhabra
This is me
0000-0002-2257-0982
India
Publication Date
September 30, 2026
Submission Date
October 6, 2025
Acceptance Date
April 9, 2026
Published in Issue
Year 2026 Volume: 9 Number: 4