paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Last Diff Analyzer: Multi-language Automated Approver for Behavior-Preserving Code Revisions

Last Diff Analyzer:面向行为保持代码修订的多语言自动批准器
FSE Proceedings of the 31st ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2023匹配度 4/10 · 该论文属于静态分析与程序分析在工业界的工程落地,关注多语言、行为保持的代码 diff 自动审批,与用户对静态分析工程的兴趣有一定重合;但其核心不涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析,与当前重点研究方向没有直接交叉。引用 2 inbox
Yuxin Wang, Adam Welc, Lazaro Clapp, Lingchao Chen
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出多语言静态分析框架与自动审批器,判定代码 diff 是否仅含不改变行为的改动。

大规模项目每天提交大量代码变更,人工审查耗时耗资源,但其中不少 diff 仅包含格式调整、变量/函数重命名、常量提取等不改变系统行为的语法修改。本文提出面向 Go 和 Java 的多语言自动代码批准器 Last Diff Analyzer,用于检测一个可审查的增量代码变更单元(diff)是否只包含不修改系统行为的改动。其核心是一个新型多语言静态分析框架,统一多语言的共有特性,同时隔离各语言独有构造,从而便于扩展到 TypeScript、Kotlin、Swift 等语言。除跳过不必要的人工审查外,该工具还可用于跳过自动批准 diff 对应的资源密集型端到端(E2E)测试。该分析器已在 Uber 规模化部署,生产数据显示每周约 15% 的被分析 diff 被自动批准用于代码审查;同时,跳过 E2E 测试使专用于 E2E 测试的服务器节点用量(按执行的 E2E 测试数计)相比未启用时降低 13.5%。

问题
大规模软件项目中大量 diff 只含格式、重命名、常量提取等不改变行为的语法改动,却仍需人工审查并触发昂贵的端到端测试,造成时间和资源浪费。
方法
构建面向 Go 和 Java 的多语言静态分析框架,统一多语言共有特性并隔离语言独有构造,据此判断 diff 是否仅含行为保持改动并自动批准,同时可跳过对应 E2E 测试。
评估
在 Uber 内部规模化部署,统计生产环境中被自动批准的 diff 比例(约 15%/周)以及跳过 E2E 测试带来的服务器节点用量下降(13.5%)。
原文摘要(Abstract)

Code review is a crucial step in ensuring the quality and maintainability of software systems. However, this process can be time-consuming and resource-intensive, especially in large-scale projects where a significant number of code changes are submitted every day. Fortunately, not all code changes require human reviews, as some may only contain syntactic modifications that do not alter the behavior of the system, such as format changes, variable / function renamings, and constant extractions. In this paper, we propose a multi-language automated code approver — Last Diff Analyzer for Go and Java, which is able to detect if a reviewable incremental unit of code change (diff) contains only changes that do not modify system behavior. It is built on top of a novel multi-language static analysis framework that unifies common features of multiple languages while keeping unique language constructs separate. This makes it easy to extend to other languages such as TypeScript, Kotlin, Swift, and others. Besides skipping unnecessary code reviews, Last Diff Analyzer could be further applied to skip certain resource-intensive end-to-end (E2E) tests for auto-approved diffs for significant reduction of resource usage. We have deployed the analyzer at scale within Uber, and data collected in production shows that approximately 15% of analyzed diffs are auto-approved weekly for code reviews. Furthermore, 13.5% reduction in server node usage dedicated to E2E tests (measured by number of executed E2E tests) is observed as a result of skipping E2E tests, compared to the node usage if Last Diff Analyzer were not enabled.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@inproceedings{WangWCC23,
  title = {Last Diff Analyzer: Multi-language Automated Approver for Behavior-Preserving Code Revisions},
  author = {Yuxin Wang and Adam Welc and Lazaro Clapp and Lingchao Chen},
  booktitle = {FSE},
  year = {2023},
  doi = {10.1145/3611643.3613870}
}