一句话:提出 Bugsplainer,基于 Transformer 的生成模型,从 bug 修复提交中学习并利用代码结构生成软件 bug 的自然语言解释。
软件 bug 消耗大量开发时间与成本,但已有研究多聚焦于自动发现或修复 bug,鲜有工作自动向开发者解释 bug。本文提出 Bugsplainer,一种基于 Transformer 的生成模型,通过从大规模 bug 修复提交语料中学习,为软件 bug 生成自然语言解释。该模型能够利用源代码中的结构信息和缺陷模式来生成解释。作者使用三项性能指标进行评估,结果显示 Bugsplainer 能按 Google 标准生成可理解且良好的解释,并优于文献中的多个基线。此外,一项包含 20 名参与者的开发者研究表明,Bugsplainer 生成的解释比基线更准确、更精确、更简洁且更有用。
Software bugs claim ≈ 50 % of development time and cost the global economy billions of dollars. Once a bug is reported, the assigned developer attempts to identify and understand the source code responsible for the bug and then corrects the code. Over the last five decades, there has been significant research on automatically finding or correcting software bugs. However, there has been little research on automatically explaining the bugs to the developers, which is essential but a highly challenging task. In this paper, we propose Bugsplainer, a transformer-based generative model, that generates natural language explanations for software bugs by learning from a large corpus of bug-fix commits. Bugsplainer can leverage structural information and buggy patterns from the source code to generate an explanation for a bug. Our evaluation using three performance metrics shows that Bugsplainer can generate understandable and good explanations according to Google's standard, and can outperform multiple baselines from the literature. We also conduct a developer study involving 20 participants where the explanations from Bugsplainer were found to be more accurate, more precise, more concise and more useful than the baselines.
DOI 原文 · arXiv · PDF(开放获取) · DBLP
@inproceedings{abs-2212-04584,
title = {Explaining Software Bugs Leveraging Code Structures in Neural Machine Translation},
author = {Parvez Mahbub and Ohiduzzaman Shuvo and Mohammad Masudur Rahman},
booktitle = {ICSE},
year = {2023},
doi = {10.1109/icse48619.2023.00063}
}