Code Testing Method for Single Object Segmentation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current software testing methods generate test cases that include multiple objects under test, leading to execution exceptions and poor test effectiveness due to random operation ordering.

Innovation Solution

A code testing method that determines member variables and constructs operation calling statement sequences for each object under test, creating initial test cases and then reconstructing target test cases to improve coverage and stability by focusing on individual objects.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Ease of manufacture

If one test case includes multiple objects under test with random operation ordering, then test case generation is simpler, but execution exceptions occur easily and test effect is poor

Engineering Contradiction:
Improvetest case generation simplicityVSAvoidtest execution stability
Core Design Contradiction:
Ease of manufactureVSReliability

Solution Approach 1:

The patent divides the test case into multiple independent units, each targeting a single object under test. This segmentation prevents the complexity and random ordering issues that arise when multiple objects are mixed in one test case, thereby improving execution stability while maintaining generation simplicity through automated single-object processing

Inventive Principle:
Principle #1Segmentation

2Reliability

If one test case includes multiple objects under test, then test coverage can be achieved, but test case complexity increases and execution stability decreases

Engineering Contradiction:
Improvetest coverageVSAvoidtest case structure complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The patent segments test cases by object, creating distinct test units for each object under test. This approach maintains comprehensive coverage through systematic generation of test cases for all objects while reducing structural complexity by eliminating the need to manage multiple objects within a single test case

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The test case generation system automatically creates test cases based on object analysis, eliminating the need for manual construction of complex multi-object test cases. The system self-generates appropriate test structures for each object, reducing overall complexity while maintaining coverage

Inventive Principle:
Principle #25Self-service

3Productivity

If random operation ordering is used in test cases, then test case construction is faster, but execution exceptions occur and test effect deteriorates

Engineering Contradiction:
Improvetest case construction speedVSAvoidtest execution success rate
Core Design Contradiction:
ProductivityVSReliability

Solution Approach 1:

The patent performs preliminary analysis of each object to determine the correct operation sequence before generating test cases. This preliminary action ensures operations are executed in the proper order, preventing execution exceptions while maintaining fast automated generation through systematic rather than random ordering

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS20230367701A1Code testing method and apparatus
Publication Date: 2023.11.16 ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
  • US20230367701A1 patent drawing
  • US20230367701A1 patent drawing
  • US20230367701A1 patent drawing

AI summary

The present specification discloses a code testing method and apparatus. The code testing method includes: determining, for each object under test, all member variables corresponding to the object under test and a variable calling statement corresponding to each member variable, and constructing an operation calling statement sequence based on a calling order corresponding to operations under test included in the object under test; constructing an initial test case corresponding to the object under test based on the variable calling statements and the operation calling statement sequence, each initial test case corresponding to only one object under test; and determining a target test case based on each initial test case, and testing to-be-tested code by using the target test case.