This study investigates the application of UniXcoder, a pre-trained transformer model for source code, to classify Java source code methods across multiple projects as smell or clean, with a particular focus on the Switch Statements smell, and confirms that pre-trained transformer models, particularly UniXcoder, are capable of understanding both the semantic and syntactic structures of code.
Abstract
Code smells are symptoms of poor software design that hinder maintainability and increase technical debt interest. Automated detection of code smells is crucial in software development industry, where manual inspection is costly and error-prone. Although several studies have explored code smell detection, most existing approaches, both structural/metric-based and textual/transformer-based, still exhibit limitations in capturing the semantic context of source code to handle complex smells effectively. This study investigates the application of UniXcoder, a pre-trained transformer model for source code, to classify Java source code methods across multiple projects as smell or clean, with a particular focus on the Switch Statements smell. The proposed method fine-tunes UniXcoder and evaluates its performance using standard metrics, namely accuracy, precision, recall, and F1-score, in comparison with traditional machine learning models based on structural metrics and textual representations. Experimental results show that the fine-tuned UniXcoder achieves the highest classification accuracy of 80.2%, the highest precision among all baseline methods evaluated, indicating its effectiveness in minimizing false positives. These findings confirm that pre-trained transformer models, particularly UniXcoder, are capable of understanding both the semantic and syntactic structures of code and demonstrate stronger performance than frequency-based textual representation approaches as well as software metrics-based approaches. Furthermore, the results highlight UniXcoder’s potential for integration into industrial software engineering workflows, supporting automated code smell detection as part of continuous code quality assurance.
SmellCC, a Visual Studio Code extension that augments SonarQube with an LLM-based pipeline to automatically detect and refactor Python code smells, provides in-place, one-click remediation for the top-10 most frequent smells, effectively preventing the accumulation of technical debt during development.
Xiaoting Zhang, Yujie Zhang, Zhi-Peng Gao et al.· 0 citations
This paper focuses on four common smells and considers five prompts of diverse complexity, asking the model for detecting and removing the identified code smells, and suggests that general-purpose LLMs cannot be reliably used for that.
Giorgia Paisi, Francesca Arcelli Fontana, Bartosz Walter· WiPiEC Journal - Works in Pr...· 0 citations
As software systems grow in complexity, ensuring maintainability is essential, but often hindered by various quality issues. Among them, code smells and test smells are widely recognized indicators of technical debt that degrade system quality. While production code and test suites are intrinsically coupled and evolve...
Refactoring is a disciplined process of improving the internal structure of software without changing its external behavior. Empirical studies have shown that refactoring contributes to maintainability and code quality; however, existing machine learning approaches for refactoring prediction rely predominantly on struc...
Amal Alazba, Muna Alrazgan, Nada Al Jamaan et al.· IEEE Access· 0 citations
The goal is to understand the code generation errors of foundation LLMs and explore the solution to resolve directly fixable errors, and to design and evaluate the LlmFix fixing method and constructed the LlmErrorEval dataset.
Hao Wen, Yue-Heng Zhu, Chao Liu et al.· Empirical Software Engineeri...· 0 citations
An automated, multi-dimensional evaluation framework for C# code generation, applying it to four state-of-the-art LLMs: GPT, Gemini, Claude, and Grok is presented and a substantial gap between correctness and quality attributes is revealed.
Seyed Mohammad Mahdi Ghalandarian, Majid Bazargani, Masoumeh Taromirad· 0 citations
We use cookies to run the site and, with your consent, for analytics and to show ads.
See our Cookie Policy.