arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2312.04986cs.SEcs.AI
收藏

脱离上下文:局部上下文在神经程序修复中有多重要?

Out of Context: How important is Local Context in Neural Program Repair?

Free University of Bozen/Bolzano(博岑/博尔扎诺自由大学);Univ. Bordeaux(波尔多大学);CRNS(法国国家科学研究中心)

Julian Aron Prenner, Romain Robbes

AI总结:

本文通过在三个数据集、两种语言上以多种局部上下文配置训练和评估 Transformer,量化缺陷前后上下文对 APR 成功率及不同缺陷类型的影响。

摘要:

深度学习源代码模型已非常成功地应用于自动化程序修复问题。一个长期存在的问题是,当前模型的输入窗口较小,往往无法完整容纳修复缺陷所需的上下文代码(例如项目的方法或类声明)。因此,输入通常被限制在局部上下文,即缺陷位置上下方的代码行。在本研究中,我们考察这种局部上下文对修复成功的重要性:需要多少局部上下文?缺陷位置之前还是之后的上下文更重要?局部上下文如何与缺陷类型相关联?为回答这些问题,我们在三个数据集和两种编程语言上,以许多不同的局部上下文配置训练并评估 Transformer 模型。结果表明,总体修复成功率随局部上下文规模增大而提高(尽管并非对所有缺陷类型都是如此),并证实了通常做法:输入窗口中约 50%–60% 应用于缺陷之前的上下文。我们的结果不仅与研究基于 Transformer 的 APR 工具的人员相关,也与必须决定在数据集中包含何种上下文以及包含多少上下文的基准和数据集创建者相关。

英文摘要:

Deep learning source code models have been applied very successfully to the problem of automated program repair. One of the standing issues is the small input window of current models which often cannot fully fit the context code required for a bug fix (e.g., method or class declarations of a project). Instead, input is often restricted to the local context, that is, the lines below and above the bug location. In this work we study the importance of this local context on repair success: how much local context is needed?; is context before or after the bug location more important? how is local context tied to the bug type? To answer these questions we train and evaluate Transformer models in many different local context configurations on three datasets and two programming languages. Our results indicate that overall repair success increases with the size of the local context (albeit not for all bug types) and confirm the common practice that roughly 50-60% of the input window should be used for context leading the bug. Our results are not only relevant for researchers working on Transformer-based APR tools but also for benchmark and dataset creators who must decide what and how much context to include in their datasets.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