An Intelligent Agent for Automated Test Generation from OpenAPI Specifications
Context: The widespread adoption of RESTful APIs demands effective contract validation, especially in critical domains. Motivation: Tools such as Postman and Newman automate test execution, but test creation remains manual, error-prone, and difficult to maintain. Objective: This work proposes an intelligent agent based on LLMs to interpret OpenAPI documents and automatically generate test collections. Method: The solution fragments OpenAPI documents by endpoint, generates specialized prompts, and uses an LLM via OpenRouter to create automated tests, validated with Newman on a public (anonymized) API. Results: Execution produced 34 requests, of which 12 were successful, 14 had critical failures (malformed URIs), and 8 contained structural or semantic errors. The results demonstrate feasibility and reduced manual effort, while indicating the need for further validation and refinement for CI/CD use.
Authors
- Ricardo F. Vilela
- Williamson Silva (ORCID: https://orcid.org/0000-0003-1849-2675)
- Pedro Henrique Dias Valle (ORCID: https://orcid.org/0000-0002-6929-7557)
- Edivaldo Moura Santos (ORCID: https://orcid.org/0000-0002-2818-8813)
- Stevão Alves de Andrade (ORCID: https://orcid.org/0000-0002-1559-6789)
Institutions
- United Food and Commercial Workers (US)
- Universidad San Pedro (PE)
- Hospital de Clínicas da Unicamp (BR)
Publication Details
- Published
- 2025-09-22
- DOI
- https://doi.org/10.5753/wbots.2025.15217
- Primary Topic
- Software Testing and Debugging Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00