The Prevalence of Code Smells in Machine Learning Projects

Conference Paper (2021)
Author(s)

B. van Oort (Student TU Delft)

Luís Cruz (TU Delft - Software Engineering)

Maurício Aniche (TU Delft - Software Engineering)

Arie van Van Deursen (TU Delft - Software Technology)

Research Group
Software Engineering
Copyright
© 2021 B. van Oort, Luis Cruz, Maurício Aniche, A. van Deursen
DOI related publication
https://doi.org/10.1109/WAIN52551.2021.00011
More Info
expand_more
Publication Year
2021
Language
English
Copyright
© 2021 B. van Oort, Luis Cruz, Maurício Aniche, A. van Deursen
Research Group
Software Engineering
Pages (from-to)
35-42
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

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

Files

The_Prevalence_of_Code_Smells_... (pdf)
(pdf | 0.58 Mb)
- Embargo expired in 19-01-2022
License info not available