paperbot · PL 论文追踪

全部论文 待读 收藏

P2 AutoTransform

AutoTransform:面向代码审查的自动代码变换
ICSE Proceedings of the 44th International Conference on Software Engineering2022匹配度 2/10 · 该论文属于 PL 与机器学习交叉,但方向是代码审查场景下的代码变换(BPE + Transformer NMT),既不涉及静态分析/形式化验证,也不涉及浮点或贝叶斯程序分析,且方法基于传统 NMT 而非当前 LLM/Agent,与用户核心研究问题基本不重合。引用 95 inbox
Patanamon Thongtanunam, Chanathip Pornprasit, Chakkrit Tantithamthavorn
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出 AutoTransform,结合 BPE 与 Transformer NMT 自动将代码变换为审查通过的版本,显著超越先前工作。

代码审查有效但耗时,开发者需手工修改代码直至通过。已有工作用神经机器翻译(NMT)自动生成审查后的代码版本,但在出现新标识符/字面量或序列较长时性能不佳。AutoTransform 引入 Byte-Pair Encoding(BPE)处理新 token,并采用 Transformer 架构处理长序列。作者在 14,750 个变更方法上评估,涵盖有无新 token 及小/中规模。beam width=1 时,AutoTransform 正确变换 1,413 个方法,较先前工作提升 567%,表明该方法能显著改进代码审查场景下的自动代码变换,减少开发者手工修改成本。

问题
代码审查中开发者需手动修改代码直到通过,先前基于 NMT 的自动变换在新标识符/字面量或长代码序列上性能仍不理想。
方法
AutoTransform 使用 BPE 缓解新 token 问题,并用 Transformer 的 NMT 架构处理长序列,从而生成审查通过的代码版本。
评估
在 14,750 个变更方法(小/中规模,含/不含新 token)上评估;beam width=1 时正确变换 1,413 个方法,较先前工作提升 567%。
原文摘要(Abstract)

Code review is effective, but human-intensive (e.g., developers need to manually modify source code until it is approved). Recently, prior work proposed a Neural Machine Translation (NMT) approach to automatically transform source code to the version that is reviewed and approved (i.e., the after version). Yet, its performance is still suboptimal when the after version has new identifiers or literals (e.g., renamed variables) or has many code tokens. To address these limitations, we propose AutoTransform which leverages a Byte-Pair Encoding (BPE) approach to handle new tokens and a Transformer-based NMT architecture to handle long sequences. We evaluate our approach based on 14,750 changed methods with and without new tokens for both small and medium sizes. The results show that when generating one candidate for the after version (i.e., beam width = 1), our AUTOTRANSFORM can correctly transform 1,413 changed methods, which is 567% higher than the prior work, highlighting the substantial improvement of our approach for code transformation in the context of code review. This work contributes towards automated code transformation for code reviews, which could help developers reduce their effort in modifying source code during the code review process.

链接与引用

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

BibTeX
@inproceedings{ThongtanunamPT22,
  title = {AutoTransform},
  author = {Patanamon Thongtanunam and Chanathip Pornprasit and Chakkrit Tantithamthavorn},
  booktitle = {ICSE},
  year = {2022},
  doi = {10.1145/3510003.3510067}
}