AI-Specific Code Smells: From Specification to Detection
Mahmoudi, Brahim, Moha, Naouel, Stiévenart, Quentin, Avellaneda, Florent
–arXiv.org Artificial Intelligence
The rise of Artificial Intelligence (AI) is reshaping how software systems are developed and maintained. However, AI-based systems give rise to new software issues that existing detection tools often miss. Among these, we focus on AI-specific code smells, recurring patterns in the code that may indicate deeper problems such as unreproducibility, silent failures, or poor model generalization. We introduce SpecDetect4AI, a tool-based approach for the specification and detection of these code smells at scale. This approach combines a high-level declarative Domain-Specific Language (DSL) for rule specification with an extensible static analysis tool that interprets and detects these rules for AI-based systems. We specified 22 AI-specific code smells and evaluated SpecDetect4AI on 826 AI-based systems (20M lines of code), achieving a precision of 88.66% and a recall of 88.89%, outperforming other existing detection tools. Our results show that SpecDetect4AI supports the specification and detection of AI-specific code smells through dedicated rules and can effectively analyze large AI-based systems, demonstrating both efficiency and extensibility (SUS 81.7/100).
arXiv.org Artificial Intelligence
Dec-12-2025
- Country:
- Asia
- Middle East > Israel (0.04)
- Singapore > Central Region
- Singapore (0.04)
- Europe > Portugal
- North America
- Canada > Quebec
- Montreal (0.05)
- United States
- California > Los Angeles County
- Los Angeles (0.14)
- New York > New York County
- New York City (0.04)
- Pennsylvania
- Allegheny County > Pittsburgh (0.04)
- Philadelphia County > Philadelphia (0.04)
- California > Los Angeles County
- Canada > Quebec
- Oceania > Australia
- Asia
- Genre:
- Research Report > New Finding (1.00)
- Industry:
- Education (0.46)
- Technology: