A Software Bug Fixing Approach Based on Knowledge-Enhanced Large Language Models

被引:0
作者
Bo, Lili [1 ]
He, Yuting [1 ]
Sun, Xiaobing [1 ]
Ji, Wangjie [1 ]
Wu, Xiaohan [1 ]
机构
[1] Yangzhou Univ, Yangzhou, Jiangsu, Peoples R China
来源
2024 IEEE 24TH INTERNATIONAL CONFERENCE ON SOFTWARE QUALITY, RELIABILITY AND SECURITY, QRS | 2024年
关键词
Bug fixing; Knowledge Graph; Generative AI; Explainable;
D O I
10.1109/QRS62785.2024.00026
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Software Bug Fixing is a time-consuming task in software development and maintenance. Despite the success of Large Language Models (LLMs) using in Automatic Program Repair (APR), they still have the limitations of generating patches with low accuracy and explainability. In this paper, we propose a software bug-fixing approach based on knowledge-enhanced large language models. First, we collect bugs as well as their fix information from bug tracking systems, such as Github and Stack Overflow. Then, we extract bug entities and inter-entity relationships using Named Entity Recognition (NER) to construct a Bug Knowledge Graph (BKG). Finally, we utilize LLMs (e.g., GPT-4) which is enhanced by the knowledge of the similar historical bugs as well as fix information from BKG to generate patches for new bugs. The experimental results show that the our approach can fix 28.52% (85/298) bugs correctly, which is significantly better than the state-of-the-art approaches. Furthermore, the generated patches are explainable and more credible.
引用
收藏
页码:169 / 179
页数:11
相关论文
共 33 条
  • [1] SOSRepair: Expressive Semantic Search for Real-World Program Repair
    Afzal, Afsoon
    Motwani, Manish
    Stolee, Kathryn T.
    Brun, Yuriy
    Le Goues, Claire
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2021, 47 (10) : 2162 - 2181
  • [2] InferCode: Self-Supervised Learning of Code Representations by Predicting Subtrees
    Bui, Nghi D. Q.
    Yu, Yijun
    Jiang, Lingxiao
    [J]. 2021 IEEE/ACM 43RD INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2021), 2021, : 1186 - 1197
  • [3] SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repair
    Chen, Zimin
    Kommrusch, Steve
    Tufano, Michele
    Pouchet, Louis-Noel
    Poshyvanyk, Denys
    Monperrus, Martin
    [J]. IEEE TRANSACTIONS ON SOFTWARE ENGINEERING, 2021, 47 (09) : 1943 - 1959
  • [4] Automated Repair of Programs from Large Language Models
    Fan, Zhiyu
    Gao, Xiang
    Mirchev, Martin
    Roychoudhury, Abhik
    Tan, Shin Hwei
    [J]. 2023 IEEE/ACM 45TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, ICSE, 2023, : 1469 - 1481
  • [5] Feng Sidong, 2024, P 46 IEEE ACM INT C, P1
  • [6] Forrest Stephanie, 2009, GENETIC EVOLUTIONARY, P947, DOI DOI 10.1145/1569901.1570031
  • [7] Fried D, 2023, Arxiv, DOI arXiv:2204.05999
  • [8] Gousios G., 2014, P 11 WORKING C MININ, DOI [10.1145/2597073, DOI 10.1145/2597073.2597126, 10.1145/2597073.2597126]
  • [9] Gupta Sumit., 2015, Building Web Applications with Python and Neo4j
  • [10] Review4Repair: Code review aided automatic program repairing
    Huq, Faria
    Hasan, Masum
    Haque, Md Mahim Anjum
    Mahbub, Sazan
    Iqbal, Anindya
    Ahmed, Toufique
    [J]. INFORMATION AND SOFTWARE TECHNOLOGY, 2022, 143