一句话:系统研究神经程序修复中局部上下文配置对修复成功率的影响,并给出上下文窗口分配建议。
深度学习的源代码模型已被成功用于自动程序修复,但当前模型输入窗口较小,常无法容纳修复所需的完整项目上下文,因此输入通常局限于缺陷位置上下若干行的局部上下文。本文研究局部上下文对修复成功的重要性:需要多少局部上下文?缺陷位置之前与之后的上下文哪个更重要?局部上下文与缺陷类型有何关系?作者在三个数据集、两种编程语言上,以多种局部上下文配置训练和评估 Transformer 模型。结果表明,修复成功率总体上随局部上下文规模增大而提高(但并非所有缺陷类型都如此),并验证了约 50%--60% 输入窗口应留给缺陷之前上下文的常见做法。该结论对神经程序修复研究者及基准/数据集创建者均有参考价值。
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.