Cookie-Based Mock Server for Reusable API Testing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing mock API servers are time-consuming to set up and cannot be shared or reused across different development teams due to the need for specific responses, often requiring code extensions and stubs, which limits their flexibility and compatibility.

Innovation Solution

A mock server system that responds to API requests based on instructions stored in cookies, allowing developers to customize responses without modifying the server settings, enabling multiple teams to use the same mock server with different response configurations.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If mock API servers are configured with specific responses using code extensions and stubs, then the server can provide accurate simulation for testing, but the setup becomes time-consuming and cannot be shared across different development teams

Engineering Contradiction:
Improveaccuracy of API simulationVSAvoidsetup time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent extracts the response configuration from the server code itself and places it into external cookie files. This separation allows the server to remain generic and reusable while the specific response behaviors are defined externally in cookies, eliminating the need to modify server code for different testing scenarios.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The mock server is designed to be universal by accepting different cookie configurations for different teams and scenarios. Instead of requiring separate server instances or code modifications, a single server can serve multiple development teams with different response requirements by simply loading different cookie files.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Adaptability or versatility

If mock API servers use code extensions and stubs to define response behaviors, then specific testing scenarios can be simulated, but the server cannot be reused or shared across different development teams

Engineering Contradiction:
Improvecustomization of response behaviorsVSAvoidserver configuration complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The patent uses cookie files as templates or copies that define response behaviors. Instead of hardcoding responses in the server, the server reads from cookie templates that can be copied and modified for different teams. This allows each team to have their own cookie template without affecting the server or other teams.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The cookie file acts as an intermediary between the server and the response configuration. Rather than the server directly containing response logic, the cookie file serves as a mediator that translates team-specific requirements into server instructions, simplifying the server's role and enabling reuse.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Ease of operation

If developers modify server settings to accommodate different response requirements, then specific team needs can be met, but the server loses its reusability and requires frequent modifications

Engineering Contradiction:
Improveability to customize responsesVSAvoidserver maintainability
Core Design Contradiction:
Ease of operationVSEase of manufacture

Solution Approach 1:

The patent segments the response configuration from the server core functionality. The server handles only the basic API mocking operations, while specific response behaviors are segmented into separate cookie files. This segmentation allows each team to customize their cookie file without affecting the server or other teams, maintaining server integrity and reusability.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS11169913B2Mock server for testing
Publication Date: 2021.11.09 INTUIT INC
  • US11169913B2 patent drawing
  • US11169913B2 patent drawing
  • US11169913B2 patent drawing

AI summary

Systems of the present disclosure provide a versatile, reusable mock server to respond to Application-Programming-Interface (API) requests. The mock server receives an API request and a cookie associated with the API request. The API server identifies response instructions found in the cookie. The response instructions may include a static response value, a name of an API server for the mock server to imitate, or code for the mock server to execute in the process of generating a mock API response. The mock server generates a mock API response based on the response instructions and sends the mock API response in reply to the API request.