Answers are grounded in this paper and cite their sources.
Context 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. Objective 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. Method 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. Results 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. Conclusion 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.
No takes yet. Share an insight, caveat, or question.
Pandini et al. (2026) studied this question.
Synapse has enriched 5 closely related papers on similar clinical questions. Consider them for comparative context: