Generating REST API Specifications through Static Analysis
Ruikai Huang, Manish Motwani, Idel Martinez, Alessandro Orso
摘要
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.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 5 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Carving UI Tests to Generate API Tests and API Specification 引用了 Automated test generation for REST APIs: no time to rest yet
- Adaptive REST API Testing with Reinforcement Learning 引用了 Automated test generation for REST APIs: no time to rest yet
- SATORI: Static Test Oracle Generation for REST APIs 引用了 Carving UI Tests to Generate API Tests and API Specification
- SATORI: Static Test Oracle Generation for REST APIs 引用了 Adaptive REST API Testing with Reinforcement Learning
- SATORI: Static Test Oracle Generation for REST APIs 引用了 Online testing of RESTful APIs: promises and challenges
- SATORI: Static Test Oracle Generation for REST APIs 引用了 Automated test generation for REST APIs: no time to rest yet
- SATORI: Static Test Oracle Generation for REST APIs 引用了 A Multi-Agent Approach for REST API Testing with Semantic Graphs and LLM-Driven Inputs
- RestPi: Path-Sensitive Type Inference for REST APIs 引用了 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 引用了 Adaptive REST API Testing with Reinforcement Learning
- A Multi-Agent Approach for REST API Testing with Semantic Graphs and LLM-Driven Inputs 引用了 Automated test generation for REST APIs: no time to rest yet
- Fidelity of Cloud Emulators: The Imitation Game of Testing Cloud-Based Software 引用了 Carving UI Tests to Generate API Tests and API Specification
- SAINT: Service-level Integration Test Generation with Program Analysis and LLM-based Agents 引用了 Adaptive REST API Testing with Reinforcement Learning
- SAINT: Service-level Integration Test Generation with Program Analysis and LLM-based Agents 引用了 Online testing of RESTful APIs: promises and challenges
- SAINT: Service-level Integration Test Generation with Program Analysis and LLM-based Agents 引用了 A Multi-Agent Approach for REST API Testing with Semantic Graphs and LLM-Driven Inputs
引用它的顶会 Paper5
- A Multi-Agent Approach for REST API Testing with Semantic Graphs and LLM-Driven InputsMyeongsoo Kim, Tyler Stennett, Saurabh Sinha, Alessandro OrsoICSE 2025 · 4 次引用
- SATORI: Static Test Oracle Generation for REST APIsJuan C. Alonso, Alberto Martin-Lopez, Sergio Segura, Gabriele Bavota 等ASE 2025 · 2 次引用
- Fidelity of Cloud Emulators: The Imitation Game of Testing Cloud-Based SoftwareAnna Mazhar, Saad Sher Alam, William X. Zheng, Yinfang Chen 等ICSE 2025 · 2 次引用
- RestPi: Path-Sensitive Type Inference for REST APIsMark W. Aldrich, Kyla Levin, Michael Coblenz, Jeffrey S. FosterOOPSLA 2025 · 1 次引用
- SAINT: Service-level Integration Test Generation with Program Analysis and LLM-based AgentsRangeet Pan, Raju Pavuluri, Ruikai Huang, Tyler Stennett 等ICSE 2026 · 1 次引用
它引用的 Paper4
- Automated test generation for REST APIs: no time to rest yetMyeongsoo Kim, Qi Xin, Saurabh Sinha, Alessandro OrsoISSTA 2022 · 67 次引用
- Online testing of RESTful APIs: promises and challengesAlberto Martin-Lopez, Sergio Segura, Antonio Ruiz-CortésFSE 2022 · 34 次引用
- Adaptive REST API Testing with Reinforcement LearningMyeongsoo Kim, Saurabh Sinha, Alessandro OrsoASE 2023 · 29 次引用
- Carving UI Tests to Generate API Tests and API SpecificationRahulkrishna Yandrapally, Saurabh Sinha, Rachel Tzoref-Brill, Ali MesbahICSE 2023 · 21 次引用
相关 Paper
- Speculate: Generating REST API Specifications using LLMsKrishanu Singh, Kushagra Karar, Abhilash Jindal, Guowei YangFSE 2026
- Combinatorial Testing of RESTful APIsHuayao Wu, Lixin Xu, Xintao Niu, Changhai NieICSE 2022 · 47 次引用
- Enhancing REST API Testing with NLP TechniquesMyeongsoo Kim, Davide Corradini, Saurabh Sinha, Alessandro Orso 等ISSTA 2023 · 34 次引用
- RBCTest: Leveraging LLMs to Mine and Verify Oracles of API Response Bodies for RESTful API TestingHieu Huynh, Quoc-Tri Le, Tu Nguyen, Viet Nguyen 等ICSE 2026
- Morest: Model-based RESTful API Testing with Execution FeedbackYi Liu, Yuekang Li, Gelei Deng, Yang Liu 等ICSE 2022 · 52 次引用
