LogiAgent:基于大语言模型多智能体的REST系统自动化逻辑测试
LogiAgent: Automated Logical Testing for REST Systems with LLM-Based Multi-Agents
AI总结:
针对现有REST API测试方法易忽略业务逻辑问题的不足,提出基于LLM多智能体的LogiAgent测试框架,通过多组件协作与逻辑预言机开展测试,在真实系统中有效识别逻辑问题且性能优于现有工具。
摘要:
REST API的自动化测试已成为保障现代Web服务正确性与可靠性的关键手段。现有方法主要聚焦于检测服务器崩溃和错误码,却常常忽略因业务逻辑演进和领域特定需求引发的逻辑问题。为解决这一局限,我们提出LogiAgent——一种面向REST系统逻辑测试的新方法。LogiAgent构建于大语言模型(LLM)驱动的多智能体框架之上,集成了测试场景生成器、API请求执行器和API响应验证器,三者协作完成API测试场景的生成、执行与验证。与传统测试方法关注5xx等状态码不同,LogiAgent引入了逻辑预言机,可基于业务逻辑评估响应,确保测试更全面。系统还通过执行记忆组件存储历史API执行数据,保障上下文一致性。我们在12个真实世界REST系统上开展了大量实验,结果表明LogiAgent能有效识别234个逻辑问题,准确率达66.19%。此外,它在检测服务器崩溃方面表现优异,且相比4种当前最优的REST API测试工具实现了更出色的测试覆盖率。消融实验证实,LogiAgent的记忆组件对提升测试覆盖率具有显著作用。
英文摘要:
Automated testing for REST APIs has become essential for ensuring the correctness and reliability of modern web services. While existing approaches primarily focus on detecting server crashes and error codes, they often overlook logical issues that arise due to evolving business logic and domain-specific requirements. To address this limitation, we propose LogiAgent, a novel approach for logical testing of REST systems. Built upon a large language model (LLM)-driven multi-agent framework, LogiAgent integrates a Test Scenario Generator, API Request Executor, and API Response Validator to collaboratively generate, execute, and validate API test scenarios. Unlike traditional testing methods that focus on status codes like 5xx, LogiAgent incorporates logical oracles that assess responses based on business logic, ensuring more comprehensive testing. The system is further enhanced by an Execution Memory component that stores historical API execution data for contextual consistency. We conduct extensive experiments across 12 real-world REST systems, demonstrating that LogiAgent effectively identifies 234 logical issues with an accuracy of 66.19%. Additionally, it basically excels in detecting server crashes and achieves superior test coverage compared to four state-of-the-art REST API testing tools. An ablation study confirms the significant contribution of LogiAgent's memory components to improving test coverage.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。