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 条
  • [21] Panjer LucasD., 2007, Proceedings of the 4th International Workshop on Mining Software Repositories, MSR '07, P29
  • [22] Peng Y., 2024, P 46 IEEE ACM INT C, P1
  • [23] Ponzanelli Luca, 2014, P 11 WORK C MIN SOFT, P102, DOI [DOI 10.1145/2597073.2597077, 10.1145/2597073.2597077]
  • [24] Saha RK, 2017, IEEE INT CONF AUTOM, P648, DOI 10.1109/ASE.2017.8115675
  • [25] Reducing Bug Triaging Confusion by Learning from Mistakes with a Bug Tossing Knowledge Graph
    Su, Yanqi
    Xing, Zhenchang
    Peng, Xin
    Xia, Xin
    Wang, Chong
    Xu, Xiwei
    Zhu, Liming
    [J]. 2021 36TH IEEE/ACM INTERNATIONAL CONFERENCE ON AUTOMATED SOFTWARE ENGINEERING ASE 2021, 2021, : 191 - 202
  • [26] Sun Y, 2021, Arxiv, DOI arXiv:2107.02137
  • [27] Wang Y, 2019, Arxiv, DOI arXiv:1906.03889
  • [28] White M, 2019, 2019 IEEE 26TH INTERNATIONAL CONFERENCE ON SOFTWARE ANALYSIS, EVOLUTION AND REENGINEERING (SANER), P479, DOI [10.1109/SANER.2019.8668043, 10.1109/saner.2019.8668043]
  • [29] Less Training, More Repairing Please: Revisiting Automated Program Repair via Zero-Shot Learning
    Xia, Chunqiu Steven
    Zhang, Lingming
    [J]. PROCEEDINGS OF THE 30TH ACM JOINT MEETING EUROPEAN SOFTWARE ENGINEERING CONFERENCE AND SYMPOSIUM ON THE FOUNDATIONS OF SOFTWARE ENGINEERING, ESEC/FSE 2022, 2022, : 959 - 971
  • [30] Precise Condition Synthesis for Program Repair
    Xiong, Yingfei
    Wang, Jie
    Yan, Runfa
    Zhang, Jiachen
    Han, Shi
    Huang, Gang
    Zhang, Lu
    [J]. 2017 IEEE/ACM 39TH INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE), 2017, : 416 - 426