Shaping program repair space with existing patches and similar code
By Jiajun Jiang, Yingfei Xiong, Hongyu Zhang, Qing Gao, Xiangqun Chen. International Symposium on Software Testing and Analysis, 2018
378 citations recorded by the source corpus.
Automated program repair (APR) has great potential to reduce bug-fixing effort and many approaches have been proposed in recent years. APRs are often treated as a search problem where the search space consists of all the possible patches and the goal is to identify the correct patch in the space. Many techniques take a data-driven approach and analyze data sources such as existing patches and similar source code to help identify the correct patch. However, while existing patches and similar code provide complementary information, existing techniques analyze only a single source and cannot be easily extended to analyze both. In this paper, we propose a novel automatic program repair approach that utilizes both existing patches and similar code. Our approach mines an abstract search space from existing patches and obtains a concrete search space by differencing with similar code snippets. Then we search within the intersection of the two search spaces. We have implemented our approach as a tool called SimFix, and evaluated it on the Defects4J benchmark. Our tool successfully fixed 34 bugs. To our best knowledge, this is the largest number of bugs fixed by a single technology on the Defects4J benchmark. Furthermore, as far as we know, 13 bugs fixed by our approach have never been fixed by the current approaches.
Subfields: Information Systems, Software
View Paper: https://www.semanticscholar.org/paper/33d9da222a9de0e52021f42d5ad739d0ba061469
How researchers see this paper
The researchers whose trusted networks rank it highest, strongest advocate first. Every researcher gets a different order.
In Information Systems
- Chun Xia
- Lingming Zhang
- Vincent J. Hellendoorn
- Prem Devanbu
- Baishakhi Ray
- Miltiadis Allamanis
- Yangruibo Ding
- Alexey Svyatkovskiy
In Software
- Chun Xia
- Lingming Zhang
- Prem Devanbu
- Vincent J. Hellendoorn
- Alexey Svyatkovskiy
- Baishakhi Ray
- Neel Sundaresan
- Michele Tufano
Citations in the corpus
- Patching as Translation: the Data and the Metaphor (2020, methodology): “Classic APR techniques can be categorized into 1) generate-andvalidate (G&V) [9, 17, 24, 25] or 2) synthesis-based approaches [20].”
- Baldur: Whole-Proof Generation and Repair with Large Language Models (2023, methodology): “The automated program repair field studies the task of taking a program with a bug, evidenced by one or more failing tests, and automatically producing a modified version of the program that passes all the tests [50].”
- TBar: revisiting template-based automated program repair (2019, methodology): “…to the software industry [5, 49], there is a momentum in minimizing the time-to-fix intervals by APR. Recently, various APR approaches [7, 8, 13, 14, 17, 19, 21, 22, 25, 27, 33, 34, 36, 37, 39, 45, 48, 61, 63, 71, 72] have been proposed, aiming at reducing manual debugging efforts through…”
- InferFix: End-to-End Program Repair with LLMs (2023, methodology): “The concept of leveraging similar fixes has also been explored in other approaches, such as SimFix [13], which extracts frequent abstract modifications from existing patches to form an abstract space for program repair.”
- Learning to Synthesize Programs as Interpretable and Generalizable Policies (2021, background): “[107] Jiajun Jiang, Yingfei Xiong, Hongyu Zhang, Qing Gao, and Xiangqun Chen.”
- SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repair (2018, background): “Elixir [4], CapGen [3] and SimFix [31] have reported 26, 22, 34 correctly repaired bugs for all Defects4J bugs, where the patch is identical to the human patch or claimed as correct.”
- CoCoNuT: combining context-aware neural translation models using ensemble for program repair (2020, neutral): “Pfect 15 SOSRepair [2] 16/23 16 Nopol [88] 2/9 1/4 17 (j)Kali [58, 68] 2/8 1/2 3/27 18 (j)GenProg [38, 58] 6/16 0/2 [255-369]/1423 2/18 19 RSRepair [67] 10/24 2/4 2/10 20 ARJA [91] 12/36 21 SequenceR [13] 12/19 22 ACS [87] 16/21 23 SimFix* [29] 27/50 24 kPAR* [46] 29/56 25 AVATAR* [48] 29/50 26 FixM”
- Less training, more repairing please: revisiting automated program repair via zero-shot learning (2022, methodology): “Following the most recent Recoder work, we also compare against 12 state-of-the-art traditional single-hunk APR tools: TBar [44], PraPR [25], AVATAR [45], SimFix [31], FixMiner [35], Cap-Gen [74], JAID [12], SketchFix [29], NOPOL [17], jGenProg [52], jMutRepair [53] and jKali [53].”
- Software Testing With Large Language Models: Survey, Landscape, and Vision (2023, neutral): “There have been template-based [143], heuristic-based [144], and constraint-based [145], [146] automatic program repair techniques.”
- CODIT: Code Editing With Tree-Based Neural Models (2018, background): “SimFix [53] set 5 hours as their time out for generating patches and running test cases.”
- A syntax-guided edit decoder for neural program repair (2021, methodology): “To check the correctness of the patches, we manually examined every patch if it is the same with or semantically equivalent to the patch provided by Defects4J, as in previous works [15, 24, 36, 40, 44].”
- Automated Program Repair in the Era of Large Pre-trained Language Models (2022, neutral): “Furthermore, we also choose 12 traditional APR tools: TBar [19], PraPR [20], AVATAR [16], SimFix [68], FixMiner [15], CapGen [9], JAID [69], SketchFix [13], NOPOL [12], jGenProg [70], jMutRepair [14], and jKali [14].”