Skip to main content
QUICK REVIEW

[论文解读] Test Case Generation for Program Repair: A Study of Feasibility and Effectiveness

Zhongxing Yu, Matías Martínez|arXiv (Cornell University)|Mar 1, 2017
Software Testing and Debugging Techniques参考文献 32被引用 20
一句话总结

本文研究了自动化测试用例生成是否能通过提出两种定制化方法——针对生成与验证工具的MinImpact,以及针对合成式工具的UnsatGuided——来减少基于测试套件的程序修复中的过拟合问题。在224个Defects4J缺陷上的评估表明,测试用例生成虽然改变了生成的补丁,但未能显著提高修复的正确性或消除过拟合,凸显了需要开发面向修复的测试生成技术。

ABSTRACT

Among the many different kinds of program repair techniques, one widely studied family of techniques is called test suite based repair. Test-suites are in essence input-output specifications and are therefore typically inadequate for completely specifying the expected behavior of the program under repair. Consequently, the patches generated by test suite based program repair techniques pass the test suite, yet may be incorrect. Patches that are overly specific to the used test suite and fail to generalize to other test cases are called overfitting patches. In this paper, we investigate the feasibility and effectiveness of test case generation in alleviating the overfitting issue. We propose two approaches for using test case generation to improve test suite based repair, and perform an extensive evaluation of the effectiveness of the proposed approaches in enabling better test suite based repair on 224 bugs of the Defects4J repository. The results indicate that test case generation can change the resulting patch, but is not effective at turning incorrect patches into correct ones. We identify the problems related with the ineffectiveness, and anticipate that our results and findings will lead to future research to build test-case generation techniques that are tailored to automatic repair systems.

研究动机与目标

  • 研究通过自动化的测试用例生成来减少基于测试套件的程序修复中过拟合问题的可行性和有效性。
  • 解决测试套件作为不完整规格说明所导致的缺陷:即生成过于具体、错误的补丁。
  • 设计并评估两种方法——MinImpact与UnsatGuided——分别将生成的测试用例集成到生成与验证类工具(如jGenProg)和合成式工具(如Nopol)的修复流程中。
  • 评估测试用例生成是否能提升自动化生成补丁的正确性和泛化能力。
  • 识别将测试生成与自动化修复集成过程中面临的关键挑战,并为未来研究提供指导。

提出的方法

  • 提出MinImpact方法,通过筛选掉会拒绝有效补丁的测试用例,选择对生成补丁影响最小的测试用例,以最小化其在生成与验证类修复工具(如jGenProg)中的影响。
  • 提出UnsatGuided方法,专为合成式工具(如Nopol)设计,利用不可满足性推理来指导测试用例选择,避免使正确补丁失效。
  • 采用EvoSuite作为测试用例生成器,以存在缺陷的程序版本作为测试用例的判定依据,生成能检测修复后代码回归的测试用例。
  • 将所提方法应用于Defects4J代码库中的224个真实Java缺陷,使用jGenProg(生成与验证类)和Nopol(合成式)工具评估修复结果。
  • 通过比较测试用例集成前后补丁的正确性、泛化能力以及拒绝过拟合补丁的能力,衡量方法的有效性。
  • 分析测试用例生成的性能开销,并评估将生成的测试用例简单注入修复流程是否能改善修复结果。

实验结果

研究问题

  • RQ1通过提升补丁的泛化能力,测试用例生成能否减少基于测试套件的程序修复中的过拟合问题?
  • RQ2MinImpact与UnsatGuided方法在提升生成与验证类及合成式修复工具中生成测试用例集成方面有何改进?
  • RQ3测试用例生成在多大程度上改变了自动化修复工具的输出?其是否提升了生成补丁的正确性?
  • RQ4将测试生成与自动化修复集成过程中面临的关键挑战是什么?为何简单的测试注入方法无效?
  • RQ5在修复流程中使用测试生成时,其性能开销是否可接受?

主要发现

  • 测试用例生成显著改变了程序修复工具的输出,生成的补丁与仅使用原始测试套件相比存在明显差异。
  • 尽管改变了补丁内容,测试用例生成对提升最终补丁的正确性或消除过拟合几乎没有影响。
  • 将生成的测试用例简单地注入修复流程无法改善修复结果,凸显了需要像MinImpact与UnsatGuided这类专门设计的集成策略。
  • 测试用例生成引入的性能开销在实际修复流程中被认为是可接受的。
  • 本研究识别出当前测试生成与修复协同机制的根本局限,表明未来测试生成技术必须专门针对自动化修复进行定制。
  • 结果表明,尽管测试用例生成会影响修复过程,但若未与修复逻辑进行深度集成,仅靠测试生成不足以确保补丁的正确性或泛化能力。

更好的研究,从现在开始

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

无需绑定信用卡

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