Automated Test Suite Generation via Structural and Semantic Code Analysis

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional software testing methods require significant human intervention and time to manually annotate source-code and generate complete test cases, leading to inefficiencies and incomplete test coverage, especially in identifying non-testable parts of the code.

Innovation Solution

A method that automates the generation of a test suite by implementing structural and semantic analysis, adding annotations, generating stubs, and applying mathematical optimization algorithms to categorize test objectives and generate test cases, providing a fully automated and efficient approach to identify testable and non-testable parts of the source-code.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Manufacturing precision

If manual annotation of source-code is performed to generate test cases, then test coverage can be achieved, but time and human effort are significantly increased

Engineering Contradiction:
Improvetest coverageVSAvoidtime for manual annotation
Core Design Contradiction:
Manufacturing precisionVSLoss of time

Solution Approach 1:

The system performs self-service by automatically analyzing the source code structure and generating test cases without requiring manual annotation. The computer means parses the source code, identifies functions and their parameters, and autonomously creates test cases that satisfy coverage criteria, eliminating the need for human annotators to manually mark test objectives in the source code.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent replaces the mechanical process of manual annotation with automated computer-based analysis. Instead of humans reading and annotating source code, the system uses parsing algorithms, semantic analysis, and mathematical optimization to automatically identify test objectives and generate corresponding test cases, substituting human cognitive work with computational processes.

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

2Loss of time

If automated test case generation is implemented, then time is reduced, but test cases may be incomplete without manual review

Engineering Contradiction:
Improvetime for test generationVSAvoidtest case completeness
Core Design Contradiction:
Loss of timeVSManufacturing precision

Solution Approach 1:

The system incorporates feedback mechanisms through mathematical optimization algorithms that iteratively refine test cases based on coverage criteria. The algorithm analyzes the generated test cases, compares them against the source code structure, and adjusts the test suite to ensure completeness, providing continuous feedback to improve test case quality without manual intervention.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent uses mathematical optimization algorithms that systematically vary test parameters (input values, boundary conditions, edge cases) to generate comprehensive test cases. By changing parameters such as input ranges, data types, and execution contexts, the system ensures complete test coverage while maintaining automation, eliminating the need for manual review of individual test cases.

Inventive Principle:
Principle #35Parameter changes

3Manufacturing precision

If non-tested parts of source-code are identified manually, then completeness can be checked, but additional human work is required

Engineering Contradiction:
Improvetest completenessVSAvoidhuman work for verification
Core Design Contradiction:
Manufacturing precisionVSDevice complexity

Solution Approach 1:

The system performs self-verification by automatically comparing generated test cases against the source code structure to identify any uncovered parts. The mathematical optimization algorithm analyzes the source code parsing results and determines which functions or code paths remain untested, providing automatic verification of test completeness without requiring human reviewers to manually check coverage.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent introduces an intermediary layer in the form of a mathematical optimization algorithm that mediates between the source code analysis and the test case generation. This intermediary component automatically verifies test completeness by comparing the generated test suite against the parsed source code structure, acting as a bridge that eliminates the need for human verification while ensuring thorough coverage.

Inventive Principle:
Principle #24Intermediary (Mediator)

4Extent of automation

If structural analysis is performed to automatically generate test cases, then automation is improved, but computational resources are consumed

Engineering Contradiction:
Improveautomation levelVSAvoidcomputing resources
Core Design Contradiction:
Extent of automationVSUse of energy by moving object

Solution Approach 1:

The system performs preliminary actions by parsing the source code and building a structural representation before generating test cases. This preliminary analysis organizes the source code into functions, parameters, and call relationships, creating a ready-to-use model that simplifies subsequent test case generation. By doing this preparatory work upfront, the system reduces the computational burden during the actual test generation phase, improving automation efficiency.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The patent segments the source code analysis into distinct manageable components: parsing the source code, identifying functions, extracting parameters, and generating test cases separately. This segmentation allows each step to be optimized independently and processed more efficiently. The mathematical optimization algorithm works on segmented function-level representations rather than the entire codebase at once, reducing computational resource consumption while maintaining high automation levels.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS11755463B2Method to generate test suite for source-code
Publication Date: 2023.09.12 MITSUBISHI ELECTRIC CORP
  • US11755463B2 patent drawing
  • US11755463B2 patent drawing
  • US11755463B2 patent drawing

AI summary

A method (100) to generate test suite for a source-code (1). The method comprises: a) implementing a structural analysis (101) of said source-code (1) to obtain a completed source-code (1) including: —parsing the source-code, —addition of annotations defining tests objectives, —generation of stubs; b) implementing at least one semantic analysis algorithm including categorizing each set of tests objectives as satisfied, impossible to satisfy or unsatisfied; c) feeding a first list (11) with satisfied test cases; d) feeding a second list (21) with test objectives impossible to satisfy, e) implementing at least one mathematical optimization algorithm (103) on parts corresponding to unsatisfied test objectives; —identifying test cases (113) that satisfy at least a part of said test objectives, —feeding said first list of set of test cases with them, —categorizing said test objectives as satisfied; f) providing a test suite comprising the two lists.