Skip to main navigation Skip to search Skip to main content

Understanding Code Smell Detection Through Hyperparameter Optimization and Metric Correlation Analysis

Research output: Contribution to journalArticlepeer-review

Abstract

Hyperparameter optimization plays a pivotal role in the reliability and generalization of machine-learning models for software quality prediction. This paper presents a comparative evaluation of three search strategies: Grid Search, Random Search, and a Hybrid approach applied to the detection of four types of code smells (BLOB, Functional Decomposition, Spaghetti Code, and Swiss Army Knife). Experiments were performed on three open-source Java systems (Azureus, ArgoUML, and Xerces) using Support Vector Machines (SVMs). The results show that all three strategies produce consistent patterns in accuracy and F1-score across the datasets, confirming the robustness of the evaluation framework. Simultaneously, Random Search tends to achieve higher recall for the Functional Decomposition smell, reflecting its ability to explore sparse and irregular hyperparameter spaces. The Hybrid approach combines the exploratory strength of Random Search with the local refinement of Grid Search, offering greater stability with a moderate computational cost. A correlation analysis of software metrics further reveals that while the Blob smell is consistently associated with size and coupling indicators, the other smells—Functional Decomposition, Spaghetti Code, and Swiss Army Knife are captured more indirectly through general structural proxies such as size, cohesion, and coupling. Overall, these findings suggest that hyperparameter tuning not only enhances predictive performance but also provides valuable insights into the structural factors underlying code smells.

Original languageEnglish
Pages (from-to)217750-217768
Number of pages19
JournalIEEE Access
Volume13
DOIs
StatePublished - 2025

Bibliographical note

Publisher Copyright:
© 2013 IEEE.

Keywords

  • Code smell detection
  • grid search
  • hyperparameter optimization
  • machine learning
  • random search
  • software metrics
  • software quality
  • support vector machine

Fingerprint

Dive into the research topics of 'Understanding Code Smell Detection Through Hyperparameter Optimization and Metric Correlation Analysis'. Together they form a unique fingerprint.

Cite this