Lune

ICSE2024Top-tier venue

Generating REST API Specifications through Static Analysis

Ruikai Huang, Manish Motwani, Idel Martinez, Alessandro Orso

Abstract

Web Application Programming Interfaces (APIs) allow services to be accessed over the network. RESTful (or REST) APIs, which use the REpresentation State Transfer (REST) protocol, are a popular type of web API. To use or test REST APIs, developers use specifications written in standards such as OpenAPI. However, creating and maintaining these specifications is time-consuming and error-prone, especially as software evolves, leading to incomplete or inconsistent specifications that negatively affect the use and testing of the APIs. To address this problem, we present Respector (REST API specification generator), the first technique to employ static and symbolic program analysis to generate specifications for REST APIs from their source code. We evaluated Respector on 15 real-world APIs with promising results in terms of precision and recall in inferring endpoint methods, endpoint parameters, method responses, and parameter attributes, including constraints leading to successful HTTP responses or errors. Furthermore, these results could be further improved with additional engineering. Comparing the Respector-generated specifications with the developer-provided ones shows that Respector was able to identify many missing end-point methods, parameters, constraints, and responses, along with some inconsistencies between developer-provided specifications and API implementations. Finally, Respector outperformed several techniques that infer specifications from annotations within API implementations or by invoking the APIs.

Ask Lune

Know this paper in minutes, not an afternoon.

Lune can read every page of it and the top-tier papers that cite it, and gives you its claims, its evidence and its limits, each one cited to the paper it comes from. No skimming, no AI slop.

5 top-tier papers have cited it since. Know what they found before your reviewers do.

Questions to start from

Lune can draw on

the full paper · the top-tier papers that cite it · related work

Get the answer

Free to start. No credit card required.

Lineage

  • Carving UI Tests to Generate API Tests and API Specification cites Automated test generation for REST APIs: no time to rest yet
  • Adaptive REST API Testing with Reinforcement Learning cites Automated test generation for REST APIs: no time to rest yet
  • SATORI: Static Test Oracle Generation for REST APIs cites Carving UI Tests to Generate API Tests and API Specification
  • SATORI: Static Test Oracle Generation for REST APIs cites Adaptive REST API Testing with Reinforcement Learning
  • SATORI: Static Test Oracle Generation for REST APIs cites Online testing of RESTful APIs: promises and challenges
  • SATORI: Static Test Oracle Generation for REST APIs cites Automated test generation for REST APIs: no time to rest yet
  • SATORI: Static Test Oracle Generation for REST APIs cites A Multi-Agent Approach for REST API Testing with Semantic Graphs and LLM-Driven Inputs
  • RestPi: Path-Sensitive Type Inference for REST APIs cites Automated test generation for REST APIs: no time to rest yet
  • A Multi-Agent Approach for REST API Testing with Semantic Graphs and LLM-Driven Inputs cites Adaptive REST API Testing with Reinforcement Learning
  • A Multi-Agent Approach for REST API Testing with Semantic Graphs and LLM-Driven Inputs cites Automated test generation for REST APIs: no time to rest yet
  • Fidelity of Cloud Emulators: The Imitation Game of Testing Cloud-Based Software cites Carving UI Tests to Generate API Tests and API Specification
  • SAINT: Service-level Integration Test Generation with Program Analysis and LLM-based Agents cites Adaptive REST API Testing with Reinforcement Learning
  • SAINT: Service-level Integration Test Generation with Program Analysis and LLM-based Agents cites Online testing of RESTful APIs: promises and challenges
  • SAINT: Service-level Integration Test Generation with Program Analysis and LLM-based Agents cites A Multi-Agent Approach for REST API Testing with Semantic Graphs and LLM-Driven Inputs
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers5

  1. A Multi-Agent Approach for REST API Testing with Semantic Graphs and LLM-Driven InputsMyeongsoo Kim, Tyler Stennett, Saurabh Sinha, Alessandro OrsoICSE 2025 · 4 citations
  2. SATORI: Static Test Oracle Generation for REST APIsJuan C. Alonso, Alberto Martin-Lopez, Sergio Segura, Gabriele Bavota et al.ASE 2025 · 2 citations
  3. Fidelity of Cloud Emulators: The Imitation Game of Testing Cloud-Based SoftwareAnna Mazhar, Saad Sher Alam, William X. Zheng, Yinfang Chen et al.ICSE 2025 · 2 citations
  4. RestPi: Path-Sensitive Type Inference for REST APIsMark W. Aldrich, Kyla Levin, Michael Coblenz, Jeffrey S. FosterOOPSLA 2025 · 1 citation
  5. SAINT: Service-level Integration Test Generation with Program Analysis and LLM-based AgentsRangeet Pan, Raju Pavuluri, Ruikai Huang, Tyler Stennett et al.ICSE 2026 · 1 citation

Builds on4

  1. Automated test generation for REST APIs: no time to rest yetMyeongsoo Kim, Qi Xin, Saurabh Sinha, Alessandro OrsoISSTA 2022 · 67 citations
  2. Online testing of RESTful APIs: promises and challengesAlberto Martin-Lopez, Sergio Segura, Antonio Ruiz-CortésFSE 2022 · 34 citations
  3. Adaptive REST API Testing with Reinforcement LearningMyeongsoo Kim, Saurabh Sinha, Alessandro OrsoASE 2023 · 29 citations
  4. Carving UI Tests to Generate API Tests and API SpecificationRahulkrishna Yandrapally, Saurabh Sinha, Rachel Tzoref-Brill, Ali MesbahICSE 2023 · 21 citations

Related papers

  1. Speculate: Generating REST API Specifications using LLMsKrishanu Singh, Kushagra Karar, Abhilash Jindal, Guowei YangFSE 2026
  2. Combinatorial Testing of RESTful APIsHuayao Wu, Lixin Xu, Xintao Niu, Changhai NieICSE 2022 · 47 citations
  3. Enhancing REST API Testing with NLP TechniquesMyeongsoo Kim, Davide Corradini, Saurabh Sinha, Alessandro Orso et al.ISSTA 2023 · 34 citations
  4. RBCTest: Leveraging LLMs to Mine and Verify Oracles of API Response Bodies for RESTful API TestingHieu Huynh, Quoc-Tri Le, Tu Nguyen, Viet Nguyen et al.ICSE 2026
  5. Morest: Model-based RESTful API Testing with Execution FeedbackYi Liu, Yuekang Li, Gelei Deng, Yang Liu et al.ICSE 2022 · 52 citations
Dusk over the sea between two cliffs drawn in fine vertical lines