Exploring Architectural Smells Detection Through LLMs
摘要
Architectural smells (AS) are design flaws in software systems that, if left unaddressed, can negatively impact maintainability and system evolution. This preliminary study investigates the use of Large Language Models (LLM) for detecting and explaining an AS called Hub-like Dependency (HL), a critical smell type characterized by components with numerous incoming and outgoing dependencies. The research leverages Google’s Gemini 1.5 Pro, comparing its performance to Arcan, a specialized AS detection tool. The study analyzes 135 AS across 39 open-source Java projects, including 100 Hub-like Dependency smells with varying severity levels and 35 non-Hub-like Dependency smells. Results show that the LLM achieves 100% recall but varying precision, with more detailed prompts improving detection performance from 64% to 82% for lower-severity smells. However, the model’s ability to generate human-understandable explanations remains limited, with only 49% of the generated explanations rated as satisfactory. These findings highlight both the potential and current limitations of one specific LLM in HL smell detection, suggesting the importance of prompt design in enhancing its capabilities.