Test path reduction method based on key path variable and condition screening

Through the test path reduction method based on critical path variables and conditional filtering, the problems of redundancy and low reduction in existing test methods are solved, the number of test cases and coverage are reduced, and the testing process is optimized.

CN120386719APending Publication Date: 2025-07-29BEIJING INST OF SPACECRAFT SYST ENG
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510299004.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-13
Publication Date
2025-07-29

AI Technical Summary

Technical Problem

Existing test methods require a large number of test cases without using case reduction, and ordinary path reduction cannot fully cover nodes and paths, resulting in redundancy and low reduction rates.

Method used

Through the test path reduction method based on critical path variables and condition filtering, the system state diagram is determined, conditions and node pruning are performed, prefix path sets are constructed, unreachable paths are identified, key variables are determined, key variables are constructed, key variables are constructed, irrelevant states and paths are deleted, and test paths are generated.

Benefits of technology

Reduce the number of test cases, improve testing efficiency, cover critical paths and boundary conditions, optimize the testing process, and reduce resource consumption and time overhead.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120386719A_ABST
    Figure CN120386719A_ABST
Patent Text Reader

Abstract

A test path reduction method based on key path variable and condition screening comprises the steps that a system state diagram to be subjected to test path reduction is determined and analyzed, and variables and conditions influencing state conversion are recorded; traversing the state diagram to obtain a complete path condition set, and performing condition pruning and node pruning after logical judgment; constructing a prefix path set, extracting path conditions on all complete paths corresponding to the prefix path set, and constructing a prefix path condition set; judging whether an unreachable prefix path exists in the prefix path condition set, and deleting a complete path containing the unreachable prefix path to obtain a state diagram after path reduction; determining a path key variable; finding out an optimal key variable combination in the state diagram after path reduction; constructing a key variable diagram, and deleting states and transfer paths irrelevant to key variables in the state diagram after path reduction according to the key variable diagram to obtain a final state diagram after reduction; the testing efficiency can be improved, and the burden of testing personnel can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a test path reduction method based on critical path variables and conditional screening, belonging to the field of system testing. Background Art

[0002] Test case reduction is an important technology in software testing. It can help testers reduce the number of test cases while ensuring test coverage, thereby improving test efficiency. The background technology of test case reduction involves knowledge in multiple fields such as path coverage, data flow analysis, symbolic execution, and model checking, and these technologies need to be comprehensively used to achieve efficient test case reduction. Path coverage technology can help testers find all paths in the system, thus ensuring test coverage. Data flow analysis is a technology for test case reduction. It can help testers find data dependencies in the program, thereby reducing the number of test cases. Data flow analysis can help testers find the variable definition and usage relationships in the program, thereby determining which variables need to be tested. Symbolic execution is a static analysis technology. It can help testers find all paths and execution results in the program without executing the program. Symbolic execution can help testers find all paths in the program, thereby reducing the number of test cases. Model checking is a formal verification technology. It can help testers find all states that satisfy specific properties in a given model. Currently, the methods proposed for use case set reduction at home and abroad are divided into three types. The first type is for use case set reduction in white-box testing, the second type is for use case set reduction in black-box testing, and the third type is a general use case reduction method. With the continuous development of technology, test case reduction technology will also be continuously optimized and upgraded to provide more efficient and intelligent test case reduction solutions for software testing.

[0003] Problems existing in the existing methods are as follows:

[0004] 1) When no use case reduction is performed, a large number of test cases may be required during testing, and there may be a large amount of redundancy in a large number of test cases.

[0005] 2) Ordinary path reduction cannot fully cover nodes and paths after reduction, or the reduction rate is too low to meet the test requirements. Summary of the Invention

[0006] The technical problem to be solved by the present invention is: overcoming the deficiencies of the prior art, providing a test path reduction method based on critical path variables and conditional screening, which helps to improve test efficiency and reduce the workload of testers.

[0007] The technical solution of the present invention is as follows: In the first aspect, a test path reduction method based on critical path variables and conditional screening is provided, including:

