In-Memory State Copying for Stateful Service Replay Testing

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Replay testing for stateful cloud-based services is challenging due to the need for accurate execution state recreation and the impact on live production data, with existing solutions being costly and non-scalable.

Innovation Solution

A service testing system that creates an in-memory test copy of the execution state for stateful requests, allowing the compute engine to execute requests without modifying production data, and provides mechanisms to manage and compare execution states across different test runs and external resources.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If replay testing is performed on stateful services using production data, then testing accuracy is improved, but production data integrity is compromised

Engineering Contradiction:
Improvetesting accuracyVSAvoidproduction data integrity
Core Design Contradiction:
Measurement precisionVSObject-affected harmful factors

Solution Approach 1:

The patent creates a copy of the production database state and stores it in a data store. This copy is then used for replay testing, allowing accurate reproduction of production conditions without modifying the actual production data. The copy mechanism enables testers to work with realistic data while preserving the integrity of the source system.

Inventive Principle:
Principle #26Copying

2Reliability

If a full-scale test database is maintained for testing purposes, then testing realism is improved, but cost and resource consumption increase

Engineering Contradiction:
Improvetesting realismVSAvoidresource consumption
Core Design Contradiction:
ReliabilityVSQuantity of substance

Solution Approach 1:

Instead of maintaining a separate full-scale test database, the system creates a copy of the production database state only when needed for replay testing. This on-demand copying approach provides realistic test data without the continuous resource overhead of maintaining a dedicated test environment.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The data store that holds the copied production state serves multiple purposes: it acts as both the production database and the test data source. This multi-functionality eliminates the need for separate test database infrastructure, reducing overall resource consumption while maintaining testing realism.

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

3Stability of the object's composition

If replay testing is performed on stateful services, then test consistency is improved, but execution state management complexity increases

Engineering Contradiction:
Improvetest consistencyVSAvoidexecution state management complexity
Core Design Contradiction:
Stability of the object's compositionVSDevice complexity

Solution Approach 1:

The patent introduces a data store as an intermediary between the production database and the replay testing process. This intermediary holds the copied production state and provides it to the compute engine during replay testing, simplifying execution state management by centralizing state storage and access control in a single component.

Inventive Principle:
Principle #24Intermediary (Mediator)

Solution Approach 2:

The execution state is extracted from the production database and stored separately in the data store. This separation allows the testing system to manage execution state independently, improving test consistency by ensuring that the same state is used across multiple test runs without affecting the production system's state management complexity.

Inventive Principle:
Principle #2Taking out (Extraction)

4Measurement precision

If production data is used for replay testing, then test accuracy is improved, but test scalability is reduced

Engineering Contradiction:
Improvetest accuracyVSAvoidtest scalability
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The system creates reusable copies of production database state that can be instantiated multiple times for different test runs. This copying mechanism enables scalable replay testing because the same copied state can be used across numerous tests without depleting or modifying the source production data, maintaining both accuracy and scalability.

Inventive Principle:
Principle #26Copying

Data Source

PatentUS11210206B1Spoofing stateful dependencies during software testing
Publication Date: 2021.12.28 AMAZON TECH INC
  • US11210206B1 patent drawing
  • US11210206B1 patent drawing
  • US11210206B1 patent drawing

AI summary

A service testing system is disclosed to enable consistent replay of stateful requests on a service whose output depends on the service's execution state prior to the requests. In embodiments, the service implements a compute engine that executes service requests and a storage subsystem that maintains execution states during the execution of stateful requests. When a stateful request is received during testing, the storage subsystem creates an in-memory test copy of the execution state to support execution of the request, and provides the test copy to the compute engine. In embodiments, the storage subsystem will create a separate instance of execution state for each individual test run. The disclosed techniques enable mock execution states to be easily created for testing of stateful requests, in a manner that is transparent to the compute engine and does not impact production execution data maintained by the service.