Test Model Framework for Isolating Code Dependencies

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In software testing, dependencies on other code portions or database tables can cause testing failures due to bugs or unstable data, especially when write permissions are restricted, making it difficult to isolate and validate the behavior of the code under test.

Innovation Solution

A testing framework that generates a test model comprising model elements representing the code under test and its dependencies, allowing for the definition of test doubles to alter dependencies, thereby isolating the code under test and generating new code artefacts for testing without impacting execution time or runtime environment.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If code is tested by providing input and observing behavior, then testing can be performed, but dependencies on other code portions and database tables cause testing failures due to bugs or unstable data

Engineering Contradiction:
Improvetesting stabilityVSAvoiddependency management complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system segments the code under test from its dependencies by creating a test model that represents only the necessary portions of dependencies. This isolation allows testing to proceed without being affected by bugs or instability in the full dependency chain, while still maintaining the structural relationships needed for valid testing.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The system creates a copy of the dependency structure in the form of a test model. This model contains model elements that represent database tables and other code portions, allowing testers to work with simplified representations rather than the actual complex dependencies, thereby improving reliability while managing complexity.

Inventive Principle:
Principle #26Copying

2Ease of operation

If database tables are used for testing, then data can be accessed, but write permissions are restricted preventing data modification for testing purposes

Engineering Contradiction:
Improvetesting flexibilityVSAvoiddata stability
Core Design Contradiction:
Ease of operationVSReliability

Solution Approach 1:

The system creates model elements that are copies or representations of actual database tables. These model elements can be freely modified during testing without affecting the original database tables, thus providing both the flexibility needed for testing operations and the stability of the original data remaining unchanged.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The test model acts as an intermediary layer between the testing code and the actual database tables. This intermediary allows testing operations to proceed with modified data representations while the original database tables remain protected and stable, resolving the conflict between testing flexibility and data stability.

Inventive Principle:
Principle #24Intermediary (Mediator)

3Reliability

If code dependencies are altered for testing, then isolation can be achieved, but the original code structure must be preserved

Engineering Contradiction:
Improvetesting isolationVSAvoidmodel generation complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The system generates a test model that is a copy of the original code structure with altered dependencies. This copy allows full isolation for testing purposes while the original code structure remains intact and unchanged, achieving both testing isolation and preservation of original structure.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The system segments the testing process into two distinct parts: the original code structure that remains unchanged and the test model that contains the isolated, modifiable representation. This segmentation allows complex dependency alterations in the model without affecting the original code, managing the complexity of isolation while preserving structure.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS10452517B2Framework for testing logic of code based on model elements
Publication Date: 2019.10.22 SAP SE
  • US10452517B2 patent drawing
  • US10452517B2 patent drawing
  • US10452517B2 patent drawing

AI summary

Various embodiments of systems and methods to provide a testing framework for testing code are described herein. In one aspect, a request to test at least a portion of code is received. A test model composed of model elements representing the portion of the code, code on which the portion of the code depends and one or more preexisting test doubles is generated. An option is provided to define one or more test double elements, in the test model, corresponding to the code on which the portion of the code depends. Further, an option is provided to alter dependencies between the model elements and the defined one or more test double elements in the test model. Furthermore, new one or more code artefacts are generated based on the test model and the generated new one or more code artefacts are executed to test logic of the portion of the code.