一句话:VFix 利用值流分析缩减补丁搜索空间,从而为 NPE 缺陷生成更多正确补丁。
自动程序修复(APR)的核心难题在于如何从可能无限的补丁解空间中高效生成正确补丁:现有方法因对整个解空间进行推理,往往既无法产生任何看似合理的补丁,又常给出看似合理但实际错误的补丁。本文提出 VFix,一种新的值流引导 APR 方法,专门修复空指针异常(NPE)缺陷。VFix 通过分析程序中的数据依赖与控制依赖,显著缩小解空间,从而更准确地识别与缺陷相关的修复语句,并生成更多正确修复。作者在 Defects4j 的 NPE 缺陷上,将 VFix 与 8 个当前最先进的 APR 工具进行比较,结果表明其在精度和效率上均明显领先:正确修复的缺陷数量是最精确工具的三倍,且比这 8 个工具正确修复总数还多 50%;同时生成正确补丁仅需数分钟而非数小时。
Automated Program Repair (APR) faces a key challenge in efficiently generating correct patches from a potentially infinite solution space. Existing approaches, which attempt to reason about the entire solution space, can be ineffective (by often producing no plausible patches at all) and imprecise (by often producing plausible but incorrect patches). We present VFIX, a new value-flow-guided APR approach, to fix null pointer exception (NPE) bugs by considering a substantially reduced solution space in order to greatly increase the number of correct patches generated. By reasoning about the data and control dependences in the program, VFIX can identify bug-relevant repair statements more accurately and generate more correct repairs than before. VFIX outperforms a set of 8 state-of-the-art APR tools in fixing the NPE bugs in Defects4j in terms of both precision (by correctly fixing 3 times as many bugs as the most precise one and 50% more than all the bugs correctly fixed by these 8 tools altogether) and efficiency (by producing a correct patch in minutes instead of hours).