A Multi-Agent Collaborative Framework for API Automated Testing Based on Large Language Models
PDF

Keywords

Large Language Models
API Testing
Test Automation

Abstract

With the continuous expansion of software system scale, the complexity of API (Application Programming Interface) testing has been escalating, making traditional manual testing approaches increasingly insufficient to meet the demands of rapid iterative development. In recent years, Large Language Models (LLMs) have demonstrated remarkable capabilities in software engineering tasks, offering new technological pathways for automated testing. This study proposes a multi-stage collaborative automated testing framework for API testing driven by LLMs. The framework decomposes the complete API testing process into four stages—specification parsing, test case generation, test execution, and result verification—each handled by a specialized LLM Agent, forming a clear division of labor. Experiments conducted on three mainstream REST APIs demonstrate that the framework achieves an 87% test case generation rate and an 83% accuracy rate. Compared with end-to-end single-model approaches, the accuracy improves by approximately 11 percentage points, while the average execution time is reduced from 45 minutes to 8 minutes. This study validates the effectiveness of decomposing complex testing workflows and assigning them to specialized LLM agents, providing new insights for LLM-driven software testing research.

PDF

References

Huang, H., Tang, J., Liu, T., & Huang, M. (2026). Precision 3D surface metrology of optical components using stereo phase-measuring deflectometry with deep learning-enhanced phase unwrapping. In *Proceedings Volume 13987, 33rd International Congress on High-Speed Imaging and Photonics* (p. 1398704). SPIE. https://doi.org/10.1117/12.3093993

Huang, H., Yang, Y., & Zhu, Y. (2023). Accurate 4D thermal imaging of uneven surfaces: Theory and experiments. *International Journal of Heat and Mass Transfer*, 216, 124580. https://doi.org/10.1016/j.ijheatmasstransfer.2023.124580

Wang, S., Yu, Y., Feldt, R., & Parthasarathy, D. (2025). Automating a complete software test process using llms: An automotive case study. arXiv preprint arXiv:2502.04008. https://doi.org/10.1109/ICSE55347.2025.00211