Skoči na glavni sadržaj

Izvorni znanstveni članak

https://doi.org/10.24138/jcomss-2024-0106

An Approach Based on Sum Product Networks for Code Smells Detection

Mostefai Abdelkader orcid id orcid.org/0000-0003-0408-331X ; Computer Science Department, Faculty of Mathematics, Informatics, and Telecommunications, Dr. Tahar Moulay University, Saida, Algeria *

* Dopisni autor.


Puni tekst: engleski pdf 2.960 Kb

str. 189-200

preuzimanja: 38

citiraj


Sažetak

From a software engineering perspective, a code smell refers to poor code structure. Many studies have shown that there is a significant negative relationship between code smells and code quality. Thus, many approaches have been proposed to detect and manage them. However, detecting code smells remains a challenging problem. This paper introduces a method (CSDSPN) based on a sum product network (SPN); a probabilistic deep architecture not yet evaluated in the context of code smell detection. SPNs are tractable density estimators that compactly represent a joint probability distribution. The main objective of this paper is to study the performance of a Sum-Product Network as a classifier for code smell detection. To fulfill this objective, the paper proposes an approach that utilizes a classifier based on an SPN trained on data from previous projects, to identify code smells in new source code. An empirical study was conducted to assess the effectiveness of the proposed method in detecting ’God Class,’ ’Long Method,’ and ’Feature Envy’ code smells using well-known datasets. The empirical study evaluated the proposed approach against against seven standard and advanced machine learning models. The results of the study demonstrate the potential of the proposed method in effectively detecting code smells.

Ključne riječi

Code smells; Sum product network; Probability distribution; Source code

Hrčak ID:

330894

URI

https://hrcak.srce.hr/330894

Datum izdavanja:

30.6.2025.

Posjeta: 80 *