Abstract

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.

Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call