Skip to main content
QUICK REVIEW

[Paper Review] Revisiting ssFix for Better Program Repair

Xin Qi, Steven P. Reiss|arXiv (Cornell University)|Mar 11, 2019
Software Testing and Debugging TechniquesComputer Science51 references4 citations
TL;DR

This paper proposes sharpFix, an improved syntactic search-based program repair technique that enhances ssFix by refining code search and reuse strategies. By leveraging targeted search methods for local and external code, sharpFix repairs 36 bugs in Defects4J and outperforms ssFix and four other APR techniques on Bugs.jar-ELIXIR, demonstrating significant gains in repair effectiveness through better code retrieval and transformation.

ABSTRACT

A branch of automated program repair (APR) techniques look at finding and reusing existing code for bug repair. ssFix is one of such techniques that is syntactic search-based: it searches a code database for code fragments that are syntactically similar to the bug context and reuses such retrieved code fragments to produce patches. Using such a syntactic approach, ssFix is relatively lightweight and was shown to outperform many other APR techniques. In this paper, to investigate the true effectiveness of ssFix, we conducted multiple experiments to validate ssFix's built-upon assumption (i.e., to see whether it is often possible to reuse existing code for bug repair) and evaluate its code search and code reuse approaches. Our results show that while the basic idea of ssFix, i.e., reusing existing code for bug repair, is promising, the approaches ssFix uses are not the best and can be significantly improved. We proposed a new repair technique sharpFix which follows ssFix's basic idea but differs in the code search and reuse approaches used. We evaluated sharpFix and ssFix on two bug datasets: Defects4J and Bugs.jar-ELIXIR. The results confirm that sharpFix is an improvement over ssFix. For the Defects4J dataset, sharpFix successfully repaired a total of 36 bugs and outperformed many existing repair techniques in repairing more bugs. For the Bugs.jar-ELIXIR dataset, we compared sharpFix, ssFix, and four other APR techniques, and found that sharpFix has the best repair performance. In essence, the paper shows how effective a syntactic search-based approach can be and what techniques should be used for such an approach.

Motivation & Objective

  • To evaluate the fundamental assumption underlying ssFix: that fix ingredients (correct code fragments) for bug repair often exist in existing code.
  • To assess ssFix's effectiveness in retrieving and reusing existing code fragments for patch generation.
  • To identify limitations in ssFix's code search and reuse mechanisms that hinder optimal repair performance.
  • To design and evaluate a new repair technique, sharpFix, that improves upon ssFix's approach using enhanced search and reuse strategies.
  • To demonstrate that syntactic search-based repair can be highly effective when combined with refined search and transformation techniques.

Proposed method

  • Proposes sharpFix as an improved variant of ssFix, maintaining the core idea of reusing existing code fragments for repair.
  • Implements distinct code search strategies: one for local program code and another for external code repositories, to improve retrieval accuracy.
  • Uses a three-step patch generation pipeline: code translation, component matching (semantic alignment), and code modification, each enhanced for precision.
  • Applies syntactic similarity measures to identify code fragments similar to the bug context, focusing on structural and lexical features.
  • Introduces improved matching heuristics to better align retrieved code fragments with the faulty context during patch synthesis.
  • Employs a conservative manual validation process to ensure patch correctness, accepting only semantics-preserving transformations.

Experimental results

Research questions

  • RQ1How often do fix ingredients—i.e., code fragments that can be used to repair a bug—exist in local or external code repositories?
  • RQ2To what extent can ssFix effectively retrieve and reuse existing code fragments for generating correct patches?
  • RQ3What are the key limitations in ssFix’s code search and reuse mechanisms that reduce its repair effectiveness?
  • RQ4Can a refined approach to code search and reuse significantly improve repair performance compared to ssFix?
  • RQ5How does the proposed sharpFix technique compare to other state-of-the-art APR techniques on real-world bug datasets?

Key findings

  • The assumption that fix ingredients exist in existing code is valid—code fragments needed for repair are frequently present in both local and external code.
  • ssFix’s code search and reuse mechanisms are suboptimal, leading to missed repair opportunities despite the availability of fix ingredients.
  • sharpFix successfully repaired 36 bugs in the Defects4J dataset, outperforming ssFix by 14 more repairs and surpassing four other APR techniques.
  • On the Bugs.jar-ELIXIR dataset, sharpFix achieved the best repair performance among all evaluated techniques, including ssFix and ELIXIR.
  • The improvement in repair effectiveness stems from sharper code retrieval and more accurate reuse strategies, not from increased search space or complexity.
  • Despite not using bug report information, sharpFix outperformed ELIXIR on Defects4J but generated fewer correct patches on Bugs.jar-ELIXIR, suggesting potential for further enhancement with such signals.

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.