一句话:提出用类型错误修复模板增强提示,将领域知识注入代码预训练模型,以自动修复 Python 类型错误。
Python 的动态类型系统虽然便于开发,却使运行时类型错误普遍且难以修复。基于规则的方法依赖专家设计补丁合成模板,能对模板覆盖的错误生成准确补丁,但模板对真实世界类型错误的覆盖有限;基于学习的方法减轻了人工规则设计负担,其中基于提示(prompt)的方法在通用程序修复任务上取得先进效果,但提示由人工定义,未包含 Python 类型错误修复的特定线索,因而效果受限。本文研究如何利用领域知识自动改进提示,具体以修复模板(fix templates)将类型错误修复知识注入代码预训练模型,用于修复 Python 类型错误。摘要未给出具体数据集、基线或量化结果。
As a dynamic programming language, Python has become increasingly popular in recent years. Although the dynamic type system of Python facilitates the developers in writing Python programs, it also brings type errors at run-time which are prevalent yet not easy to fix. There exist rule-based approaches for automatically repairing Python type errors. The approaches can generate accurate patches for the type errors covered by manually defined templates, but they require domain experts to design patch synthesis rules and suffer from low template coverage of real-world type errors. Learning-based approaches alleviate the manual efforts in designing patch synthesis rules and have become prevalent due to the recent advances in deep learning. Among the learning-based approaches, the prompt-based approach which leverages the knowledge base of code pre-trained models via pre-defined prompts, obtains state-of-the-art performance in general program repair tasks. However, such prompts are manually defined and do not involve any specific clues for repairing Python type errors, resulting in limited effectiveness. How to automatically improve prompts with the domain knowledge for type error repair is challenging yet under-explored.
DOI 原文 ·
@inproceedings{paperbot11461,
title = {Domain Knowledge Matters: Improving Prompts with Fix Templates for Repairing Python Type Errors},
author = {Yun Peng and Shuzheng Gao and Cuiyun Gao and Yintong Huo and Michael Lyu},
booktitle = {ICSE},
year = {2024},
doi = {10.1145/3597503.3608132}
}