用大模型和多智能体强化学习自动测试REST API,提升错误发现率。
AutoRestTest: A Tool for Automated REST API Testing Using LLMs and MARL
- 基于语义依赖图与多智能体强化学习生成测试用例
- 在真实API上实现高覆盖率,检测到多种服务器错误
- 适合测试工程师和开发人员快速验证API可靠性
随着REST API在现代网络服务中广泛应用,其全面测试日益重要。由于操作、参数及取值的组合空间庞大且存在依赖关系与约束,现有测试工具常导致代码覆盖率低,故障检测效果不佳。为此,我们提出AutoRestTest,一种结合语义属性依赖图(SPDG)与多智能体强化学习(MARL)及大语言模型(LLMs)的新型测试工具。该工具利用SPDG识别操作间的依赖参数,通过五个专用智能体(操作、参数、值、依赖、头信息)协同生成操作序列、参数组合与取值。用户可通过直观命令行界面配置并监控测试过程,实时获取已执行操作数、发现的唯一服务器错误数及耗时。测试完成后生成详细报告,展示检测到的错误与覆盖的操作。本文介绍该工具并呈现初步结果,演示视频见https://www.youtube.com/watch?v=VVus2W8rap8。
原文摘要 · Abstract (English)
As REST APIs have become widespread in modern web services, comprehensive testing of these APIs is increasingly crucial. Because of the vast search space of operations, parameters, and parameter values, along with their dependencies and constraints, current testing tools often achieve low code coverage, resulting in suboptimal fault detection. To address this limitation, we present AutoRestTest, a novel tool that integrates the Semantic Property Dependency Graph (SPDG) with Multi-Agent Reinforcement Learning (MARL) and large language models (LLMs) for effective REST API testing. AutoRestTest determines operation-dependent parameters using the SPDG and employs five specialized agents (operation, parameter, value, dependency, and header) to identify dependencies of operations and generate operation sequences, parameter combinations, and values. Through an intuitive command-line interface, users can easily configure and monitor tests with successful operation count, unique server errors detected, and time elapsed. Upon completion, AutoRestTest generates a detailed report highlighting errors detected and operations exercised. In this paper, we introduce our tool and present preliminary findings, with a demonstration video available at https://www.youtube.com/watch?v=VVus2W8rap8.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。