Bug reports are vital for software maintenance that allow users to inform developers of the problems encountered while using the software. As such, researchers have committed considerable resources toward automating bug replay to expedite the process of software maintenance. Nonetheless, the success of current automated approaches is largely dictated by the characteristics and quality of bug reports, as they are constrained by the limitations of manually-crafted patterns and pre-defined vocabulary lists. Inspired by the success of Large Language Models (LLMs) in natural language understanding, we propose AdbGPT, a new lightweight approach to automatically reproduce the bugs from bug reports through prompt engineering, without any training and hard-coding effort. AdbGPT leverages few-shot learning and chain-of-thought reasoning to elicit human knowledge and logical reasoning from LLMs to accomplish the bug replay in a manner similar to a developer. Our evaluations demonstrate the effectiveness and efficiency of our AdbGPT to reproduce 81.3% of bug reports in 253.6 seconds, outperforming the state-of-the-art baselines and ablation studies. We also conduct a small-scale user study to confirm the usefulness of AdbGPT in enhancing developers' bug replay capabilities.
翻译:漏洞报告对软件维护至关重要,它能让用户告知开发人员在使用软件时遇到的问题。因此,研究人员投入了大量资源,致力于自动化漏洞复现以加速软件维护过程。然而,当前自动化方法的成功在很大程度上受限于漏洞报告的特征和质量,因为它们受制于手动设计的模板和预定义词汇表。受大型语言模型(LLM)在自然语言理解方面成功的启发,我们提出了AdbGPT——一种轻量级的新方法,通过提示工程自动从漏洞报告中复现漏洞,无需任何训练和硬编码工作。AdbGPT利用少样本学习和思维链推理,从LLM中激发人类知识和逻辑推理,以类似开发人员的方式完成漏洞复现。评估结果表明,AdbGPT能在253.6秒内有效复现81.3%的漏洞报告,性能优于现有最先进的基线和消融研究。我们还进行了一项小规模用户研究,证实了AdbGPT在增强开发人员漏洞复现能力方面的实用性。