White-box testing via function-to-test mapping
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current software testing methods are inefficient in identifying and addressing changes in code lines, leading to increased complexity and reduced effectiveness in data storage system testing.
Innovation Solution
A method and apparatus for white-box testing that determines changed code lines, identifies the corresponding functions, and selects relevant test cases based on a mapping from functions to test cases, utilizing a state machine to analyze function call relationships and update mappings for target code versions.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If traditional software testing methods are used, then testing coverage is maintained, but testing efficiency decreases and complexity increases
Solution Approach 1:
The patent segments the testing process by dividing test cases into different levels (unit test cases, integration test cases, system test cases) and organizing them in a hierarchical structure. This segmentation allows the testing system to selectively execute only the necessary test cases based on code changes, rather than running all test cases, thereby improving testing efficiency while managing complexity through structured organization.
Solution Approach 2:
The patent implements preliminary action by pre-establishing a mapping relationship between code elements and test cases before actual testing occurs. The system pre-analyzes code dependencies and determines which test cases are associated with which code segments in advance. When code changes are detected, the system can immediately identify and execute only the relevant pre-mapped test cases, significantly reducing testing time and complexity.
2Reliability
If all test cases are executed to ensure coverage, then testing effectiveness is maintained, but testing time increases
Solution Approach 1:
The patent applies partial action by executing only the necessary subset of test cases rather than all test cases. The system identifies code changes and selectively runs only the test cases that are directly affected by those changes, using pre-established mapping relationships. This partial execution approach maintains testing effectiveness for the changed portions while significantly reducing overall testing time by avoiding redundant execution of unrelated test cases.
Solution Approach 2:
The patent replaces the mechanical approach of manually determining which test cases to run with an automated analysis system. The system uses computer-based code parsing, dependency analysis, and automated mapping to identify relevant test cases, substituting manual judgment and mechanical test execution with intelligent automated selection and execution, thereby reducing time loss while maintaining effectiveness.
3Measurement precision
If code changes are manually tracked, then change identification is achieved, but labor intensity increases and accuracy decreases
Solution Approach 1:
The patent replaces manual code change tracking with an automated computer-based system that uses version control integration, code diff analysis, and automated parsing. The system automatically detects code changes by comparing different versions of the codebase, identifies affected code elements, and maps them to relevant test cases without human intervention. This substitution dramatically improves identification accuracy while the automated nature of the system actually reduces overall complexity compared to manual tracking processes.
Data Source
AI summary
Embodiments of the present disclosure provide a method, computer program product and apparatus for a white-box testing by determining a code line being changed in a target version of codes, determining a function to which the code line belongs, determining, based on a first mapping from functions to test cases, a set of test cases corresponding to the function to which the code line belongs, thereby enhancing efficiency of automatic testing.


