paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Type Migration in Ultra-Large-Scale Codebases

超大规模代码库中的类型迁移
ICSE 2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE)2019匹配度 3/10 · 该论文属于大规模代码重构与静态分析系统,虽与程序分析/PL 相关,但未涉及用户核心关注的 LLM/Agent 与静态分析交叉、浮点程序分析或贝叶斯程序分析。其工业级可扩展性可作为背景参考,但研究方向匹配度较低。引用 19 inbox
Ameya Ketkar, Ali Mesbah, Davood Mazinanian, Danny Dig, Edward Aftandilian
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:用图表示加 MapReduce 实现可扩展至数亿行代码的类型迁移重构,98% 生成补丁被接受。

类型迁移是一种重构,把源码中的某个类型整体替换为另一个类型。手工完成十分繁琐,程序员必须找出该类型的所有出现位置,以及沿赋值操作、方法层次与子类型传播的依赖。已有自动化方法执行代价高昂的整程序分析,无法扩展到超大规模代码库。本文提出把程序的类型结构表示为图,并据此采用 MapReduce 并行分布式流程,使其可扩展至数亿行代码。作者实现了与 IDE 无关、可集成多数构建系统的工具 T2R,并在七个开源项目与一个 3 亿行(300M LOC)的专有代码库上评估准确性、有用性与可扩展性。T2R 共生成 130 个类型迁移补丁,其中 98% 被原开发者接受。

问题
手工类型迁移繁琐且易错,而现有自动化方法依赖不可扩展的整程序分析,难以应用于超大规模代码库。
方法
将程序的类型结构建模为图,并用 MapReduce 并行分布式流程传播类型迁移,实现与 IDE 无关、可集成多数构建系统的工具 T2R。
评估
在七个开源项目和一个 300M LOC 专有代码库上评估准确性、有用性与可扩展性;生成的 130 个类型迁移补丁中 98% 被原开发者接受。
原文摘要(Abstract)

Type migration is a refactoring activity in which an existing type is replaced with another one throughout the source code. Manually performing type migration is tedious as programmers need to find all instances of the type to be migrated, along with its dependencies that propagate over assignment operations, method hierarchies, and subtypes. Existing automated approaches for type migration are not adequate for ultra-large-codebases - they perform an intensive whole-program analysis that does not scale. If we could represent the type structure of the program as graphs, then we could employ a MAPREDUCE parallel and distributed process that scales to hundreds of millions of LOC. We implemented this approach as an IDE-independent tool called T2R, which integrates with most build systems. We evaluated T2R's accuracy, usefulness and scalability on seven open source projects and one proprietary codebase of 300M LOC. T2R generated 130 type migration patches, of which the original developers accepted 98%.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{Ketkar0MDA19,
  title = {Type Migration in Ultra-Large-Scale Codebases},
  author = {Ameya Ketkar and Ali Mesbah and Davood Mazinanian and Danny Dig and Edward Aftandilian},
  booktitle = {ICSE},
  year = {2019},
  doi = {10.1109/icse.2019.00117}
}