International Journal of Engineering, Science and Information Technology
Vol 6, No 1 (2026)

Autonomous Test Case Generation from API Specifications Using AI: A Hybrid LLM and Reinforcement Learning Framework

Onkar Khadke (Independent Researcher)



Article Info

Publish Date
30 Jan 2026

Abstract

The rapid growth of REST API surfaces in microservice architectures has increased the difficulty of achieving meaningful specification-level test coverage through manually authored test suites. This study presents a hybrid autonomous test-generation framework that improves REST API testing by leveraging the dependencies and semantic information encoded in OpenAPI specifications. The framework integrates four components: a Spec-Semantic Graph that represents endpoint dependencies as a weighted directed graph; a Contextual Boundary Inference Engine that uses few-shot large language model prompting to infer semantic boundary conditions from OpenAPI descriptions; a Coverage-Aware Reinforcement Learning Test Scheduler that prioritizes test execution using a multidimensional coverage state vector; and a Differential Oracle Synthesis mechanism that constructs pass/fail verdicts without manually authored expected-output specifications. The framework was evaluated using three open-source REST APIs representing different levels of specification completeness, which were compared with large language model and search-based testing baselines. The evaluation examined endpoint coverage, oracle accuracy, and continuous integration overhead across the tested APIs. Results show that the proposed framework achieves higher endpoint coverage than the individual baselines and reduces oracle false-positive rates by combining specification semantics with adaptive test prioritization and automated differential validation. The framework also introduces a one-time continuous integration overhead for constructing semantic representations and learned test states, which can be amortized across subsequent specification versions. These findings indicate that specification semantics, contextual boundary inference, adaptive scheduling, and automated oracle synthesis can be integrated into a unified autonomous testing process. The framework, therefore, provides a specification-native quality assurance pipeline that derives test intelligence directly from OpenAPI specifications while reducing dependence on manually authored test annotations

Copyrights © 2026