AI-Specific Code Smells: From Specification to Detection

Brahim Mahmoudi, Naouel Moha, Quentin Stiévenart, Florent Avellaneda
9/24/2025
cs.SEcs.AI

No confident code implementation found for this paper. 3 possible matches can be shown below.

Abstract

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).

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. 3 weaker matches are hidden by default — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{mahmoudi2025aispecific,
  title  = {AI-Specific Code Smells: From Specification to Detection},
  author = {Brahim Mahmoudi and Naouel Moha and Quentin Stiévenart and Florent Avellaneda},
  year   = {2025},
  eprint = {2509.20491},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2509.20491v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2509.20491.svg)](https://codeofpaper.com/paper/2509.20491)

Discussion