Carving UI Tests to Generate API Tests and API Specification
Rahulkrishna Yandrapally, Saurabh Sinha, Rachel Tzoref-Brill, Ali Mesbah
摘要
Modern web applications make extensive use of API calls to update the UI state in response to user events or server-side changes. For such applications, API-level testing can play an important role, in-between unit-level testing and UI-level (or end-to-end) testing. Existing API testing tools require API specifications (e.g., OpenAPI), which often may not be available or, when available, be inconsistent with the API implementation, thus limiting the applicability of automated API testing to web applications. In this paper, we present an approach that leverages UI testing to enable API-level testing for web applications. Our technique navigates the web application under test and automatically generates an API-level test suite, along with an OpenAPI specification that describes the application's server-side APIs (for REST-based web applications). A key element of our solution is a dynamic approach for inferring API endpoints with path parameters via UI navigation and directed API probing. We evaluated the technique for its accuracy in inferring API specifications and the effectiveness of the “carved” API tests. Our results on seven open-source web applications show that the technique achieves 98% precision and 56% recall in inferring endpoints. The carved API tests, when added to test suites generated by two automated REST API testing tools, increase statement coverage by 52% and 29% and branch coverage by 99% and 75%, on average. The main benefits of our technique are: (1) it enables API-level testing of web applications in cases where existing API testing tools are inapplicable and (2) it creates API-level test suites that cover server-side code efficiently while exercising APIs as they would be invoked from an application's web UI, and that can augment existing API test suites.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 6 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- SATORI: Static Test Oracle Generation for REST APIs 引用了 Improving Test Case Generation for REST APIs Through Hierarchical Clustering
- SATORI: Static Test Oracle Generation for REST APIs 引用了 Combinatorial Testing of RESTful APIs
- SATORI: Static Test Oracle Generation for REST APIs 引用了 Morest: Model-based RESTful API Testing with Execution Feedback
- 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 引用了 Generating REST API Specifications through Static Analysis
- SATORI: Static Test Oracle Generation for REST APIs 引用了 Intelligent REST API data fuzzing
- Morest: Model-based RESTful API Testing with Execution Feedback 引用了 Intelligent REST API data fuzzing
- Automated test generation for REST APIs: no time to rest yet 引用了 Improving Test Case Generation for REST APIs Through Hierarchical Clustering
- Automated test generation for REST APIs: no time to rest yet 引用了 Combinatorial Testing of RESTful APIs
- Automated test generation for REST APIs: no time to rest yet 引用了 Morest: Model-based RESTful API Testing with Execution Feedback
- Automated test generation for REST APIs: no time to rest yet 引用了 Intelligent REST API data fuzzing
- Generating REST API Specifications through Static Analysis 引用了 Automated test generation for REST APIs: no time to rest yet
- Fidelity of Cloud Emulators: The Imitation Game of Testing Cloud-Based Software 引用了 Combinatorial Testing of RESTful APIs
- Fidelity of Cloud Emulators: The Imitation Game of Testing Cloud-Based Software 引用了 Morest: Model-based RESTful API Testing with Execution Feedback
- Fidelity of Cloud Emulators: The Imitation Game of Testing Cloud-Based Software 引用了 Generating REST API Specifications through Static Analysis
- Fidelity of Cloud Emulators: The Imitation Game of Testing Cloud-Based Software 引用了 Intelligent REST API data fuzzing
引用它的顶会 Paper6
- Generating REST API Specifications through Static AnalysisRuikai Huang, Manish Motwani, Idel Martinez, Alessandro OrsoICSE 2024 · 11 次引用
- SATORI: Static Test Oracle Generation for REST APIsJuan C. Alonso, Alberto Martin-Lopez, Sergio Segura, Gabriele Bavota 等ASE 2025 · 2 次引用
- Feature-Driven End-to-End Test GenerationParsa Alian, Noor Nashid, Mobina Shahbandeh, Taha Shabani 等ICSE 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 次引用
- Sakura: An Approach for Generating Complex Tests from Natural Language Test DescriptionsTyler Stennett, Rangeet Pan, Bridget McGinn, Alessandro Orso 等ISSTA 2026
它引用的 Paper5
- Automated test generation for REST APIs: no time to rest yetMyeongsoo Kim, Qi Xin, Saurabh Sinha, Alessandro OrsoISSTA 2022 · 67 次引用
- Intelligent REST API data fuzzingPatrice Godefroid, Bo-Yuan Huang, Marina PolishchukFSE 2020 · 57 次引用
- Morest: Model-based RESTful API Testing with Execution FeedbackYi Liu, Yuekang Li, Gelei Deng, Yang Liu 等ICSE 2022 · 52 次引用
- Combinatorial Testing of RESTful APIsHuayao Wu, Lixin Xu, Xintao Niu, Changhai NieICSE 2022 · 47 次引用
- Improving Test Case Generation for REST APIs Through Hierarchical ClusteringDimitri Michel Stallenberg, Mitchell Olsthoorn, Annibale PanichellaASE 2021 · 32 次引用
相关 Paper
- DeepREST: Automated Test Case Generation for REST APIs Exploiting Deep Reinforcement LearningDavide Corradini, Zeno Montolli, Michele Pasqua, Mariano CeccatoASE 2024 · 13 次引用
- Speculate: Generating REST API Specifications using LLMsKrishanu Singh, Kushagra Karar, Abhilash Jindal, Guowei YangFSE 2026
- Enhancing REST API Testing with NLP TechniquesMyeongsoo Kim, Davide Corradini, Saurabh Sinha, Alessandro Orso 等ISSTA 2023 · 34 次引用
- AGORA: Automated Generation of Test Oracles for REST APIsJuan C. Alonso, Sergio Segura, Antonio Ruiz-CortésISSTA 2023 · 15 次引用
- Adaptive REST API Testing with Reinforcement LearningMyeongsoo Kim, Saurabh Sinha, Alessandro OrsoASE 2023 · 29 次引用
