Automatic Path Coverage Test Case Generation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Current software testing methods are labor-intensive, costly, and prone to errors due to manual generation of test cases, lacking comprehensive and intelligent automatic testing solutions that can parse source code, generate test cases, and produce reports automatically.

Innovation Solution

An integrated unit testing method based on automatic generation of path coverage test cases, which constructs a control flow graph, generates test cases, and produces reports without manual intervention, using lexical and syntactic analysis to automate the testing process, reducing repetitive tasks and improving efficiency.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If manual test case generation is used, then testing can be performed, but testing cost and time consumption increase significantly

Engineering Contradiction:
Improvetesting effectivenessVSAvoidtesting time consumption
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The system performs self-service by automatically generating test cases from source code without human intervention. The automatic test case generation module parses the source code, constructs control flow graphs, and generates test cases autonomously, eliminating the need for manual test case creation while maintaining high testing effectiveness through comprehensive path coverage.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent replaces the mechanical manual process of test case generation with an automated computational system. The system uses lexical analysis, syntactic analysis, and control flow graph construction algorithms to substitute human labor with automated software processes, significantly reducing testing time while maintaining or improving testing quality.

Inventive Principle:
Principle #28Mechanics substitution (Replace mechanical system)

2Reliability

If manual test case generation is used, then testing can be performed, but testing cost increases due to labor requirements

Engineering Contradiction:
Improvetesting effectivenessVSAvoidtesting system complexity
Core Design Contradiction:
ReliabilityVSDevice complexity

Solution Approach 1:

The testing system is segmented into distinct functional modules: source code parsing module, control flow graph construction module, automatic test case generation module, and test report generation module. This segmentation allows each module to perform its specific function efficiently, reducing overall system complexity while maintaining high testing effectiveness through specialized processing at each stage.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The automatic test case generation system serves multiple functions: it parses source code, constructs control flow graphs, generates test cases, executes tests, and produces reports. This multi-functionality consolidates what would otherwise require multiple separate tools and manual processes into a single unified system, reducing both cost and complexity.

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

3Productivity

If statement coverage or branch coverage methods are used, then testing can be performed quickly, but error detection ability is insufficient

Engineering Contradiction:
Improvetesting efficiencyVSAvoiderror detection precision
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The system uses feedback from the control flow graph analysis to guide test case generation. By analyzing the structured representation of program flow, the system generates test cases that specifically target uncovered paths, continuously improving error detection precision while maintaining efficiency through automated iteration and path coverage tracking.

Inventive Principle:
Principle #23Feedback

Data Source

PatentUS11720477B2Unit testing method based on automatic generation of path coverage test cases
Publication Date: 2023.08.08 SOUTH CHINA UNIV OF TECH
  • US11720477B2 patent drawing
  • US11720477B2 patent drawing
  • US11720477B2 patent drawing

AI summary

The present invention provides a unit testing method based on automatic generation of path coverage test cases. First, obtain a control flow graph of a program to be tested is obtained. Then, an executable code is executed in the generated control flow graph based on of an automatically generated test case, and meanwhile, a fitness value is calculated and acquired based on of an execution result of the executable code, and a sub-node is selected to continue repeating the above process, until a terminal node in the control flow graph is found, and finally a path marker is generated and the fitness value corresponding to the path is obtained. Then, an automatic test case generation algorithm is executed, and the algorithm constantly automatically generates test cases based on of the returned fitness value, and exits when the path is completely covered, or a set execution is timed out.