[0008] Determine the system state diagram for which test path reduction is to be performed, taking into account edge cases and abnormal cases to ensure that the state diagram covers all possible scenarios;

[0009] Analyze the state diagram to determine the transition conditions between each state and the variables involved in each transition condition; record the variables and conditions affecting state transitions, and traverse the state diagram accordingly to obtain a complete set of path conditions;

[0010] After performing logical judgment on the complete set of path conditions, perform conditional pruning and node pruning to obtain a pruned state machine diagram;

[0011] Based on the pruned state machine diagram, construct a prefix path set, and extract the path conditions on all complete paths corresponding to the prefix path set to construct a prefix path condition set;

[0012] Traverse the prefix paths in reverse, identify and delete the unreachable prefix paths in the prefix path condition set to obtain a state diagram after path reduction;

[0013] Based on the variable coverage criterion, determine the path critical variables; find the optimal combination of critical variables in the state diagram after path reduction;

[0014] Based on the path critical variables, construct a critical variable graph to describe the dependency relationship between each state in the state diagram and the critical variables;

[0015] According to the critical variable graph, delete the states and transition paths irrelevant to the critical variables in the state diagram after path reduction to obtain the final reduced state diagram;

[0016] Generate test paths according to the final reduced state diagram and perform tests using test cases.

[0017] Preferably, during conditional pruning, analyze and identify the redundant conditions and impossible conditions in the complete set of path conditions, merge the redundant conditions, and eliminate the impossible conditions.

[0018] Preferably, during node pruning, analyze and remove the unreachable or irrelevant nodes in the state machine diagram.

[0019] Preferably, the method for constructing the prefix path set is as follows:

[0020] First, select a fixed starting state from the pruned state machine diagram as the common starting point for all prefix paths. Then, with the starting state as the root node, generate initial prefix paths of length 1. Subsequently, gradually generate longer prefix paths, where each path is longer than the previous one and shares the same starting sequence, and each new path contains at least one decision branch not used by other prefix paths. In this way, construct all prefix paths in sequence until all branch decision statements are covered.

[0021] Preferably, the method for traversing the prefix paths in reverse, identifying and deleting unreachable prefix paths in the prefix path condition set is as follows:

[0022] Based on the prefix path set, traverse the prefix paths in reverse, extract the branch statements and construct the prefix path condition set, solve all transfer conditions on the prefix path condition set and judge the reachability of the prefix paths where they are located. If unreachable, delete all paths starting with this prefix path from the complete path set. For reachable prefix paths, extract the corresponding complete paths, thereby obtaining the state diagram after path reduction.

[0023] Preferably, when determining the set of path key variables, use a heuristic algorithm or a genetic algorithm to obtain various optimal combinations of key variables through the principles of iteration and natural selection;

[0024] Among them, the key variable refers to: in the test path reduction technology based on critical path variables and condition screening, variables that comprehensively consider the input, output, and execution status of the program, including the input variable set and the output variable set, and are used to construct the key variable graph.

[0025] In the second aspect, a test path reduction system based on critical path variables and condition screening is provided, including: a state diagram analysis module, a pruning module, a prefix path analysis and reduction module, a key variable analysis and reduction module, and a test path generation module; specifically:

[0026] The state diagram analysis module determines the system state diagram to be subjected to test path reduction, and at the same time considers edge cases and abnormal cases to ensure that the state diagram covers all possible scenarios; and analyzes the state diagram to determine the transfer conditions between each state and the variables involved in each transfer condition; records the variables and conditions affecting state transitions, traverses the state diagram accordingly to obtain the complete path condition set, and outputs it to the pruning module;

[0027] The pruning module performs logical judgments on the complete path condition set, performs condition pruning and node pruning to obtain the pruned state machine diagram; sends the pruned state machine diagram to the prefix path analysis and reduction module;

[0028] The prefix path analysis and reduction module constructs a prefix path set based on the pruned state machine graph, extracts the path conditions on all complete paths corresponding to the prefix path set, and constructs a prefix path condition set; traverses the prefix paths in reverse, identifies and deletes the unreachable prefix paths in the prefix path condition set, obtains the state graph after path reduction, and outputs it to the key variable analysis and reduction module;

