Skip to main content
QUICK REVIEW

[论文解读] Prompting Is All You Need: Automated Android Bug Replay with Large Language Models

Sidong Feng, Chunyang Chen|arXiv (Cornell University)|Jun 3, 2023
Software Engineering Research被引用 10
一句话总结

该论文提出 AdbGPT,一种轻量级、通过提示工程的方式,利用大语言模型从缺陷报告提取 S2R 实体并指导自动化 Android 漏洞重放,在不训练的情况下实现高准确性和效率。

ABSTRACT

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.

研究动机与目标

  • 通过利用大语言模型来处理不清楚、不完整的缺陷报告,从而推动自动化的漏洞重放。
  • 提出一个两阶段的方法(S2R 实体提取与引导重放),无需模型训练或硬编码。
  • 展示基于 LLM 的提示能够在 S2R 提取和漏洞重放效率方面超越最先进的基线。
  • 通过用户研究证明 AdbGPT 对开发人员的实际有用性。

提出的方法

  • 定义 S2R 实体规范与动作基元,以锚定提取任务。
  • 使用带有链式推理的少样本学习从缺陷报告中引出结构化的 S2R 实体。
  • 将 GUI 状态编码为类 HTML 的提示,以使大语言模型能够识别目标组件。
  • 使用带有链式推理的引导重放,将 S2R 实体映射到跨动态屏幕的 GUI 组件。
  • 将 LLM 提示与 Genymotion、UIAutomator 和 ADB 集成,实现端到端的自动重放。
Figure 1. The process of prompt engineering.
Figure 1. The process of prompt engineering.

实验结果

研究问题

  • RQ1研究问题1:AdbGPT 能从缺陷报告中多准确地提取 S2R 实体?
  • RQ2研究问题2:AdbGPT 能通过 GUI 交互指导并重现漏洞的准确性如何?
  • RQ3研究问题3:与基线相比,AdbGPT 在漏洞重放时间方面的效率如何?
  • RQ4研究问题4:开发者在现实世界的漏洞重放中是否认为 AdbGPT 有用?

主要发现

  • AdbGPT 在 S2R 任务中实现了 90.4% 的步骤提取准确率和 91.1% 的实体提取准确率。
  • 相较于基线,AdbGPT 重现了 81.3% 的漏洞,并平均为每个漏洞节省 1105.17 秒。
  • 以少样本和链式推理的提示工程显著提升了性能,相比于零样本和非 CoT 变体。
  • 将 GUI 编码为类 HTML 的提示,使大语言模型能够对动态 Android 屏幕进行推理以实现引导重放。
  • 一项小型用户研究表明 AdbGPT 对支持开发人员的漏洞重放工作流有用。
Figure 2. The overview of AdbGPT .
Figure 2. The overview of AdbGPT .

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。