Precise Condition Synthesis for Program Repair
By Yingfei Xiong, Jie Wang, Runfa Yan, Jiachen Zhang, Shi Han, Gang Huang, Lu Zhang. International Conference on Software Engineering, 2016
331 citations recorded by the source corpus.
Due to the difficulty of repairing defect, many research efforts have been devoted into automatic defect repair. Given a buggy program that fails some test cases, a typical automatic repair technique tries to modify the program to make all tests pass. However, since the test suites in real world projects are usually insufficient, aiming at passing the test suites often leads to incorrect patches. This problem is known as weak test suites or overfitting. In this paper we aim to produce precise patches, that is, any patch we produce has a relatively high probability to be correct. More concretely, we focus on condition synthesis, which was shown to be able to repair more than half of the defects in existing approaches. Our key insight is threefold. First, it is important to know what variables in a local context should be used in an "if" condition, and we propose a sorting method based on the dependency relations between variables. Second, we observe that the API document can be used to guide the repair process, and propose document analysis technique to further filter the variables. Third, it is important to know what predicates should be performed on the set of variables, and we propose to mine a set of frequently used predicates in similar contexts from existing projects. Based on the insight, we develop a novel program repair system, ACS, that could generate precise conditions at faulty locations. Furthermore, given the generated conditions are very precise, we can perform a repair operation that is previously deemed to be too overfitting: directly returning the test oracle to repair the defect. Using our approach, we successfully repaired 18 defects on four projects of Defects4J, which is the largest number of fully automatically repaired defects reported on the dataset so far. More importantly, the precision of our approach in the evaluation is 78.3%, which is significantly higher than previous approaches, which are usually less than 40%.
Subfields: Information Systems, Software
View Paper: https://www.semanticscholar.org/paper/ae067d3747764202ab7794808a25bd4f1e1efe1d
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
- Michele Tufano
- Denys Poshyvanyk
- Hongyu Zhang
- Lin Tan
- Thibaud Lutellier
- Hung Viet Pham
In Software
- Lingming Zhang
- Chun Xia
- Michele Tufano
- Lin Tan
- Thibaud Lutellier
- Hongyu Zhang
- Denys Poshyvanyk
- Junjie Chen
Citations in the corpus
- Shaping program repair space with existing patches and similar code (2018, background): “Typical approaches include GenProg [31] and its variants [18, 72], which combine statements from (similar) code snippets in the same project, as well as SearchRepair [25] that performs semantic search in a code base and ACS [68] that ranks patch ingredients based on statistical results from GitHub.”
- TBar: revisiting template-based automated program repair (2019, methodology): “The GZoltar framework for fault localization is also widely used in the literature of APR [14, 20, 30, 33, 34, 43, 63, 69, 71, 72], allowing for a fair assessment of TBar ’s performance against the state-of-the-art.”
- Large Language Models are Few-shot Testers: Exploring LLM-based General Bug Reproduction (2022, background): “Consequently, it may be difficult to utilize the state-of-the-art automated debugging techniques, which are often evaluated on Defects4J, when a bug is first reported because they rely on bug reproducing tests [9], [10].”
- Less training, more repairing please: revisiting automated program repair via zero-shot learning (2022, background): “Additionally, several traditional APR tools [17, 21, 48, 76] focus solely on fixing conditional statement related bugs, showing the importance of targeting common bug patterns.”
- CoCoNuT: combining context-aware neural translation models using ensemble for program repair (2020, background): “Fixing bugs by inserting if statements has been widely studied [47, 52, 87, 88].”
- 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.”
- Context-Aware Patch Generation for Better Automated Program Repair (2018, methodology): “We compareCapGenwith fiveAPR approaches, ACS [53], HDRepair [19], jGenProg [27], Nopol [54] and PAR [16, 19], which have been evaluated on the Defects4j benchmark within our knowledge.”
- A syntax-guided edit decoder for neural program repair (2021, neutral): “A typical way is to learn from existing software repositories, such as learning patterns from existing patches [2, 23, 24, 28, 40, 42, 58], and using program code to guide the patch generation [24, 43, 60, 71, 72].”
- SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repair (2018, background): “Most recent approaches in program repair research on Java use Defects4J as an evaluation benchmark [3], [12], [29]–[31].”