The emergence of open-source ML libraries such as TensorFlow and Google Auto ML has enabled developers to harness state-of-the-art ML algorithms with minimal overhead. However, during this accelerated ML development process, said developers may often make sub-optimal design and implementation decisions, leading to the introduction of technical debt that, if not addressed promptly, can have a significant impact on the quality of the ML-based software. Developers frequently acknowledge these sub-optimal design and development choices through code comments during software development. These comments, which often highlight areas requiring additional work or refinement in the future, are known as self-admitted technical debt (SATD). This paper aims to investigate SATD in ML code by analyzing 318 open-source ML projects across five domains, along with 318 non-ML projects. We detected SATD in source code comments throughout the different project snapshots, conducted a manual analysis of the identified SATD sample to comprehend the nature of technical debt in the ML code, and performed a survival analysis of the SATD to understand the evolution of such debts. We observed: i) Machine learning projects have a median percentage of SATD that is twice the median percentage of SATD in non-machine learning projects. ii) ML pipeline components for data preprocessing and model generation logic are more susceptible to debt than model validation and deployment components. iii) SATDs appear in ML projects earlier in the development process compared to non-ML projects. iv) Long-lasting SATDs are typically introduced during extensive code changes that span multiple files exhibiting low complexity.
翻译:随着TensorFlow和Google Auto ML等开源机器学习库的出现,开发者能够以最小开销利用最先进的机器学习算法。然而,在这种加速的机器学习开发过程中,开发者常会做出次优的设计与实现决策,导致技术债务的引入;若未及时处理,这些债务可能对基于机器学习的软件质量产生重大影响。在软件开发过程中,开发者经常通过代码注释来承认这些次优的设计与开发选择。这些通常强调未来需要额外工作或改进的注释,被称为自承认技术债务(SATD)。本文旨在通过分析五个领域的318个开源机器学习项目及318个非机器学习项目,研究机器学习代码中的SATD。我们在不同项目快照的源代码注释中检测SATD,对识别出的SATD样本进行手动分析以理解机器学习代码中技术债务的本质,并对SATD进行生存分析以了解此类债务的演变。我们观察到:i) 机器学习项目的SATD中位数百分比是非机器学习项目的两倍。ii) 数据预处理和模型生成逻辑的机器学习流水线组件比模型验证和部署组件更容易产生债务。iii) 与非机器学习项目相比,SATD在机器学习项目中更早出现在开发过程中。iv) 长期存在的SATD通常是在涉及多个文件、复杂度较低的广泛代码变更期间引入的。