EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

Code Smells Thresholds Optimization: Defect Prediction as a Case Study

Tom Mashiach, Gilad Katz, Meir Kalech

Algorithms · 20.05.2026 · 19 (5) · 412

DOI: 10.3390/a19050412 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Algorithms, online erschienen am 20.05.2026. Verfasst von Tom Mashiach und 2 weiteren Autor:innen. Die Arbeit nennt 58 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0). Gefördert von: Ministry of Innovation, Science and Technology.

AbstractBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

In software engineering, detecting and managing code smells are pivotal for maintaining software quality and reducing the risk of defects. Code smells signify potential issues in code that, while not problematic in themselves, may indicate deeper design flaws or future complications. Traditional code smells detection methods, which compare code metrics against fixed or statistically derived thresholds, may not always yield the most accurate code smells relevant to specific software practices. Addressing this gap, this research introduces an innovative methodology that utilizes a neural threshold generator, trained via a cooperative critic, to dynamically generate threshold values for detecting code smells in software components. Although the critic is conceptually related to the discriminator in a Generative Adversarial Network (GAN), its training objective is aligned with rather than adversarial to that of the generator. By integrating relevant code metrics, the proposed model generates customized thresholds for each software component. Our current evaluation focuses on a set of 11 class-level code smells defined by single or AND-connected conditions. It then uses these thresholds to identify code smells, which serve as input features to train a defect prediction model. A key feature of our approach is a cooperative-critic feedback mechanism that continuously refines the thresholds based on the defect prediction outcomes, ensuring the model’s effectiveness in identifying potential software issues is consistently improved. This advanced approach has demonstrated superior defect prediction performance, as evidenced by improved metrics such as the F1-score, AUC-ROC, and AUC-PRC, compared with the results of a defect prediction model that uses the traditional thresholds. Our study underscores the effectiveness of generating context-specific thresholds through neural networks, suggesting a promising avenue for exploring related software practices.

Förderung

  • Ministry of Innovation, Science and Technology

Zitieren

APA

Mashiach, T., Katz, G., & Kalech, M. (2026). Code Smells Thresholds Optimization: Defect Prediction as a Case Study. Algorithms, 19(5), 412. https://doi.org/10.3390/a19050412

Vancouver

Mashiach T, Katz G, Kalech M. Code Smells Thresholds Optimization: Defect Prediction as a Case Study. Algorithms. 2026;19(5):412. doi:10.3390/a19050412

BibTeX
@article{Mashiach2026,
  author = {Mashiach, Tom and Katz, Gilad and Kalech, Meir},
  title = {Code Smells Thresholds Optimization: Defect Prediction as a Case Study},
  journal = {Algorithms},
  year = {2026},
  volume = {19},
  number = {5},
  pages = {412},
  doi = {10.3390/a19050412}
}
Kostenlos starten →