Findings show that detailed contextualization significantly improves the quality of LLM-generated suggestions and that more complex smells may benefit from an agentic approach.
Abstract
Architectural smells, e.g., cyclic dependencies (CDs), are widespread in software systems and pose significant challenges to maintainability, reliability and scalability. While tools can automatically detect such smells, refactoring them remains a manual and time-consuming task that developers often postpone in favor of implementing new features, which leads to increasing architectural technical debt. This paper explores the use of Large Language Models (LLMs) to support the automated refactoring of CD smells across multiple programming languages, including C#, Java, and Python. We focus on enhancing LLM-generated refactoring suggestions through prompt engineering and Retrieval-Augmented Generation (RAG), enriching the models with context-specific information. We build on tools like Arcan, Understand and Pyexamine to identify CD smells and extract resolution strategies, which are then fed to both local and cloud-based LLMs to generate refactoring proposals. The effectiveness of these proposals is qualitatively assessed through interviews with seventeen participants: ten software engineering master students and seven professional developers. Our findings show that detailed contextualization significantly improves the quality of LLM-generated suggestions and that more complex smells may benefit from an agentic approach. This study demonstrates the potential of LLMs to assist in architectural refactoring tasks and provides insights into optimizing their use through tailored prompting and retrieval techniques.
Software engineers need to identify and assess maintainability concerns in source code to support inspection and refactoring decisions. However, code-smell characterization is context-dependent: static-analysis tools such as SonarQube provide systematic rule-based findings, whereas LLMs offer contextual interpretation...
Diego Gatica, René Nöel· Proceedings of the ACM/IEEE...· 0 citations
Code smells accumulate as technical debt, reducing software maintainability. Refactoring is the established remediation practice, but it is complex and often deprioritized. Large Language Models can support automated refactoring, but their effectiveness depends on how they are prompted. In this study, we evaluate 14 pr...
Nadim Hagatulah, Markus Borg, E. Söderberg· Proceedings of the 1st Inter...· 0 citations
Large Language Models (LLMs) are increasingly used to refactor source files, but file-local evaluations do not reveal changes to contracts, dependencies, or caller assumptions affecting repository adoption. To address this gap, we conduct 1,500 generation attempts across 150 production files from 15 open-source Java re...
Muhammad Waseem, Aakash Ahmad, Pekka Abrahamsson· 0 citations
The results suggest that increasing \textit{smell density} was generally associated with lower test-suite-based functional correctness, although non-smelly requirements could still produce faulty code, and motivates further investigation into task-dependent quality effects in LLM-assisted software engineering.
Hugo Villamizar, Jannik Fischbach, Mert Şahin et al.· arXiv.org· 0 citations
Model-Driven Engineering (MDE) supports the development of large-scale, complex systems through abstraction, automation, and traceability. The rise of Large Language Models (LLMs) has renewed interest in reshaping MDE, with recent studies exploring their use in tasks such as model generation, model comprehension, as we...
Man Zhang, Yun-Yan Li, Tao Yue· ACM Transactions on Software...· 0 citations
We use cookies to run the site and, with your consent, for analytics and to show ads.
See our Cookie Policy.