Biased Random API Test Generation via REST
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Traditional methods for testing Representational State Transfer (REST) APIs are limited in generating a range of tests to locate unknown deficiencies, often focusing on valid requests and failing to effectively validate the system's performance with erroneous requests, which can lead to hidden deficiencies and unexpected behaviors.
Innovation Solution
A system and method for conducting model-based, biased, and random test generation through REST APIs, where the state of the System Under Test (SUT) is continuously monitored and updated, biasing the generation of validation tests towards valid requests and incorporating semantic checking to enhance testing robustness.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If traditional testing methods focus on valid requests, then the testing process is simple and easy to implement, but the system's performance with erroneous requests cannot be effectively validated, leading to hidden deficiencies
Solution Approach 1:
The testing system dynamically adjusts the proportion of valid versus erroneous requests based on testing progress and system state. The test generation module continuously monitors system responses and adapts the test mix, transitioning from primarily valid requests to including erroneous requests as testing deepens, thereby resolving the contradiction between testing reliability and process complexity
Solution Approach 2:
The system changes key parameters of test requests including data formats, value ranges, and structural properties to generate both valid and erroneous requests. By systematically varying these parameters, the system can effectively test error handling while maintaining a structured approach that doesn't overly complicate the testing process
2Measurement precision
If model-based biased random test generation is used to generate syntactically and semantically valid requests, then the comprehensiveness and predictability of validation tests improve, but the device complexity and implementation difficulty increase
Solution Approach 1:
The system performs preliminary actions by maintaining a model of the system under test and pre-defining biasing strategies before actual testing begins. This preliminary modeling and bias selection framework enables comprehensive and predictable test generation without requiring complex real-time decision-making during execution, thus improving measurement precision while managing device complexity
Solution Approach 2:
The patent introduces a test generation module as an intermediary between the testing objectives and the actual test execution. This module uses system models and biasing mechanisms to translate high-level testing goals into specific test requests, thereby improving test comprehensiveness and predictability while abstracting away the complexity from the overall testing system
Data Source
AI summary
Embodiments relate to a system, program product, and method for validating a system under test (SUT). The method includes selecting one or more random biases for one or more properties of the one or more API requests. The method also includes transmitting the one or more API requests to the SUT, transmitting an API response from the SUT for each of the one or more API requests, and validating each API response.


