Skip to content
Preprint

REST API Testing with Verified LLM-Inferred Dependencies and Response-Driven Refinement

Aug 2026 · 0 citations · 49 references
Computer Science

TL;DR

APIPilot first derives candidate producer-consumer dependencies from OpenAPI specifications using structural heuristics and LLM-based semantic reasoning and validates them through concrete API executions before using them for test generation, outperforming both LLM-based and traditional REST API testing baselines.

Abstract

Testing RESTful APIs requires generating sequences of API calls that satisfy dependencies among operations, parameters, and runtime-created resources. Recent LLM-based approaches infer such dependencies and generate test sequences from OpenAPI specifications, but they often treat LLM-inferred relationships as correct without execution-based validation. This can introduce spurious dependencies, miss feasible operation chains, and produce infeasible tests. In this paper, we propose APIPilot}, an execution-validated framework for REST API testing. APIPilot first derives candidate producer-consumer dependencies from OpenAPI specifications using structural heuristics and LLM-based semantic reasoning. It then treats these dependencies as hypotheses and validates them through concrete API executions before using them for test generation. The validated dependencies are organized into a dependency graph from which APIPilot constructs coverage-aware workflows via bounded top-k graph traversal, separating semantic dependency inference from sequence construction. To improve subsequent tests, APIPilot further performs response-driven refinement: runtime responses are analyzed to update resource pools, adjust input-generation constraints, and prune or revise invalid dependency mappings. Empirical evaluation on 16 real-world REST API services shows that APIPilot achieves 92.3% operation coverage, up to 58.6% code coverage, and an 88.1% workflow execution success rate, outperforming both LLM-based and traditional REST API testing baselines. APIPilot also detects 197 unique 5xx failures and specification-execution mismatches, demonstrating the benefit of grounding dependency inference in execution feedback.

View source

Similar papers

Preprint Aug 2026

Validating HTTP Semantics in REST APIs With Constructed Call Sequence Scenarios

The novel automated techniques presented have been effective at automatically finding several of this type of faults in existing REST APIs and are shown to be effective at automatically finding several of this type of faults.

Omur Sahin, Andrea Arcuri · 0 citations
Jul 2026

From Resource Flow to Executable Tests: Petri-Net-Guided LLM Test Generation for Concurrent Stateful Rust APIs

A Petri-net-guided methodology for test generation over concurrent stateful Rust APIs that represents API resources, lifecycle conditions, and causal dependencies as colored tokens and transitions; derives legal deep-state, near-legal, and partial-order concurrent scenarios; and uses them as a constrained intermediate...

Kaiwen Zhang, Guanjun Liu · 0 citations
Conference Jul 2026

Improving LLM-Based Unit Test Generation Through Root-Cause-Driven Prompt Design

This paper addresses automated unit test generation with large language models (LLMs). LLM-based test generation has not yet attained a quality level sufficient for practical use in industry. Although LLMs often reproduce API syntax faithfully, they frequently disregard semantic usage constraints and execution-environm...

Mizuki Yamada, Masahiko Kato, Juichi Takahashi · 0 citations
Preprint Aug 2026

SMTpip: Interpreter-Aware SMT-Based Dependency Conflict Resolution for Restoring Python Source-Code Executability

SMTpip is presented, an interpreter-aware environment inference technique for improving the executability of Python source-code artifacts that constructs a dependency knowledge graph using metadata stored in the Python Package Index that encodes both package version constraints and interpreter compatibility constraints...

Sadman Sakib, Muhammad Asaduzzaman, Curtis Bright · 0 citations
Book Aug 2026

Can Formal Specifications Be Synthesized from Tests Alone?

This approach uses LLMs to infer candidate specifications solely from test code and dynamic execution traces: the LLM observes only the program interface, selected inputs, and corresponding outputs or state changes, while the implementation internals remain hidden.

Tian-Hai Liu, Maximilian Müller, Tobias Hey et al. · 0 citations
Preprint Aug 2026

EntailLLM: Verifying LLM-Generated Vulnerability Discovery Paths with Domain Knowledge via Logic Programming

EntailLLM is presented, which validates each LLM-proposed analyst path by entailment: the path is a traversal of the binary's function call graph, the domain knowledge is represented in a separate graph, and verification aligns the two under temporal annotated logic.

Kaustuv Mukherji, J. Patil, C. Payne et al. · 0 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.