用大模型自动化代码迁移,显著减少人工工作量。
Migrating Code At Scale With LLMs At Google
- 结合代码位置发现与大模型生成,自动完成代码修改。
- 39次迁移中74.45%的修改由大模型生成,共93,574行编辑。
- 开发者满意度高,预计节省50%迁移时间,适合大型团队参考。
开发者常通过内部变更对现有软件系统进行演进,称为迁移。例如迁移到新框架、优化实现以提升效率、升级依赖版本等。这类迁移通常是持续性的维护任务,传统上依赖人工或工具完成。某些迁移耗时长、成本高,且缺乏吸引力,可能需数年才能完成。因此,自动化成为首选。本文讨论谷歌一项大规模、高成本且传统上为手动的迁移项目,提出一种新型自动化算法,利用变更位置发现与大语言模型(LLM)辅助开发者完成迁移,报告了为期十二个月、三位开发者参与的39次迁移的大规模案例研究结果。结果显示,共提交595次代码变更,涉及93,574行编辑,其中74.45%的代码变更和69.46%的编辑由大模型生成。开发者对自动化工具高度满意,并估计相比以往手动迁移可节省约50%的时间。结果表明,该基于大模型的自动化工作流可为类似项目提供范例。
原文摘要 · Abstract (English)
Developers often evolve an existing software system by making internal changes, called migration. Moving to a new framework, changing implementation to improve efficiency, and upgrading a dependency to its latest version are examples of migrations. Migration is a common and typically continuous maintenance task undertaken either manually or through tooling. Certain migrations are labor intensive and costly, developers do not find the required work rewarding, and they may take years to complete. Hence, automation is preferred for such migrations. In this paper, we discuss a large-scale, costly and traditionally manual migration project at Google, propose a novel automated algorithm that uses change location discovery and a Large Language Model (LLM) to aid developers conduct the migration, report the results of a large case study, and discuss lessons learned. Our case study on 39 distinct migrations undertaken by three developers over twelve months shows that a total of 595 code changes with 93,574 edits have been submitted, where 74.45% of the code changes and 69.46% of the edits were generated by the LLM. The developers reported high satisfaction with the automated tooling, and estimated a 50% reduction on the total time spent on the migration compared to earlier manual migrations. Our results suggest that our automated, LLM-assisted workflow can serve as a model for similar initiatives.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。