Improving Patch Correctness Analysis via Random Testing and Large Language Models
Authors:
- 27 May 2024
- conference paper
- Published by Institute of Electrical and Electronics Engineers (IEEE)
- p. 317-328
Abstract
Patch correctness assessment represents a crucial step in the patch validation process, with the potential to enhance the practical adoption of automated program repair (APR) techniques and substantially reduce validation costs. While some automated techniques have been proposed for assessing patch correctness, they primarily focus on either ranking patches based on their likelihood of being correct or classifying them as correct or incorrect without offering any further explanatory information. In this paper, we introduce FIXCHECK, a novel approach that combines random testing and large language models to automatically generate fault-revealing tests for potentially incorrect patches. To achieve this, FIXCHECK employs a two-fold process: Firstly, a random testing procedure generates a comprehensive set of test cases. Secondly, a large language model is utilized to derive meaningful assertions for each test case. Additionally, FIXCHECK incorporates a selection and prioritization mechanism, which evaluates the generated tests executed on the patched program and discards or ranks them based on their likelihood of revealing faults in the patch. To assess the effectiveness of our approach, we conducted evaluations on a benchmark comprising 160 patches, encompassing both patches created by developers and patches generated by APR tools. The results demonstrate that FIXCHECK effectively generates fault-revealing tests for 62 % of incorrect patches written by developers, with a high level of confidence. Furthermore, it complements existing patch correctness assessment techniques by providing fault-revealing tests for up to 50% of the incorrect patches identified by state-of-the-art techniques.Keywords
This publication has 45 references indexed in Scilit:
- Test-based patch clustering for automatically-generated patches assessmentEmpirical Software Engineering, 2024
- A critical review on the evaluation of automated program repair systemsJournal of Systems and Software, 2021
- SapFix: Automated End-to-End Repair at Scale2019
- Contract-based program repair without the contracts2017
- Precise Condition Synthesis for Program Repair2017
- Repairing Programs with Semantic Code Search (T)2015
- DirectFix: Looking for Simple Program Repairs2015
- SemFix: Program repair via semantic analysis2013
- A systematic study of automated program repair: Fixing 55 out of 105 bugs for $8 each2012
- Feedback-Directed Random Test Generation29th International Conference on Software Engineering (ICSE'07), 2007