Skip to main content
QUICK REVIEW

[Paper Review] Code Smells in Machine Learning Systems

Jiri Gesi, Siqi Liu|arXiv (Cornell University)|Mar 2, 2022
Software Engineering ResearchComputer Science12 citations
TL;DR

This study identifies and validates five novel code smells specific to deep learning (DL) systems through analysis of 426 maintenance changes across 59 open-source DL projects. Using mixed qualitative and quantitative methods, it demonstrates that these DL-specific code smells—such as Jumbled Model Architecture and Data-Driven Configuration—are prevalent and significantly impact maintainability, with developers identifying them as high-impact issues despite not always being the most frequent.

ABSTRACT

As Deep learning (DL) systems continuously evolve and grow, assuring their quality becomes an important yet challenging task. Compared to non-DL systems, DL systems have more complex team compositions and heavier data dependency. These inherent characteristics would potentially cause DL systems to be more vulnerable to bugs and, in the long run, to maintenance issues. Code smells are empirically tested as efficient indicators of non-DL systems. Therefore, we took a step forward into identifying code smells, and understanding their impact on maintenance in this comprehensive study. This is the first study on investigating code smells in the context of DL software systems, which helps researchers and practitioners to get a first look at what kind of maintenance modification made and what code smells developers have been dealing with. Our paper has three major contributions. First, we comprehensively investigated the maintenance modifications that have been made by DL developers via studying the evolution of DL systems, and we identified nine frequently occurred maintenance-related modification categories in DL systems. Second, we summarized five code smells in DL systems. Third, we validated the prevalence, and the impact of our newly identified code smells through a mixture of qualitative and quantitative analysis. We found that our newly identified code smells are prevalent and impactful on the maintenance of DL systems from the developer's perspective.

Motivation & Objective

  • To understand the nature and frequency of maintenance-related code modifications in deep learning systems.
  • To identify and characterize code smells unique to deep learning systems, distinct from general-purpose software.
  • To validate the prevalence and perceived impact of these code smells through empirical analysis with DL practitioners.
  • To provide actionable insights for improving code quality, tool integration, and software engineering education in the DL domain.

Proposed method

  • Collected 426 maintenance-related code changes from 59 open-source DL projects using PythonChangeMiner and GitcProc for pattern mining and bug fix filtering.
  • Conducted manual analysis on a subset of changes to identify recurring modification patterns and group them into nine maintenance-related categories.
  • Used qualitative coding by multiple researchers to independently label and categorize changes, achieving substantial inter-rater agreement (kappa = 0.61–0.83).
  • Mapped identified patterns to five novel code smells specific to DL systems, including Jumbled Model Architecture and Data-Driven Configuration.
  • Validated the impact of these code smells through a survey with 112 DL practitioners, including translated versions to reduce language bias.
  • Combined quantitative analysis of code change frequency with qualitative developer feedback to assess both prevalence and perceived severity of code smells.

Experimental results

Research questions

  • RQ1What types of maintenance modifications are most frequently performed in deep learning systems?
  • RQ2What are the characteristics of code smells that are unique to deep learning systems, and how do they differ from general-purpose code smells?
  • RQ3How prevalent and impactful are these newly identified DL-specific code smells from the perspective of practicing developers?
  • RQ4To what extent do the most frequent code smells align with the most impactful ones in real-world DL development?

Key findings

  • Nine distinct maintenance modification categories were identified in DL systems, including model architecture refactoring, data pipeline changes, and configuration management.
  • Five novel code smells specific to DL systems were identified: Jumbled Model Architecture, Data-Driven Configuration, Hardcoded Hyperparameters, Model-Data Coupling, and Inconsistent Model Versioning.
  • The most frequently occurring code smells were not necessarily the most impactful—developers perceived Jumbled Model Architecture and Data-Driven Configuration as the most detrimental to maintainability.
  • A survey of 112 DL practitioners confirmed that these code smells are widely recognized and significantly affect code comprehensibility and long-term maintenance.
  • The study found that code smells in DL systems are prevalent across 59 open-source projects, indicating a systemic issue requiring attention in development workflows.
  • The results suggest that integrating code smell detection into DL development pipelines could improve maintainability, especially when tools are non-intrusive and context-aware.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.