Skip to main content
QUICK REVIEW

[论文解读] FixEval: Execution-based Evaluation of Program Fixes for Programming Problems

Md Mahim Anjum Haque, Wasi Uddin Ahmad|arXiv (Cornell University)|Jun 15, 2022
Software Engineering Research被引用 5
一句话总结

FixEval 提出了一种新颖的基准,通过在真实竞赛编程提交上使用基于执行的测试来评估程序修复模型,表明基于执行的评估方法在评估生成修复的功能正确性方面优于传统的匹配度度量方法。该数据集包含 700 个 Python 和 Java 问题,附带单元测试、时间/内存限制以及执行结果反馈,可实现对模型生成补丁的稳健评估。

ABSTRACT

The complexity of modern software has led to a drastic increase in the time and cost associated with detecting and rectifying software bugs. In response, researchers have explored various methods to automatically generate fixes for buggy code. However, due to the large combinatorial space of possible fixes for any given bug, few tools and datasets are available to evaluate model-generated fixes effectively. To address this issue, we introduce FixEval, a benchmark comprising of buggy code submissions to competitive programming problems and their corresponding fixes. FixEval offers an extensive collection of unit tests to evaluate the correctness of model-generated program fixes and assess further information regarding time, memory constraints, and acceptance based on a verdict. We consider two Transformer language models pretrained on programming languages as our baseline and compare them using match-based and execution-based evaluation metrics. Our experiments show that match-based metrics do not reflect model-generated program fixes accurately. At the same time, execution-based methods evaluate programs through all cases and scenarios designed explicitly for that solution. Therefore, we believe FixEval provides a step towards real-world automatic bug fixing and model-generated code evaluation. The dataset and models are open-sourced at https://github.com/mahimanzum/FixEval.

研究动机与目标

  • 为解决在真实世界场景中评估自动化程序修复模型缺乏全面基准的问题。
  • 提供一组包含单元测试、时间/内存限制以及执行结果反馈的有错误和修复后的程序对数据集,以实现准确评估。
  • 比较基于匹配度的评估指标与基于执行的评估指标在评估模型生成代码修复时的表现。
  • 证明基于执行的评估更能反映功能正确性,优于传统的相似度度量方法。
  • 支持未来在代码修复、代码补全以及反馈驱动模型训练方面的研究。

提出的方法

  • 从 AtCoder 和 Aizu Online Judge 收集 700 个竞赛编程问题,涵盖 Python 和 Java 中的有错误和已通过的解决方案。
  • 每个问题包含 25 个单元测试,用于评估生成修复的功能正确性。
  • 整合时间与内存限制以及执行结果反馈(例如:答案错误、编译错误)作为模型的输入上下文。
  • 在 FixEval 数据集上微调两个预训练的序列到序列模型——PLBART 和 CodeT5——用于程序修复。
  • 使用基于匹配度的度量(如 BLEU、CodeBLEU)和通过测试套件执行的基于执行的度量来评估模型输出。
  • 分析解码策略(贪婪解码、束搜索、核采样)以及执行结果信息对修复质量的影响。

实验结果

研究问题

  • RQ1基于匹配度的评估指标与基于执行的评估指标在评估模型生成的程序修复正确性方面有何差异?
  • RQ2访问执行结果反馈(如答案错误、编译错误)在多大程度上提升了生成修复的质量?
  • RQ3不同的解码策略(贪婪解码、束搜索、核采样)如何影响程序修复模型在 FixEval 上的表现?
  • RQ4包括时间/内存限制和测试用例反馈在内的模型输入上下文对修复生成准确率有何影响?
  • RQ5任务难度和编辑相似度如何影响自动化程序修复模型的性能?

主要发现

  • 使用单元测试的基于执行的评估显著优于 BLEU 和 CodeBLEU 等基于匹配度的度量方法,在识别功能正确修复方面表现更优。
  • 提供执行结果反馈(如答案错误)的模型生成的修复更加准确且上下文相关,优于未提供反馈的模型。
  • 束搜索解码始终优于贪婪解码和核采样,尽管性能提升有限。
  • 带有执行结果输入的模型避免了添加语法正确但语义错误的代码,从而减少了修复中的噪声。
  • FixEval 捕捉了现实世界中的修复挑战,包括复杂性约束和边界情况,使其适用于评估实际的程序修复系统。
  • 该基准揭示,尽管部分修复较为简单,但许多修复需要对逻辑和约束有深入理解,凸显了对强大评估方法的需求。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。