Skip to main content
QUICK REVIEW

[论文解读] Revisiting ssFix for Better Program Repair

Xin Qi, Steven P. Reiss|arXiv (Cornell University)|Mar 11, 2019
Software Testing and Debugging Techniques参考文献 51被引用 4
一句话总结

该论文提出 sharpFix,一种改进的基于语法搜索的程序修复技术,通过优化代码搜索与复用策略,提升了 ssFix 的性能。通过针对性地搜索本地和外部代码,sharpFix 在 Defects4J 上修复了 36 个错误,并在 Bugs.jar-ELIXIR 上优于 ssFix 和其他四种 APR 技术,显著提升了修复效果,主要得益于更精准的代码检索与转换。

ABSTRACT

A branch of automated program repair (APR) techniques look at finding and reusing existing code for bug repair. ssFix is one of such techniques that is syntactic search-based: it searches a code database for code fragments that are syntactically similar to the bug context and reuses such retrieved code fragments to produce patches. Using such a syntactic approach, ssFix is relatively lightweight and was shown to outperform many other APR techniques. In this paper, to investigate the true effectiveness of ssFix, we conducted multiple experiments to validate ssFix's built-upon assumption (i.e., to see whether it is often possible to reuse existing code for bug repair) and evaluate its code search and code reuse approaches. Our results show that while the basic idea of ssFix, i.e., reusing existing code for bug repair, is promising, the approaches ssFix uses are not the best and can be significantly improved. We proposed a new repair technique sharpFix which follows ssFix's basic idea but differs in the code search and reuse approaches used. We evaluated sharpFix and ssFix on two bug datasets: Defects4J and Bugs.jar-ELIXIR. The results confirm that sharpFix is an improvement over ssFix. For the Defects4J dataset, sharpFix successfully repaired a total of 36 bugs and outperformed many existing repair techniques in repairing more bugs. For the Bugs.jar-ELIXIR dataset, we compared sharpFix, ssFix, and four other APR techniques, and found that sharpFix has the best repair performance. In essence, the paper shows how effective a syntactic search-based approach can be and what techniques should be used for such an approach.

研究动机与目标

  • 评估 ssFix 的基本假设:即修复错误所需的代码片段(正确代码片段)通常存在于现有代码中。
  • 评估 ssFix 在检索和复用现有代码片段以生成补丁方面的有效性。
  • 识别 ssFix 的代码搜索与复用机制中的局限性,这些局限性限制了其最优修复性能。
  • 设计并评估一种新的修复技术 sharpFix,该技术通过增强的搜索与复用策略,改进了 ssFix 的方法。
  • 证明当结合优化的搜索与转换技术时,基于语法搜索的修复可以非常有效。

提出的方法

  • 提出 sharpFix 作为 ssFix 的改进版本,保留了利用现有代码片段进行修复的核心思想。
  • 实现两种不同的代码搜索策略:一种用于本地程序代码,另一种用于外部代码仓库,以提高检索准确性。
  • 采用三步补丁生成流水线:代码转换、组件匹配(语义对齐)和代码修改,每一步均经过精度优化。
  • 应用语法相似性度量方法,识别与错误上下文相似的代码片段,重点关注结构和词汇特征。
  • 引入改进的匹配启发式方法,以在补丁合成过程中更准确地将检索到的代码片段与故障上下文对齐。
  • 采用保守的手动验证流程以确保补丁正确性,仅接受语义保持不变的转换。

实验结果

研究问题

  • RQ1修复代码片段(即可用于修复错误的代码片段)在本地或外部代码仓库中出现的频率如何?
  • RQ2ssFix 在多大程度上能够有效检索并复用现有代码片段以生成正确补丁?
  • RQ3ssFix 的代码搜索与复用机制中存在哪些关键局限性,导致其修复效果降低?
  • RQ4与 ssFix 相比,是否可以通过优化代码搜索与复用方法显著提升修复性能?
  • RQ5所提出的 sharpFix 技术在真实世界错误数据集上与其他最先进的 APR 技术相比表现如何?

主要发现

  • 修复代码片段存在于现有代码中的假设是成立的——修复所需的代码片段在本地和外部代码中均频繁出现。
  • ssFix 的代码搜索与复用机制表现欠佳,尽管修复代码片段存在,仍导致修复机会被遗漏。
  • sharpFix 在 Defects4J 数据集中成功修复了 36 个错误,比 ssFix 多修复 14 个,并优于四种其他 APR 技术。
  • 在 Bugs.jar-ELIXIR 数据集中,sharpFix 在所有评估技术中取得了最佳修复性能,包括 ssFix 和 ELIXIR。
  • 修复效果的提升源于更精准的代码检索与更准确的复用策略,而非更大的搜索空间或更高复杂度。
  • 尽管未使用错误报告信息,sharpFix 在 Defects4J 上仍优于 ELIXIR,但在 Bugs.jar-ELIXIR 上生成的正确补丁更少,表明结合此类信号仍有进一步优化空间。

更好的研究,从现在开始

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

无需绑定信用卡

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