paperbot · PL 论文追踪

全部论文 待读 收藏

P2 PyTER: effective program repair for Python type errors

PyTER:针对 Python 类型错误的有效程序修复
FSE Proceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering2022匹配度 3/10 · 论文属于自动程序修复与类型推断,使用动静结合分析修复 Python 类型错误,与用户核心关注的 AI/Agentic 程序静态分析、LLM 改进静态分析/形式化验证、浮点程序分析或贝叶斯程序分析均无直接交叉;仅在广义程序分析/类型系统方向上有弱关联。引用 20 inbox
Wonseok Oh, Hakjoo Oh
crossref: 2026-09-12

AI 速览

一句话:首个面向真实 Python 应用、基于动静结合类型推断差异定位并修复类型错误的自动程序修复技术。

Python 动态类型下的类型错误异常普遍且难以修复,但自动程序修复社区对此关注极少,尚无实用技术。本文提出 PyTER,首个专为修复真实 Python 应用中多样类型错误而设计的自动修复技术。其核心思路是结合动态分析与静态分析,分别推断程序变量“正确类型”与“错误类型”,并利用二者差异有效识别故障位置与补丁候选。作者从开源项目收集了 93 个类型错误进行评测,结果显示 PyTER 能够修复其中 48.4% 的错误,精确率为 77.6%。

问题
Python 中普遍存在的类型错误异常难以手动修复,而现有自动程序修复技术几乎未涉及动态类型语言的类型错误修复,缺乏实用方法。
方法
提出 PyTER,利用动态分析与静态分析推断程序变量的正确类型与错误类型,通过比较两者差异来定位故障位置并生成补丁候选。
评估
在从开源项目收集的 93 个 Python 类型错误上评测,PyTER 修复了 48.4% 的错误,精确率为 77.6%。
原文摘要(Abstract)

We present PyTER, an automated program repair (APR) technique for Python type errors. Python developers struggle with type error exceptions that are prevalent and difficult to fix. Despite the importance, however, automatically repairing type errors in dynamically typed languages such as Python has received little attention in the APR community and no existing techniques are readily available for practical use. PyTER is the first technique that is carefully designed to fix diverse type errors in real-world Python applications. To this end, we present a novel APR approach that uses dynamic and static analyses to infer correct and incorrect types of program variables, and leverage their difference to effectively identify faulty locations and patch candidates. We evaluated PyTER on 93 type errors collected from open-source projects. The result shows that PyTER is able to fix 48.4% of them with a precision of 77.6%.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot7124,
  title = {PyTER: effective program repair for Python type errors},
  author = {Wonseok Oh and Hakjoo Oh},
  booktitle = {FSE},
  year = {2022},
  doi = {10.1145/3540250.3549130}
}