一句话:首个针对大规模 Python ML 系统的细粒度重复代码变更挖掘,揭示 22 类模式组与四大趋势。
Python 机器学习系统虽然流行,但人们尚不清楚 ML 开发者会做哪些重复性代码变更,这限制了自动化、工具支持与最佳实践传播。本文对 1000 个高评分 ML 系统(5800 万行代码)开展首个细粒度代码变更模式研究。作者复用、调整并改进重复变更挖掘技术,实现 R-CPATMINER,从超过 400 万次提交中构建 35 万个细粒度变更图,并检测出 2.8 万个变更模式。通过主题分析,他们归纳出 22 个模式组,揭示 ML 开发者修改代码的四大趋势。基于对 650 名 ML 开发者(回复率 15%)的调查,作者进一步解释这些模式,并为研究者、工具构建者、ML 库供应商以及开发者与教育者提出可操作的实证启示。
Over the years, researchers capitalized on the repetitiveness of software changes to automate many software evolution tasks. Despite the extraordinary rise in popularity of Python-based ML systems, they do not benefit from these advances. Without knowing what are the repetitive changes that ML developers make, researchers, tool, and library designers miss opportunities for automation, and ML developers fail to learn and use best coding practices. To fill the knowledge gap and advance the science and tooling in ML software evolution, we conducted the first and most fine-grained study on code change patterns in a diverse corpus of 1000 top-rated ML systems comprising 58 million SLOC. To conduct this study we reuse, adapt, and improve upon the state-of-the-art repetitive change mining techniques. Our novel tool, R-CPATMINER, mines over 4M commits and constructs 350K fine-grained change graphs and detects 28K change patterns. Using thematic analysis, we identified 22 pattern groups and we reveal 4 major trends of how ML developers change their code. We surveyed 650 ML developers to further shed light on these patterns and their applications, and we received a 15% response rate. We present actionable, empirically-justified implications for four audiences: (i) researchers, (ii) tool builders, (iii) ML library vendors, and (iv) developers and educators.