[0029] The key variable analysis and reduction module determines the path key variables based on the variable coverage criterion; finds the optimal combination of key variables in the state graph after path reduction; constructs a key variable graph based on the path key variables to describe the dependency relationship between each state in the state graph and the key variables; deletes the states and transition paths irrelevant to the key variables in the state graph after path reduction according to the key variable graph, obtains the final reduced state graph, and outputs it to the test path generation module;

[0030] The test path generation module generates test paths according to the final reduced state graph and tests them using test cases.

[0031] Preferably, when the prefix path analysis and reduction module constructs a prefix path set based on the pruned state machine graph:

[0032] First, select a fixed starting state from the pruned state machine graph as the common starting point of all prefix paths; then, take the starting state as the root node to generate the initial prefix paths with a length of 1; subsequently, gradually generate longer prefix paths, each path being longer than the previous one and sharing the same starting sequence, and each new path containing at least one judgment branch not used by other prefix paths; in this way, construct all prefix paths in turn until all branch judgment statements are covered.

[0033] Preferably, when the prefix path analysis and reduction module traverses the prefix paths in reverse to identify and delete the unreachable prefix paths in the prefix path condition set:

[0034] Based on the prefix path set, traverse the prefix paths in reverse, extract the branch statements and construct a prefix path condition set, solve all transfer conditions on the prefix path condition set and judge the reachability of the prefix paths where they are located. If unreachable, delete all paths starting with this prefix path from the complete path set. For the reachable prefix paths, extract the corresponding complete paths, thereby obtaining the state graph after path reduction.

[0035] Preferably, when the key variable analysis and reduction module determines the path key variable set, it uses a heuristic algorithm or a genetic algorithm to obtain various optimal combinations of key variables through the principles of iteration and natural selection.

[0036] The present invention has the following advantages compared with the prior art:

[0037] (1) Reduction in the number of test cases: By reducing test paths, duplicate test cases and redundant test paths can be eliminated, reducing the number of test cases; this helps improve test efficiency and reduces the workload of testers.

[0038] (2) Reduction in resource consumption: The test path reduction method based on condition screening can effectively optimize the test process. Condition pruning and node pruning help simplify the complexity of the state machine, improve operation efficiency, and make it easier to maintain. Detection is performed on the prefix path set, and the detection scale is much smaller than the number of complete paths, reducing the time overhead of detection while taking into account the comprehensiveness of detection.

[0039] (3) Coverage of critical paths and boundary conditions: The test path reduction method for critical path variables can ensure coverage of critical paths and boundary conditions in the system, thus guaranteeing the comprehensiveness and effectiveness of testing. Even if the number of test cases is reduced, important parts of the system can still be fully covered. Description of the Drawings

[0040] Figure 1 is the flowchart of the test path reduction of the present invention;

[0041] Figure 2 is an example of the test path reduction method based on condition screening of the present invention;

[0042] Figure 3 is the schematic diagram of the construction of the prefix path set of the present invention;

[0043] Figure 4 is an example of the test path reduction method of the present invention. Detailed Implementation Manner

[0044] The reduced state diagram test path based on path critical variables is a test path reduction technology based on the state diagram. As Figure 1 shown, the specific algorithm steps are as follows:

[0045] (1) Determine the state diagram: First, it is necessary to determine the system state diagram for which test path reduction is to be performed, including normal operation states, abnormal states, standby states, etc. Consider edge cases and abnormal situations to ensure that the state diagram covers all possible scenarios, including abnormal and edge cases. Then traverse the state diagram accordingly to obtain a complete set of path conditions.

[0046] (2) Determine transfer conditions and variables: Analyze the determined state diagram to determine the transfer conditions between each state and the variables involved in each transfer condition; specifically: Record the variables that affect state transitions, including internal system variables and external inputs. Define the type (such as integer, string) and the valid range or possible values for each variable. Conduct a dependency analysis to analyze how these variables affect state transitions and determine their dependencies.

