Skip to main content
QUICK REVIEW

[论文解读] Fast and Precise On-the-fly Patch Validation for All

Lingchao Chen, Lingming Zhang|arXiv (Cornell University)|Jul 22, 2020
Software Testing and Debugging Techniques参考文献 54被引用 4
一句话总结

本文提出UniAPR,一种统一的实时补丁验证框架,通过重用JVM会话并在补丁执行之间精确重置JVM全局状态,从而加速字节码级和源代码级自动化程序修复(APR)。与以往工作不同,UniAPR在不牺牲正确性的情况下,消除了状态污染带来的不精确性,同时相比最先进的APR工具实现了超过10倍的加速。

ABSTRACT

Generate-and-validate (G&V) automated program repair (APR) techniques have been extensively studied during the past decade. Meanwhile, such techniques can be extremely time-consuming due to manipulation of the program code to fabricate a large number of patches and also repeated executions of tests on patches to identify potential fixes. PraPR, a recent G&V APR technique, reduces these costs by modifying program code directly at the level of compiled bytecode, and further performing on-the-fly patching by allowing multiple patches to be tested within the same JVM session. However, PraPR is limited due to its pattern-based, bytecode-level nature and it is basically unsound/imprecise as it assumes that patch executions do not change global JVM state and affect later patch executions on the same JVM session. Inspired by the PraPR work, we propose a unified patch validation framework, named UniAPR, which aims to speed up the patch validation for both bytecode and source-code APR via on-the-fly patching; furthermore, UniAPR addresses the imprecise patch validation issue by resetting the JVM global state via runtime bytecode transformation. We have implemented UniAPR as a fully automated Maven Plugin. We have also performed the first study of on-the-fly patch validation for state-of-the-art source-code-level APR. Our experiments show the first empirical evidence that vanilla on-the-fly patch validation can be imprecise/unsound; in contrast, our UniAPR framework can speed up state-of-the-art APR by over an order of magnitude without incurring any imprecision in patch validation, enabling all existing APR techniques to explore a larger search space to fix more bugs in the near future. Furthermore, UniAPR directly enables hybrid source and bytecode APR to fix substantially more bugs than all state-of-the-art APR techniques (under the same time limit) in the near future.

研究动机与目标

  • 为解决自动化程序修复(APR)中的关键性能瓶颈,即补丁验证占用了大部分执行时间。
  • 克服现有实时补丁验证技术的不精确性,这些技术假设在单个JVM会话中补丁之间无副作用。
  • 将实时补丁验证技术推广至字节码级APR之外,涵盖源代码级APR技术。
  • 通过在单一高效验证框架下统一多种APR技术,实现混合APR。
  • 通过实证研究证明,原始的实时补丁验证因JVM状态污染而不可靠,并通过运行时状态重置提供解决方案。

提出的方法

  • UniAPR利用JVM HotSwap在单个JVM会话内实现实时补丁,避免昂贵的进程重启。
  • 通过运行时字节码转换,在补丁执行之间重置JVM内部状态(如静态字段、类加载器),以防止副作用泄漏。
  • 该框架实现为Maven插件,支持与现有APR工具在源代码和字节码层面的无缝集成。
  • 支持任何现有APR技术作为插件,实现在多种补丁生成策略下的统一验证。
  • 系统采用基于测试的验证,在每次补丁执行后于同一JVM会话中运行开发者测试,且在状态重置后执行。
  • 通过隔离每个补丁的执行上下文,确保即使在重复补丁测试下,验证过程依然可靠。

实验结果

研究问题

  • RQ1能否在保证速度和精确性的同时,实现对源代码级和字节码级APR的实时补丁验证?
  • RQ2由于JVM状态在补丁间污染,原始的实时补丁验证是否不正确?
  • RQ3一个统一框架能否加速所有现有APR技术,包括混合源代码与字节码的方法?
  • RQ4UniAPR在多大程度上提升了最先进的APR工具的可扩展性和错误修复覆盖率?
  • RQ5通过运行时字节码转换实现的JVM状态重置,能否有效消除实时验证中的副作用?

主要发现

  • 实证研究结果表明,原始的实时补丁验证因JVM状态污染而存在不精确性和不正确性。
  • UniAPR在像CapGen、SimFix和ACS这样的最先进APR工具中,实现了超过10倍的补丁验证加速,且精度未受影响。
  • 该框架使混合源代码与字节码级APR能够修复比任何单一最先进的工具在相同时间限制下更多的错误。
  • 通过运行时字节码转换实现的JVM状态重置,能有效隔离补丁执行,确保验证的可靠性。
  • UniAPR与现有APR工具完全兼容,可作为Maven插件集成,支持广泛采用。
  • 本研究首次通过实证验证表明,当正确实施状态隔离时,实时补丁技术既能高效又能精确。

更好的研究,从现在开始

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

无需绑定信用卡

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