Lune

ICSE2023Top-tier venue

Carving UI Tests to Generate API Tests and API Specification

Rahulkrishna Yandrapally, Saurabh Sinha, Rachel Tzoref-Brill, Ali Mesbah

Abstract

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.

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.

6 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

  • SATORI: Static Test Oracle Generation for REST APIs cites Improving Test Case Generation for REST APIs Through Hierarchical Clustering
  • SATORI: Static Test Oracle Generation for REST APIs cites Combinatorial Testing of RESTful APIs
  • SATORI: Static Test Oracle Generation for REST APIs cites Morest: Model-based RESTful API Testing with Execution Feedback
  • 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 Generating REST API Specifications through Static Analysis
  • SATORI: Static Test Oracle Generation for REST APIs cites Intelligent REST API data fuzzing
  • Morest: Model-based RESTful API Testing with Execution Feedback cites Intelligent REST API data fuzzing
  • Automated test generation for REST APIs: no time to rest yet cites Improving Test Case Generation for REST APIs Through Hierarchical Clustering
  • Automated test generation for REST APIs: no time to rest yet cites Combinatorial Testing of RESTful APIs
  • Automated test generation for REST APIs: no time to rest yet cites Morest: Model-based RESTful API Testing with Execution Feedback
  • Automated test generation for REST APIs: no time to rest yet cites Intelligent REST API data fuzzing
  • Generating REST API Specifications through Static Analysis 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 Combinatorial Testing of RESTful APIs
  • Fidelity of Cloud Emulators: The Imitation Game of Testing Cloud-Based Software cites Morest: Model-based RESTful API Testing with Execution Feedback
  • Fidelity of Cloud Emulators: The Imitation Game of Testing Cloud-Based Software cites Generating REST API Specifications through Static Analysis
  • Fidelity of Cloud Emulators: The Imitation Game of Testing Cloud-Based Software cites Intelligent REST API data fuzzing
Builds onCited byLeft to right by year; the more cited, the higher.

Cited by top-tier papers6

  1. Generating REST API Specifications through Static AnalysisRuikai Huang, Manish Motwani, Idel Martinez, Alessandro OrsoICSE 2024 · 11 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. Feature-Driven End-to-End Test GenerationParsa Alian, Noor Nashid, Mobina Shahbandeh, Taha Shabani et al.ICSE 2025 · 2 citations
  4. 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
  5. Sakura: An Approach for Generating Complex Tests from Natural Language Test DescriptionsTyler Stennett, Rangeet Pan, Bridget McGinn, Alessandro Orso et al.ISSTA 2026

Builds on5

  1. Automated test generation for REST APIs: no time to rest yetMyeongsoo Kim, Qi Xin, Saurabh Sinha, Alessandro OrsoISSTA 2022 · 67 citations
  2. Intelligent REST API data fuzzingPatrice Godefroid, Bo-Yuan Huang, Marina PolishchukFSE 2020 · 57 citations
  3. Morest: Model-based RESTful API Testing with Execution FeedbackYi Liu, Yuekang Li, Gelei Deng, Yang Liu et al.ICSE 2022 · 52 citations
  4. Combinatorial Testing of RESTful APIsHuayao Wu, Lixin Xu, Xintao Niu, Changhai NieICSE 2022 · 47 citations
  5. Improving Test Case Generation for REST APIs Through Hierarchical ClusteringDimitri Michel Stallenberg, Mitchell Olsthoorn, Annibale PanichellaASE 2021 · 32 citations

Related papers

  1. DeepREST: Automated Test Case Generation for REST APIs Exploiting Deep Reinforcement LearningDavide Corradini, Zeno Montolli, Michele Pasqua, Mariano CeccatoASE 2024 · 13 citations
  2. Speculate: Generating REST API Specifications using LLMsKrishanu Singh, Kushagra Karar, Abhilash Jindal, Guowei YangFSE 2026
  3. Enhancing REST API Testing with NLP TechniquesMyeongsoo Kim, Davide Corradini, Saurabh Sinha, Alessandro Orso et al.ISSTA 2023 · 34 citations
  4. AGORA: Automated Generation of Test Oracles for REST APIsJuan C. Alonso, Sergio Segura, Antonio Ruiz-CortésISSTA 2023 · 15 citations
  5. Adaptive REST API Testing with Reinforcement LearningMyeongsoo Kim, Saurabh Sinha, Alessandro OrsoASE 2023 · 29 citations
Dusk over the sea between two cliffs drawn in fine vertical lines