The Prevalence of Code Smells in Machine Learning projects

Bart van Oort, Luís Cruz, Maurício Aniche, Arie van Deursen
3/6/2021
cs.SEcs.AIcs.LG

No confident code implementation found for this paper.

Abstract

Artificial Intelligence (AI) and Machine Learning (ML) are pervasive in the current computer science landscape. Yet, there still exists a lack of software engineering experience and best practices in this field.

Show full abstract

One such best practice, static code analysis, can be used to find code smells, i.e., (potential) defects in the source code, refactoring opportunities, and violations of common coding standards. Our research set out to discover the most prevalent code smells in ML projects. We gathered a dataset of 74 open-source ML projects, installed their dependencies and ran Pylint on them. This resulted in a top 20 of all detected code smells, per category. Manual analysis of these smells mainly showed that code duplication is widespread and that the PEP8 convention for identifier naming style may not always be applicable to ML code due to its resemblance with mathematical notation. More interestingly, however, we found several major obstructions to the maintainability and reproducibility of ML projects, primarily related to the dependency management of Python projects. We also found that Pylint cannot reliably check for correct usage of imported dependencies, including prominent ML libraries such as PyTorch.

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. Any repos shown below are weak matches — 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{oort2021prevalence,
  title  = {The Prevalence of Code Smells in Machine Learning projects},
  author = {Bart van Oort and Luís Cruz and Maurício Aniche and Arie van Deursen},
  year   = {2021},
  eprint = {2103.04146},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2103.04146}
}

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/2103.04146.svg)](https://codeofpaper.com/paper/2103.04146)

Discussion