The Prevalence of Code Smells in Machine Learning projects

B. V. Oort, L. Cruz, M. Aniche, A. Deursen
{"title":"The Prevalence of Code Smells in Machine Learning projects","authors":"B. V. Oort, L. Cruz, M. Aniche, A. Deursen","doi":"10.1109/WAIN52551.2021.00011","DOIUrl":null,"url":null,"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.","PeriodicalId":224912,"journal":{"name":"2021 IEEE/ACM 1st Workshop on AI Engineering - Software Engineering for AI (WAIN)","volume":"30 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2021-03-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"16","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2021 IEEE/ACM 1st Workshop on AI Engineering - Software Engineering for AI (WAIN)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/WAIN52551.2021.00011","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 16

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.
机器学习项目中代码气味的流行
人工智能(AI)和机器学习(ML)在当前的计算机科学领域无处不在。然而,在这一领域仍然缺乏软件工程经验和最佳实践。一个这样的最佳实践,静态代码分析,可以用来发现代码的气味,例如,源代码中的(潜在的)缺陷,重构的机会,以及对通用编码标准的违反。我们的研究旨在发现机器学习项目中最普遍的代码气味。我们收集了74个开源ML项目的数据集,安装了它们的依赖项,并在其上运行Pylint。这就产生了每个类别检测到的前20个代码气味。对这些气味的手工分析主要表明,代码重复是普遍存在的,并且标识符命名风格的PEP8约定可能并不总是适用于ML代码,因为它与数学符号相似。然而,更有趣的是,我们发现了ML项目的可维护性和可再现性的几个主要障碍,主要与Python项目的依赖管理有关。我们还发现Pylint不能可靠地检查导入依赖项的正确使用,包括PyTorch等著名的ML库。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信