[0047] (3) Judge and prune the conditions on the path: Conduct a logical judgment on the complete set of path conditions. Among multiple test paths, if some conditions are logically repetitive or one condition is a subset of another condition, perform condition pruning and node pruning to obtain the pruned paths and the set of path conditions.

[0048] (4) Construct the prefix path set and the prefix path condition set: Based on the pruned paths, construct the prefix path set and extract all the path conditions on the complete paths corresponding to the prefix path set to construct the prefix path condition set.

[0049] (5) Perform path reduction: According to the prefix path condition set, judge whether there are unreachable prefix paths in the prefix path condition set. If so, delete the complete paths that contain such unreachable prefix paths; after determining that there are no unreachable prefix paths, obtain the state diagram after path reduction.

[0050] (6) Determine the key path variables: Based on the variable coverage criterion, determine the set of key variables so as to cover all the variables in the state diagram as much as possible. Use methods such as heuristic algorithms or genetic algorithms to find the optimal combination of key variables in the state diagram after path reduction through the principles of iteration and natural selection.

[0051] (7) Construct the key variable diagram: Based on the optimal combination of key variables in the state diagram after path reduction, construct the key variable diagram to represent the dependency relationship between each state and the key variables in the state diagram after path reduction.

[0052] (8) Reduce the state diagram: According to the key variable diagram, delete the states and transfer paths in the state diagram after path reduction that are irrelevant to the key variables to obtain the final reduced state diagram.

[0053] (9) Generate test paths: According to the final reduced state diagram, generate test paths and use test cases for testing.

[0054] The test path generation technology can automatically generate test paths for state machine diagrams with multiple loops. However, there are still inclusion relationships in the generated test paths, that is, there is redundancy in the generated test paths, which leads to a decrease in test efficiency and an increase in test costs. To address the above problems, a test path reduction technology based on critical path variables and condition screening is proposed to reduce the overhead in actual work by simplifying test paths.

[0055] The test path reduction algorithm based on condition screening includes condition pruning and node pruning. Condition pruning reduces the number of test cases by eliminating redundant or impossible conditions, making the test set more concise and effective. Node pruning removes unreachable or irrelevant nodes in the state machine diagram, thus optimizing the test path and making the path more directly related to the function implementation. The path of the state machine diagram after pruning is more concise, and the subsequent test case generation is more efficient, especially in large-scale systems.

[0056] Specifically, this technology analyzes the paths in the state machine diagram. Among multiple test paths, some conditions may be logically repetitive, or one condition is a subset of another condition. In this case, if the condition has been verified on a certain path, then the state transitions with the same condition on other paths can be pruned, that is, a complete test is sufficient to verify all relevant paths without repeated testing. At the same time, unreachable nodes can be deleted to reduce the number of calculations.

[0057] An example of test path reduction based on condition screening is as Figure 2 shown. By traversing, three test paths A→B→C→E, A→B→C→F, and A→B→D→G are obtained, and all branch judgment conditions on the paths are obtained, that is:

[0058]

[0059] When generating a test for the path A→B→C→E, if the condition x < y has been verified to be true, then in the condition x < y && y < z, only need to judge whether y < z is true, and there is no need to repeatedly judge the condition x < y. The condition x < y || y < z on the path A→B→C→F can be directly judged to be true. The condition x > y on the path A→B→D→G is judged to be false, and there is no need to continue executing the subsequent branches on this path, that is, nodes D and G are pruned.

[0060] After pruning is completed, constructing a prefix path set can effectively optimize the testing process. A prefix path set refers to a set of test paths that share the same starting sequence. Constructing a prefix path set can more systematically analyze and plan coverage, especially when the state machine diagram is complex. Test paths can be designed specifically to cover new or less accessed state transitions to ensure more comprehensive test coverage. First, select a fixed starting state from the state machine diagram as the common starting point for all prefix paths; then, with the starting state as the root node, generate initial prefix paths of length 1; subsequently, gradually generate longer prefix paths, each path being longer than the previous one and sharing the same starting sequence, and each new path containing at least one decision branch not used by any other prefix path; in this way, all prefix paths are constructed in sequence until all branch decision statements are covered.

