Code Smells for Machine Learning Applications
Not on the map. Why?
Abstract (arXiv)
The popularity of machine learning has wildly expanded in recent years. Machine learning techniques have been heatedly studied in academia and applied in the industry to create business value. However, there is a lack of guidelines for code quality in machine learning applications. In particular, code smells have rarely been studied in this domain. Although machine learning code is usually integrated as a small part of an overarching system, it usually plays an important role in its core functionality. Hence ensuring code quality is quintessential to avoid issues in the long run. This paper proposes and identifies a list of 22 machine learning-specific code smells collected from various sources, including papers, grey literature, GitHub commits, and Stack Overflow posts. We pinpoint each smell with a description of its context, potential issues in the long run, and proposed solutions. In addition, we link them to their respective pipeline stage and the evidence from both academic and grey literature. The code smell catalog helps data scientists and developers produce and maintain high-quality machine learning application code.
Key facts. Cited by 8 papers in the map (data through 14 Oct 2026). Builds on 6 of its 58 references that are in the map. First posted on arXiv 25 Mar 2022.
Builds on
6 of 58 references.
References · 6
- 2019Taxonomy of Real Faults in Deep Learning Systemscited by 90
- 2019A Comprehensive Study on Deep Learning Bug Characteristicscited by 65
- 2020AI Lifecycle Models Need To Be Revised. An Exploratory Study in Fintechcited by 33
- 2020Code Smells and Refactoring: A Tertiary Systematic Review of Challenges and Observationscited by 18
- 2021The Prevalence of Code Smells in Machine Learning projectscited by 16
- 2020A large-scale comparative analysis of Coding Standard conformance in Open-Source Data Science projectscited by 9
Built on by
Citing papers per year: 2023: 1; 2024: 1; 2025: 4; 2026: 2.
8 papers.
- 2024PeaTMOSS: A Dataset and Initial Analysis of Pre-Trained Models in Open-Source Softwarecited by 9
- 2025MLScent A tool for Anti-pattern detection in ML projectscited by 2
- 2025Optimizing Token Consumption in LLMs: A Nano Surge Approach for Code Reasoning Efficiencycited by 2
- 2023PeaTMOSS: Mining Pre-Trained Models in Open-Source Softwarecited by 1
- 2025SpecDetect4ML: Detecting Non-Local ML Code Smells with Code Property Graphscited by 1
- 2025Analysing Python Machine Learning Notebooks with Moosecited by 0
- 2026LLM Code Smells: A Taxonomy and Detection Approachcited by 0
- 2026From AI Technical Debt to Agentic Technical Debt: A Systematic Mapping of Root Causes and Manifestations in Agentic AI Systemscited by 0
- 2026From AI Technical Debt to Agentic Technical Debt: A Systematic Mapping of Root Causes and Manifestations in Agentic AI Systems2 Aug 2026
- 2026LLM Code Smells: A Taxonomy and Detection Approach21 May 2026
- 2025SpecDetect4ML: Detecting Non-Local ML Code Smells with Code Property Graphs24 Sep 2025
- 2025Analysing Python Machine Learning Notebooks with Moose15 Sep 2025
- 2025Optimizing Token Consumption in LLMs: A Nano Surge Approach for Code Reasoning Efficiency22 Apr 2025
- 2025MLScent A tool for Anti-pattern detection in ML projects30 Jan 2025
- 2024PeaTMOSS: A Dataset and Initial Analysis of Pre-Trained Models in Open-Source Software1 Feb 2024
- 2023PeaTMOSS: Mining Pre-Trained Models in Open-Source Software5 Oct 2023