A Novel Metric based Detection of Temporary Field Code Smell and its Empirical Analysis

Autor: Ruchin Gupta, Sandeep Kumar Singh
Jazyk: angličtina
Rok vydání: 2022
Předmět:
Zdroj: Journal of King Saud University: Computer and Information Sciences, Vol 34, Iss 10, Pp 9478-9500 (2022)
Druh dokumentu: article
ISSN: 1319-1578
DOI: 10.1016/j.jksuci.2021.11.005
Popis: Code smell causes side effects in the source code and impact the code quality. It is beneficial to recognize code smells to improve software quality. Despite 22 classical code smells as characterized by Martin Fowler, all classical code smells have not been considered for the identification and refactoring. Temporary field code smell is one such code smell that has not been given an appropriate level of attention so far regarding its detection as well as refactoring. In this paper, we have proposed a novel metric-based method and developed a tool to detect temporary field code smell. The proposed method works on three novel metrics in addition to existing metric TCC (tight class cohesion) and three new rules (R1, R2, and R3) to detect temporary field code smell. Detection rules were tested on ten open-source GitHub Java projects used in the literature. Results demonstrate that projects under the study that had non-cohesive classes have shown the presence of temporary field code smell ranging from 54% to 100%. Findings have additionally demonstrated that for the undertaken projects, there exists a strong positive correlation between the number of classes exhibiting temporary field smell and number of non-cohesive classes present in a project.
Databáze: Directory of Open Access Journals