[0061] Specifically, traverse all transition conditions on the prefix path in reverse and determine whether the condition is a branch decision statement or an assignment statement. For a branch decision statement, extract the branch condition expression and put it into the branch condition expression set Q, and put the relevant variables of the branch decision condition into the variable set V. For an assignment statement, if the variable on the left side of the assignment statement is a variable in V, extract the assignment statement and put it into Q as an equation. If the solution result of the constraint condition of the prefix path is unreachable, delete all paths starting with this prefix path from the complete path set. For a prefix path with a reachable solution result, extract all complete paths corresponding to this prefix path from the complete path set, and extract the path conditions on the complete paths for detection and determine reachability.

[0062] The construction result of the prefix path set is as Figure 3 shown. The complete path set obtained by traversing the state machine diagram is Paths = {Path1, Path2,..., Path8}, where Path k represents the k-th path. The prefix path set is prePaths = {prePath1, prePath2, prePath3, prePath4}, where prePath k represents the k-th prefix path.

[0063] Traverse the prefix path in reverse, extract the branch statements and construct the prefix path condition set Q, solve the conditions in the set Q, and if there are unreachable prefix paths, prune the paths starting with the unreachable prefix paths from the complete path set.

[0064] The reduction algorithm based on critical path variables is a test path optimization method. It can reduce the number of test cases and execution time by cutting unnecessary variables in the test path, while maintaining the coverage and effectiveness of test cases. Among them, critical variables refer to: in the test path reduction technology based on critical path variables and condition screening, variables determined by integrating aspects such as the input, output, and execution status of the program, including the input variable set and the output variable set, which are used to construct a critical variable graph to assist in test case design and coverage analysis, and cut unnecessary variables during test path reduction to improve test efficiency and coverage.

[0065] The basic idea of this algorithm is to identify the path critical variables in the test cases, and then generate new test cases based on these critical variables, so as to achieve the purpose of reducing test cases.

[0066] Specifically, this technology first determines the transition conditions between each state and the variables involved in each transition condition by analyzing the state graph after path reduction. Then, according to the coverage of path critical variables, a minimized set of critical variables is selected. Next, the state graph after path reduction is reduced using the set of critical variables, and the states and transition paths irrelevant to the critical variables are deleted, thus obtaining a smaller test path.

[0067] By testing the path of the reduced state graph based on critical path variables, the number of test steps and test data can be significantly reduced, thereby reducing the test cost and test time. At the same time, this technology can also improve the coverage ability of the test path, because critical variables are the coverage key points of the test path. By optimizing the selection and coverage of critical variables, the coverage rate of the test path can be improved.

[0068] The core idea of the test path reduction method based on critical path variables is to identify branch nodes (nodes with out-degree ≥ 2) as critical path variables, dynamically split paths during the depth-first traversal process, and only store critical nodes (branch nodes and leaf nodes), thereby reducing the repeated storage of redundant intermediate nodes and achieving the optimization of test paths. The specific implementation steps are as follows: First, select a node with in-degree 0 as the starting head node. If there are multiple candidates, it is necessary to specify according to the semantics or requirements of the control flow graph. Then, starting from the current head node, perform a depth-first traversal, explore along the branch direction. When encountering a node with out-degree ≥ 2, mark it as a new head node and update the current head node, and store the path at the same time. If a leaf node is reached, record the path from the current head node to the leaf node, and backtrack to the nearest branch node. After backtracking, re-select the next uncompletely explored branch node and continue the traversal until all branches are explored. Finally, merge the common prefix paths to generate a complete test path, and only critical nodes such as the starting node, branch node, and leaf node are retained in the final path.

[0069] An example of test path reduction based on critical path variables is as follows Figure 4 As shown, let the starting node be the node with infinite in-degree. The starting node of this tree is A, and A is the node with infinite in-degree. Let this node be the head node. Using the depth-first traversal algorithm, starting from the head node A, search downward to obtain node B. The out-degree of node B is 2, so the head node is updated to B, and at the same time, nodes A and B are stored; traverse downward from the head node B to obtain node C. The out-degree of node C is 2, update the head node to C, and at the same time, nodes B and C are stored; traverse downward to obtain node E, and store nodes C and E; backtrack to node C, and at the same time traverse downward to obtain node F, and store nodes C and F; return to node B, traverse downward to obtain nodes D and F, and store nodes B, D, and H.

[0070] In the process of generating test cases, the original method is to traverse to obtain three test paths: A→B→C→E, A→B→C→F, A→B→D→G. When generating test cases for the path A→B→C→E, first obtain the boundary data of nodes A, B, C, and D, and use this boundary data to generate test cases. When generating test cases for the path A→B→C→F, first obtain the boundary data of nodes A, B, C, and F, and at the same time use the boundary data to generate test cases. When generating tests for the path A→B→D→G, first obtain the boundary data of nodes A, B, D, and G, and at the same time use the boundary data to generate test cases. After performing critical path variable reduction, first store the boundary data of the common nodes A and B, and then store the boundary data of the common nodes B and C of A→B→C→E and A→B→C→F. Therefore, when generating test cases for A→B→C→E and A→B→C→F, only the boundary data of nodes E and F need to be obtained to generate test cases. When generating test cases for A→B→D→G, since the boundary data of the common nodes A and B have been stored, only the boundary data of nodes D and G need to be obtained to generate test cases.

[0071] The content not described in detail in the specification of the present invention belongs to the prior art well-known to those skilled in the art.

Claims

1. A test path reduction method based on critical path variables and conditional screening, characterized in that Including: Determine the system state diagram for which test path reduction is to be performed, taking into account edge cases and exceptional cases to ensure that the state diagram covers all possible scenarios; Analyze the state diagram to determine the transition conditions between each state and the variables involved in each transition condition; record the variables and conditions that affect state transitions, and traverse the state diagram accordingly to obtain a complete set of path conditions; After performing logical judgment on the complete set of path conditions, perform condition pruning and node pruning to obtain a pruned state machine diagram; Based on the pruned state machine diagram, construct a prefix path set, and extract the path conditions on all complete paths corresponding to the prefix path set to construct a prefix path condition set; Traverse the prefix paths in reverse, identify and delete the unreachable prefix paths in the prefix path condition set to obtain a state diagram after path reduction; Determine the path critical variables based on the variable coverage criterion; Find the optimal combination of critical variables in the state diagram after path reduction; Based on the path critical variables, construct a critical variable diagram to describe the dependency relationship between each state in the state diagram and the critical variables; According to the critical variable diagram, delete the states and transition paths in the state diagram after path reduction that are irrelevant to the critical variables to obtain the final reduced state diagram; Generate test paths according to the final reduced state diagram and perform tests using test cases.

2. The test path reduction method based on critical path variables and conditional filtering according to claim 1, characterized in that: When performing condition pruning, analyze and identify the redundant conditions and impossible conditions in the complete set of path conditions, merge the redundant conditions, and eliminate the impossible conditions.

3. A test path reduction method based on critical path variables and conditional filtering according to claim 1, characterized in that: When performing node pruning, analyze and remove the unreachable or irrelevant nodes in the state machine diagram.

4. A test path reduction method based on critical path variables and conditional screening according to claim 1, characterized in that: The method for constructing the prefix path set is as follows: First, select a fixed starting state from the pruned state machine diagram as the common starting point for all prefix paths; then, use the starting state as the root node to generate initial prefix paths of length 1; subsequently, gradually generate longer prefix paths, each path being longer than the previous one and sharing the same starting sequence, and each new path containing at least one judgment branch not used by any other prefix path; In this way, construct all prefix paths in sequence until all branch judgment statements are covered.

5. A test path reduction method based on critical path variables and conditional screening according to claim 4, characterized in that: The method for traversing the prefix paths in reverse, identifying and deleting the unreachable prefix paths in the prefix path condition set is as follows: Based on the prefix path set, traverse the prefix paths in reverse, extract the branch statements and construct a prefix path condition set, solve all the transition conditions on the prefix path condition set and judge the reachability of the prefix paths where they are located. If a prefix path is unreachable, delete all paths starting with that prefix path from the complete path set. For reachable prefix paths, extract the corresponding complete paths, thus obtaining a state diagram after path reduction.

6. The test path reduction method based on critical path variables and conditional filtering according to claim 1, wherein: When determining the set of path critical variables, use a heuristic algorithm or a genetic algorithm to obtain various optimal combinations of critical variables through the principles of iteration and natural selection; Among them, the critical variables refer to: in the test path reduction technology based on critical path variables and condition screening, the variables that comprehensively consider the input, output, and execution status of the program, including the input variable set and the output variable set, and are used to construct the critical variable diagram.

7. A test path reduction system based on critical path variables and conditional screening, characterized in that Including: State diagram analysis module, pruning module, prefix path analysis and reduction module, critical variable analysis and reduction module, test path generation module; specifically: The state diagram analysis module determines the system state diagram for which test path reduction is to be performed, while considering edge cases and exceptional cases to ensure that the state diagram covers all possible scenarios; and analyzes the state diagram to determine the transition conditions between each state and the variables involved in each transition condition; records the variables and conditions that affect state transitions, traverses the state diagram based on this, obtains a complete set of path conditions, and outputs it to the pruning module; After performing logical judgments on the complete set of path conditions, the pruning module performs conditional pruning and node pruning to obtain a pruned state machine diagram; sends the pruned state machine diagram to the prefix path analysis and reduction module; Based on the pruned state machine diagram, the prefix path analysis and reduction module constructs a prefix path set and extracts the path conditions on all complete paths corresponding to the prefix path set to construct a prefix path condition set; Traverse the prefix path in reverse, identify and delete the unreachable prefix paths in the prefix path condition set to obtain a state diagram after path reduction, and output it to the critical variable analysis and reduction module; Based on the variable coverage criterion, the critical variable analysis and reduction module determines the path critical variables; finds the optimal combination of critical variables in the state diagram after path reduction; constructs a critical variable graph based on the path critical variables to describe the dependency relationship between each state in the state diagram and the critical variables; According to the critical variable graph, delete the states and transition paths in the state diagram after path reduction that are irrelevant to the critical variables to obtain a final reduced state diagram, and output it to the test path generation module; Based on the final reduced state diagram, the test path generation module generates test paths and tests them using test cases.

8. A test path reduction system based on critical path variables and conditional filtering according to claim 7, characterized in that: When the prefix path analysis and reduction module constructs a prefix path set based on the pruned state machine diagram: First, select a fixed starting state from the pruned state machine diagram as the common starting point for all prefix paths; then, using the starting state as the root node, generate an initial prefix path with a length of 1; subsequently, gradually generate longer prefix paths, each path being longer than the previous one and sharing the same starting sequence, and at the same time, each new path contains at least one decision branch that has not been used by other prefix paths; In this way, construct all prefix paths in sequence until all branch decision statements are covered.

9. The test path reduction system based on critical path variables and conditional screening according to claim 8, characterized in that: When the prefix path analysis and reduction module traverses the prefix path in reverse to identify and delete the unreachable prefix paths in the prefix path condition set: Based on the prefix path set, traverse the prefix path in reverse, extract the branch statements and construct a prefix path condition set, solve all transition conditions on the prefix path condition set and judge the reachability of the prefix path where it is located. If it is unreachable, delete all paths starting with this prefix path from the complete path set. For the reachable prefix paths, extract the corresponding complete paths, thereby obtaining a state diagram after path reduction.

10. A test path reduction system based on critical path variables and conditional screening according to claim 7, characterized in that: When determining the set of path critical variables, the critical variable analysis and reduction module uses a heuristic algorithm or a genetic algorithm to obtain various optimal combinations of critical variables through the principles of iteration and natural selection.