Exploring and Lifting the Robustness of LLM-powered Automated Program Repair with Metamorphic Testing

Fuente: arXiv
Salvato in:
Dettagli Bibliografici
Autori principali: Xue, Pengyu, Wu, Linhao, Yang, Zhen, Yu, Zhongxing, Jin, Zhi, Li, Ge, Xiao, Yan, Liu, Shuo, Li, Xinyi, Lin, Hongyi, Wu, Jingwen
Natura: Preprint
Pubblicazione: 2024
Soggetti:
Accesso online:
Tags: Aggiungi Tag
Nessun Tag, puoi essere il primo ad aggiungerne!!
_version_ 1866916646666371072
author Xue, Pengyu
Wu, Linhao
Yang, Zhen
Yu, Zhongxing
Jin, Zhi
Li, Ge
Xiao, Yan
Liu, Shuo
Li, Xinyi
Lin, Hongyi
Wu, Jingwen
author_facet Xue, Pengyu
Wu, Linhao
Yang, Zhen
Yu, Zhongxing
Jin, Zhi
Li, Ge
Xiao, Yan
Liu, Shuo
Li, Xinyi
Lin, Hongyi
Wu, Jingwen
contents In recent years, Large language model-powered Automated Program Repair (LAPR) techniques have achieved state-of-the-art bug-fixing performance and have been pervasively applied and studied in both industry and academia. Nonetheless, LLMs were proved to be highly sensitive to input prompts, with slight differences in the expressions of semantically equivalent programs potentially causing repair failures. Therefore, it is crucial to conduct robustness testing on LAPR techniques before their practical deployment. However, related research is scarce. To this end, we propose MT-LAPR, a Metamorphic Testing framework exclusively for LAPR techniques, which summarizes nine widely-recognized Metamorphic Relations (MRs) by developers across three perturbation levels: token, statement, and block. Afterward, our proposed MRs are applied to buggy codes to generate test cases, which are semantically equivalent yet to affect the inference of LAPR. Experiments are carried out on two extensively examined bug-fixing datasets, i.e., Defect4J and QuixBugs, and four bug-fixing abled LLMs released recently, demonstrating that 34.4% - 48.5% of the test cases expose the instability of LAPR techniques on average, showing the effectiveness of MT-LAPR and uncovering a positive correlation between code readability and the robustness of LAPR techniques. Inspired by the above findings, this paper uses the test cases generated by MT-LAPR as samples to train a CodeT5-based code editing model aiming at improving code readability and then embeds it into the LAPR workflow as a data preprocessing step. Extensive experiments demonstrate that this approach significantly enhances the robustness of LAPR by 49.32% at most.
format Preprint
id arxiv_https___arxiv_org_abs_2410_07516
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Exploring and Lifting the Robustness of LLM-powered Automated Program Repair with Metamorphic Testing
Xue, Pengyu
Wu, Linhao
Yang, Zhen
Yu, Zhongxing
Jin, Zhi
Li, Ge
Xiao, Yan
Liu, Shuo
Li, Xinyi
Lin, Hongyi
Wu, Jingwen
Software Engineering
In recent years, Large language model-powered Automated Program Repair (LAPR) techniques have achieved state-of-the-art bug-fixing performance and have been pervasively applied and studied in both industry and academia. Nonetheless, LLMs were proved to be highly sensitive to input prompts, with slight differences in the expressions of semantically equivalent programs potentially causing repair failures. Therefore, it is crucial to conduct robustness testing on LAPR techniques before their practical deployment. However, related research is scarce. To this end, we propose MT-LAPR, a Metamorphic Testing framework exclusively for LAPR techniques, which summarizes nine widely-recognized Metamorphic Relations (MRs) by developers across three perturbation levels: token, statement, and block. Afterward, our proposed MRs are applied to buggy codes to generate test cases, which are semantically equivalent yet to affect the inference of LAPR. Experiments are carried out on two extensively examined bug-fixing datasets, i.e., Defect4J and QuixBugs, and four bug-fixing abled LLMs released recently, demonstrating that 34.4% - 48.5% of the test cases expose the instability of LAPR techniques on average, showing the effectiveness of MT-LAPR and uncovering a positive correlation between code readability and the robustness of LAPR techniques. Inspired by the above findings, this paper uses the test cases generated by MT-LAPR as samples to train a CodeT5-based code editing model aiming at improving code readability and then embeds it into the LAPR workflow as a data preprocessing step. Extensive experiments demonstrate that this approach significantly enhances the robustness of LAPR by 49.32% at most.
title Exploring and Lifting the Robustness of LLM-powered Automated Program Repair with Metamorphic Testing
topic Software Engineering
url https://arxiv.org/abs/2410.07516