Skip to main content
QUICK REVIEW

[Paper Review] ARJA: Automated Repair of Java Programs via Multi-Objective Genetic Programming

Yuan Yuan, Wolfgang Banzhaf|arXiv (Cornell University)|Dec 21, 2017
Software Testing and Debugging TechniquesComputer Science56 references17 citations
TL;DR

ARJA proposes a multi-objective genetic programming approach for automated repair of Java programs, using a fine-grained patch representation and NSGA-II to optimize for both test-suite adequacy and patch simplicity. It outperforms jGenProg and Nopol by generating test-suite adequate patches for 59 out of 224 real-world bugs in Defects4J—over twice as many as jGenProg—and correctly fixes 18 bugs, including several multi-location bugs previously unfixable by existing tools.

ABSTRACT

Recent empirical studies show that the performance of GenProg is not satisfactory, particularly for Java. In this paper, we propose ARJA, a new GP based repair approach for automated repair of Java programs. To be specific, we present a novel lower-granularity patch representation that properly decouples the search subspaces of likely-buggy locations, operation types and potential fix ingredients, enabling GP to explore the search space more effectively. Based on this new representation, we formulate automated program repair as a multi-objective search problem and use NSGA-II to look for simpler repairs. To reduce the computational effort and search space, we introduce a test filtering procedure that can speed up the fitness evaluation of GP and three types of rules that can be applied to avoid unnecessary manipulations of the code. Moreover, we also propose a type matching strategy that can create new potential fix ingredients by exploiting the syntactic patterns of the existing statements. We conduct a large-scale empirical evaluation of ARJA along with its variants on both seeded bugs and real-world bugs in comparison with several state-of-the-art repair approaches. Our results verify the effectiveness and efficiency of the search mechanisms employed in ARJA and also show its superiority over the other approaches. In particular, compared to jGenProg (an implementation of GenProg for Java), an ARJA version fully following the redundancy assumption can generate a test-suite adequate patch for more than twice the number of bugs (from 27 to 59), and a correct patch for nearly four times of the number (from 5 to 18), on 224 real-world bugs considered in Defects4J. Furthermore, ARJA is able to correctly fix several real multi-location bugs that are hard to be repaired by most of the existing repair approaches.

Motivation & Objective

  • To address the limited effectiveness of existing test-suite-based repair tools like GenProg and jGenProg on real-world Java bugs.
  • To enhance the expressiveness and efficiency of genetic programming in program repair by decoupling search subspaces for buggy locations, operation types, and fix ingredients.
  • To reduce computational cost through test filtering and scope-aware code manipulation rules.
  • To improve repair quality by integrating a type matching strategy that generates syntactically valid, semantically relevant fix ingredients.
  • To demonstrate that GP can be effectively leveraged for complex, real-world bug repair when properly structured and optimized.

Proposed method

  • Introduces a lower-granularity patch representation that decouples the search space into three independent subspaces: likely-buggy locations, operation types (e.g., deletion, replacement), and potential fix ingredients.
  • Reformulates program repair as a multi-objective optimization problem minimizing both weighted failure rate and patch size, solved using NSGA-II to find Pareto-optimal solutions.
  • Employs a test filtering procedure to skip irrelevant tests during fitness evaluation, accelerating the GP process.
  • Applies three types of rules—scope restriction, compilation safety checks, and operation-specific constraints—during operation initialization, ingredient screening, and solution decoding to reduce invalid code generation.
  • Proposes a type matching strategy that analyzes syntactic patterns of out-of-scope statements to generate new, valid fix ingredients that match the target method’s type context.
  • Integrates the type matching strategy optionally, enabling the generation of semantically plausible code fragments not natively present in the source.

Experimental results

Research questions

  • RQ1Can a multi-objective genetic programming approach significantly improve repair effectiveness and efficiency for real-world Java bugs compared to existing state-of-the-art tools?
  • RQ2To what extent does a fine-grained patch representation that decouples search subspaces enhance the search efficiency and repair quality of GP-based repair?
  • RQ3How effective is the proposed type matching strategy in generating semantically valid and reusable fix ingredients for Java programs?
  • RQ4Can ARJA successfully repair multi-location bugs that are notoriously difficult for existing repair tools?
  • RQ5Does test filtering and rule-based code manipulation significantly reduce the computational cost of fitness evaluation in GP-based repair?

Key findings

  • ARJA generates test-suite adequate patches for 59 out of 224 real-world bugs in Defects4J, compared to 27 by jGenProg and 35 by Nopol, demonstrating a significant improvement in repair coverage.
  • ARJA correctly fixes 18 real-world bugs in Defects4J, which is nearly four times the number fixed by jGenProg (5 bugs), and includes 7 bugs repaired for the first time automatically.
  • The type matching strategy significantly enhances repair effectiveness, with ARJA variants incorporating it fixing additional bugs beyond the main ARJA version.
  • ARJA successfully repairs several complex multi-location bugs that remain unfixable by most existing repair tools, highlighting its capability to handle semantically complex repairs.
  • The test filtering procedure reduces fitness evaluation time by eliminating unrelated tests, contributing to improved computational efficiency.
  • The multi-objective optimization approach using NSGA-II effectively balances patch simplicity and test-suite adequacy, leading to higher-quality and more maintainable patches.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.