Skip to main content
QUICK REVIEW

[论文解读] Code Smells in Machine Learning Systems

Jiri Gesi, Siqi Liu|arXiv (Cornell University)|Mar 2, 2022
Software Engineering Research被引用 12
一句话总结

本研究通过分析59个开源深度学习(DL)项目中的426次维护变更,识别并验证了五种新型深度学习(DL)系统特有的代码异味。采用混合定性与定量方法,研究证明这些DL特有代码异味(如混乱的模型架构和数据驱动的配置)普遍存在,并显著影响可维护性,尽管开发人员通常不认为它们是最常见的问题,但普遍认为其影响重大。

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.

研究动机与目标

  • 理解深度学习系统中与维护相关的代码修改的性质与频率。
  • 识别并描述与通用软件不同的、专属于深度学习系统的代码异味。
  • 通过与DL实践者的实证分析,验证这些代码异味的普遍性与感知影响。
  • 为提升DL领域代码质量、工具集成与软件工程教育提供可操作的见解。

提出的方法

  • 使用PythonChangeMiner和GitcProc从59个开源DL项目中收集426次与维护相关的代码变更,用于模式挖掘与错误修复过滤。
  • 对部分变更进行人工分析,以识别重复的修改模式,并将其归类为九种类别的维护相关活动。
  • 通过多名研究人员的定性编码,独立标注和分类变更,实现较高的评分者间一致性(kappa = 0.61–0.83)。
  • 将识别出的模式映射到五种专属于DL系统的新型代码异味,包括混乱的模型架构和数据驱动的配置。
  • 通过一项包含112名DL实践者的调查,验证这些代码异味的影响,调查问卷采用翻译版本以减少语言偏差。
  • 结合代码变更频率的定量分析与开发者的定性反馈,评估代码异味的普遍性与感知严重性。

实验结果

研究问题

  • RQ1在深度学习系统中,最频繁执行的维护修改类型是什么?
  • RQ2专属于深度学习系统的代码异味具有哪些特征?它们与通用软件中的代码异味有何不同?
  • RQ3从实际开发者的视角来看,这些新识别出的DL特有代码异味的普遍性和影响程度如何?
  • RQ4在现实的DL开发中,最频繁出现的代码异味在多大程度上与最具影响的代码异味一致?

主要发现

  • 在DL系统中识别出九类不同的维护修改类别,包括模型架构重构、数据流水线变更和配置管理。
  • 识别出五种专属于DL系统的新型代码异味:混乱的模型架构、数据驱动的配置、硬编码超参数、模型与数据紧耦合,以及不一致的模型版本管理。
  • 最频繁出现的代码异味并不一定最具影响——开发人员普遍认为混乱的模型架构和数据驱动的配置对可维护性破坏最大。
  • 对112名DL实践者的调查显示,这些代码异味被广泛认可,且显著影响代码可理解性与长期维护性。
  • 研究发现,这些DL系统中的代码异味在59个开源项目中普遍存在,表明其在开发工作流中存在系统性问题,亟需关注。
  • 结果表明,将代码异味检测集成到DL开发流水线中,可显著提升可维护性,尤其是当工具非侵入且具备上下文感知能力时。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。