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