arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2411.07098cs.SEcs.AI
收藏

基于语义图与LLM驱动输入的多智能体REST API测试方法

A Multi-Agent Approach for REST API Testing with Semantic Graphs and LLM-Driven Inputs

Georgia Institute of Technology(佐治亚理工学院);IBM Research(IBM研究院)

Myeongsoo Kim, Tyler Stennett, Saurabh Sinha, Alessandro Orso

AI总结:

本文提出AutoRestTest,一种结合多智能体强化学习、语义属性依赖图和大型语言模型的黑盒REST API测试工具,通过四个智能体协作优化API探索,在真实服务上显著提升覆盖率与故障检测能力。

摘要:

随着现代Web服务日益依赖REST API,对其进行彻底测试变得至关重要。此外,REST API文档语言(如OpenAPI规范)的出现催生了许多黑盒REST API测试工具。然而,这些工具往往孤立地关注单个测试元素(如API、参数、值),导致覆盖率较低且故障检测效果较差。为解决这些局限性,我们提出了AutoRestTest,这是首个采用依赖嵌入多智能体方法进行REST API测试的黑盒工具,它将多智能体强化学习(MARL)与语义属性依赖图(SPDG)及大型语言模型(LLMs)相结合。我们的方法将REST API测试视为一个可分离的问题,其中四个智能体——API智能体、依赖智能体、参数智能体和值智能体——协作优化API探索。LLMs负责生成领域特定的值,SPDG模型利用API操作之间的相似性得分简化依赖搜索空间,而MARL动态优化智能体的行为。我们在12个真实世界REST服务上对AutoRestTest的评估表明,在代码覆盖率、操作覆盖率和故障检测方面,它优于四个领先的黑盒REST API测试工具,包括那些由RESTGPT(使用LLMs生成逼真测试输入)辅助的工具。值得注意的是,AutoRestTest是唯一能够触发Spotify服务内部服务器错误的工具。我们的消融研究表明,AutoRestTest的每个组件——SPDG、LLM和智能体学习机制——都对其整体有效性有所贡献。

英文摘要:

As modern web services increasingly rely on REST APIs, their thorough testing has become crucial. Furthermore, the advent of REST API documentation languages, such as the OpenAPI Specification, has led to the emergence of many black-box REST API testing tools. However, these tools often focus on individual test elements in isolation (e.g., APIs, parameters, values), resulting in lower coverage and less effectiveness in fault detection. To address these limitations, we present AutoRestTest, the first black-box tool to adopt a dependency-embedded multi-agent approach for REST API testing that integrates multi-agent reinforcement learning (MARL) with a semantic property dependency graph (SPDG) and Large Language Models (LLMs). Our approach treats REST API testing as a separable problem, where four agents -- API, dependency, parameter, and value agents -- collaborate to optimize API exploration. LLMs handle domain-specific value generation, the SPDG model simplifies the search space for dependencies using a similarity score between API operations, and MARL dynamically optimizes the agents' behavior. Our evaluation of AutoRestTest on 12 real-world REST services shows that it outperforms the four leading black-box REST API testing tools, including those assisted by RESTGPT (which generates realistic test inputs using LLMs), in terms of code coverage, operation coverage, and fault detection. Notably, AutoRestTest is the only tool able to trigger an internal server error in the Spotify service. Our ablation study illustrates that each component of AutoRestTest -- the SPDG, the LLM, and the agent-learning mechanism -- contributes to its overall effectiveness.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