cs.SENov 22, 2025

MASTEST: A LLM-Based Multi-Agent System For Testing RESTful APIs

Authors: Xiaoke Han, Hong Zhu

Organizations: School of Engineering, Computing and Mathematics, Oxford Brookes University, Oxford, UK

Abstract

Testing RESTful API is increasingly complicated but indispensable to quality assurance of cloud-native applications. This paper reports a multi-agent system called MASTEST that combines LLM-based intelligent agents and programmed agents to automate REST API testing. They form a complete tool chain covering the whole workflow of REST API test with API specification in the OpenAPI Swagger format as the input. It also incorporates human testers in the process to review and correct LLM generated test artefacts to control the quality of testing activities. MASTEST is evaluated on two LLMs, GPT-4o and DeepSeek V3.1 Reasoner with five public APIs. Its performances on various testing activities are measured by a wide range of metrics, including adequacy and coverage metrics, the syntax and data type correctness of generated test scripts, the usability of LLM generated test cases and scripts, as well as the bug detection ability. Experiment results demonstrated that both DeepSeek and GPT-4o achieved a high overall performance but had strengths and weaknesses on different testing activities. MASTEST generated test cases achieved 94% and 98% unit test coverage and 79% and 78% system test coverage for GPT-4o and DeepSeek respectively in comparison with human designed test cases. The generated test scripts maintained 100% syntax correctness and only required minimal manual edits for semantic correctness. The generated test scripts contain assertions on the expected status code as well as contents in the response messages. They are highly capable of detecting bugs in the REST APIs. Experiment data shows that the bug detection rates are between 2.13 to 4.50 per operation. These findings indicate that MASTEST is highly efficient and effective.

Figures & tables

Explore similar work

CardsList
  1. Multi-Agent LLM-based Metamorphic Testing for REST APIs

    May 27, 2026Shehroz Khan, Abdullah Mughees, Gaadha Sudheerbabu +2Application Programming InterfacesAgentic Workflows

  2. RESTestBench: A Benchmark for Evaluating the Effectiveness of LLM-Generated REST API Test Cases from NL Requirements

    Apr 28, 2026Leon Kogler, Stefan Hangler, Maximilian Ehrhart +3Test GenerationReproducibility

  3. LLM-Based Robustness Testing of Microservice Applications: An Empirical Study

    May 13, 2026Hrushitha Goud Tigulla, Marco VieiraMicroservicesRobustness Verification