Accelerating Patch Validation for Program Repair with Interception-Based Execution Scheduling
Yuan-An Xiao, Chenyang Yang, Bo Wang, Yingfei Xiong
TL;DR
The paper addresses the long patch validation times in generate-and-validate automated program repair (APR) by reframing patch validation as a dual problem to mutation testing and proposing ExpressAPR, a general-purpose Java patch validator. It introduces two novel approaches: online execution scheduling that detects patch equivalence during runtime, and interception-based instrumentation that records and replays patch-induced state changes without a full interpreter. The authors formalize and integrate five mutation-testing acceleration techniques—Mutant Schemata, Mutant Deduplication, Test Virtualization, Test Prioritization, and Parallelization—into a single framework, with execution scheduling subsuming the first two. Large-scale evaluation demonstrates substantial performance gains, achieving up to 137.1x speedups over plain validation and 8.8x over the prior state-of-the-art, reducing patch validation time to minutes on mainstream CPUs while maintaining high accuracy across the majority of patches, thereby enabling real-time or IDE-integrated APR workflows for Java projects.
Abstract
Long patch validation time is a limiting factor for automated program repair (APR). Though the duality between patch validation and mutation testing is recognized, so far there exists no study of systematically adapting mutation testing techniques to general-purpose patch validation. To address this gap, we investigate existing mutation testing techniques and identify five classes of acceleration techniques that are suitable for general-purpose patch validation. Among them, mutant schemata and mutant deduplication have not been adapted to general-purpose patch validation due to the arbitrary changes that third-party APR approaches may introduce. This presents two problems for adaption: 1) the difficulty of implementing the static equivalence analysis required by the state-of-the-art mutant deduplication approach; 2) the difficulty of capturing the changes of patches to the system state at runtime. To overcome these problems, we propose two novel approaches: 1) execution scheduling, which detects the equivalence between patches online, avoiding the static equivalence analysis and its imprecision; 2) interception-based instrumentation, which intercepts the changes of patches to the system state, avoiding a full interpreter and its overhead. Based on the contributions above, we implement ExpressAPR, a general-purpose patch validator for Java that integrates all recognized classes of techniques suitable for patch validation. Our large-scale evaluation with four APR approaches shows that ExpressAPR accelerates patch validation by 137.1x over plainvalidation or 8.8x over the state-of-the-art approach, making patch validation no longer the time bottleneck of APR. Patch validation time for a single bug can be reduced to within a few minutes on mainstream CPUs.
