Carving UI Tests to Generate API Tests and API Specification

05/24/2023
by   Rahulkrishna Yandrapally, et al.
0

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 added to test suites generated by two automated REST API testing tools, increase statement coverage by 52 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.

READ FULL TEXT
research
01/06/2019

RESTful API Automated Test Case Generation

Nowadays, web services play a major role in the development of enterpris...
research
01/26/2018

Automatically Extracting Web API Specifications from HTML Documentation

Web API specifications are machine-readable descriptions of APIs. These ...
research
12/20/2019

QuickREST: Property-based Test Generation of OpenAPI-Described RESTful APIs

RESTful APIs are an increasingly common way to expose software systems f...
research
09/06/2021

Towards API Testing Across Cloud and Edge

API economy is driving the digital transformation of business applicatio...
research
08/28/2020

A First Look at the Deprecation of RESTful APIs: An Empirical Study

REpresentational State Transfer (REST) is considered as one standard sof...
research
03/22/2022

Quickstrom: Property Based Acceptance Testing with LTL Specifications

We present Quickstrom, a property-based testing system for acceptance te...
research
09/08/2023

Adaptive REST API Testing with Reinforcement Learning

Modern web services increasingly rely on REST APIs. Effectively testing ...

Please sign up or login with your details

Forgot password? Click here to reset