Test case causal graph data processing method and device

By applying technical means such as force-oriented graph layout optimizer and node overlap detector in the test case causal graph, the shortcomings in the node layout and path planning of the causal graph are solved, and the visualization effect and practicality of the causal graph are significantly improved.

CN120029926AActive Publication Date: 2025-05-23KAIYUN LIANCHUANG (BEIJING) TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202510504504.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-22
Publication Date
2025-05-23
Estimated Expiration
2045-04-22

AI Technical Summary

Technical Problem

The prior art has shortcomings in the node layout, spatial distribution and path planning of the causal graphs for test cases, which leads to the intuition of the graph layout results that are not intuitive enough, affecting the readability and practicality of the causal graphs.

Method used

By designing a test case causal graph data processing method, a force-oriented graph layout optimizer is used to combine gravity and repulsive force coefficients to build a hierarchical layout tree, calculate node complexity weights and hierarchical coefficients, and realize accurate calculation of node coordinates. At the same time, a node overlap detector and a path planner are introduced to optimize the adaptive offset of node location and connection path.

Benefits of technology

It effectively solves the shortcomings of traditional technologies in node layout, spatial distribution and path planning, and significantly improves the visualization effect and practicality of the causal graph of software test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029926A_ABST
    Figure CN120029926A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a test case causal graph data processing method and device, and the method and device achieve the standardized processing of data through the innovative construction of a causal graph structure data extraction mechanism and the distribution of node identifiers. And designing a force-oriented graph layout optimizer, and realizing accurate calculation of node coordinates through node complexity weights and hierarchical coefficients in combination with the gravitational repulsive force coefficients and the hierarchical layout tree. And a node overlapping detector and a path planner are introduced to realize adaptive offset of node positions and optimal planning of connection paths. According to the method, the defects of the traditional technology in the aspects of node layout, spatial distribution, path planning and the like are effectively overcome, and the visualization effect and practicability of the software test case causal diagram are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a method and device for processing test case cause-and-effect graph data. Background Art

[0002] Existing test case causal graph data processing methods have obvious shortcomings. Traditional systems lack systematic layout optimization of causal nodes and constraint nodes, making it difficult to achieve a reasonable distribution between nodes, and have limitations in the visualization of complex relationships.

[0003] In addition, existing technologies have bottlenecks in node layout. Most systems fail to effectively use force-directed graph algorithms for dynamic layout and lack comprehensive consideration of node levels and complexity, resulting in less intuitive graph layout results.

[0004] The existing system has technical shortcomings in path planning. The lack of effective node overlap detection and connection line overlap avoidance mechanism affects the readability and practicality of the causal graph. Solving these problems is of great significance to improving the display effect of the causal graph of software test cases. Summary of the invention

[0005] In response to the problems in the prior art, the present application provides a test case causal graph data processing method and device, which can effectively solve the shortcomings of traditional technology in node layout, spatial distribution and path planning, and significantly improve the visualization effect and practicality of software test case causal graph.

[0006] In order to solve at least one of the above problems, the present application provides the following technical solutions: In a first aspect, the present application provides a test case causal graph data processing method, comprising: Receive a data file and extract causal graph structure data, extract a constraint node set, a causal node set and a causal relationship set in the data file, the causal node set includes a cause node and an effect node, the effect node is configured with positive and negative rule attributes, the constraint node is configured with positive and negative constraint attributes, a unique identifier is assigned to each node in the constraint node set and the causal node set, and a node relationship training data set is constructed; Constructing a layout optimization model and calculating node layout coordinates, training a force-directed graph layout optimizer based on the node relationship training data set, applying an attraction coefficient and a repulsion coefficient to the causal node set, obtaining a balanced distance between nodes through iterative calculation, constructing a hierarchical layout tree according to the balanced distance, calculating the depth level of each causal node to obtain a level coefficient, traversing the causal relationship set to construct an adjacency matrix, calculating a node complexity weight based on the adjacency matrix, multiplying the level coefficient and the node complexity weight by a node width parameter and a height parameter to obtain causal node coordinates, multiplying the level coefficient and the sequence number weight of the constraint node by a node layout parameter to obtain constraint node coordinates, and constructing a spatial distribution model based on the causal node coordinates and the constraint node coordinates; The spatial distribution model is input into a node overlap detector, which calculates a distance matrix between adjacent nodes, triggers a position shift for node pairs that are less than a minimum spacing threshold, and inputs the shifted node coordinates into a path planner, which calculates an optimal connection path based on the causal relationship set to avoid overlapping connection lines, and generates a software test case causal graph with an adaptive layout, and outputs the software test case causal graph for display.

[0007] Furthermore, it also includes: constructing a data parser to read the content of the data file, converting the content of the data file into a character stream, parsing the character stream based on a preset data structure template to extract constraint node information, causal node information, and inter-node relationship information, respectively establishing a constraint node set and a causal node set according to the node information, establishing a causal relationship set according to the inter-node relationship information, and storing the constraint node set, causal node set, and causal relationship set in a node data cache; Read the node set information from the node data cache, traverse the causal node set to mark each node as a cause node or a result node, traverse the result node to configure positive and negative rule attribute identifiers for each result node, traverse the constraint node set to configure positive and negative constraint attribute identifiers for each constraint node, generate a globally unique identifier and assign it to each node, and write the configured node information into the node attribute table.

[0008] Furthermore, it also includes: extracting node position feature vectors and connection relationship feature vectors from a node relationship training data set, training model parameters of a force-directed graph layout optimizer based on a layout optimization loss function, inputting the model parameters into an attraction calculation unit and a repulsion calculation unit, respectively, the attraction calculation unit calculates an attraction coefficient according to the connection relationship between nodes, the repulsion calculation unit calculates a repulsion coefficient according to the spatial distance between nodes, and inputting the calculated attraction coefficient and repulsion coefficient into the layout optimizer; The causal node set is input into the layout optimizer, the gravitational action value between the connected nodes is calculated based on the gravitational coefficient, the repulsive action value between all node pairs is calculated based on the repulsive coefficient, the gravitational action value and the repulsive action value are applied to the nodes for iterative calculation, and it is determined whether the change in node position is less than a preset convergence threshold. When the position change is less than the preset convergence threshold, the equilibrium distance between nodes is output.

[0009] Furthermore, it also includes: constructing a spatial distance matrix based on the balanced distance, using a hierarchical clustering algorithm to hierarchically divide the distance matrix to obtain a node hierarchy tree, traversing the node hierarchy tree to calculate the shortest path length from each causal node to the root node, normalizing the shortest path length to obtain a node depth level value, and calculating a level coefficient based on the product of the node depth level value and a preset level weight coefficient; The causal relationship set is traversed to obtain the connection relationship between nodes, an N-order square matrix is ​​constructed to represent the node connection status to obtain an adjacency matrix, the adjacency matrix is ​​subjected to power operation to obtain a node reachability matrix, the out-degree value and the in-degree value of each node in the reachability matrix are calculated, and the weighted sum of the out-degree value and the in-degree value is used as the node complexity weight.

[0010] Furthermore, it also includes: reading a node width parameter and a height parameter from a layout parameter configuration table, multiplying the level coefficient by the node width parameter to calculate the horizontal coordinate of the causal node, multiplying the node complexity weight by the node height parameter to calculate the vertical coordinate of the causal node, traversing the constraint node set to obtain the sequence number of each constraint node, normalizing the sequence number of the constraint node to obtain the sequence number weight, and multiplying the level coefficient and the sequence number weight of the constraint node by the node layout parameter to calculate the horizontal and vertical coordinates of the constraint node; The causal node coordinates and the constraint node coordinates are input into the spatial distribution model builder, the spatial distribution density matrix is ​​calculated based on the node coordinates, a node distribution probability model is constructed using a non-parametric kernel density estimation method, and the node distribution probability model is integrated with the coordinate mapping relationship to obtain a spatial distribution model.

[0011] Furthermore, the method further includes: inputting node coordinate information in the spatial distribution model into a node overlap detector, constructing a KD tree spatial index structure based on the node coordinates, using the KD tree to calculate the nearest neighbor node set of each node, calculating the Euclidean distance of the node pairs in the nearest neighbor node set to obtain a distance matrix, and comparing the distance matrix with a preset minimum spacing threshold to generate an overlap detection result; Node pairs whose distance is less than a minimum spacing threshold are selected from the overlap detection results, the overlap vector between the node pairs is calculated, the position offset is calculated based on the direction of the overlap vector, the position offset is applied to the overlapped nodes to adjust the coordinates, and the adjusted node coordinates are updated to the spatial distribution model.

[0012] Furthermore, the method further includes: inputting the offset node coordinates and the causal relationship set into a path planner, constructing a gridded path cost map based on the node coordinates, calling the A-star search algorithm for each connection relationship to calculate a set of candidate paths from the start node to the target node, using a Bezier curve to smooth the candidate paths to obtain connection line paths, calculating the number of intersections between the connection line paths as the path cost, and selecting the connection line path with the smallest path cost as the optimal connection path; Traverse the causal relationship set to obtain the connection relationship between nodes, draw connection lines according to the connection relationship and the optimal connection path, write the node coordinate information and the connection line path information into the graphics drawing buffer, call the graphics rendering engine to convert the buffer data into a software test case causal graph, and output the software test case causal graph to a display device.

[0013] In a second aspect, the present application provides a test case causal graph data processing device, comprising: A data preprocessing module is used to receive a data file and extract causal graph structure data, extract a constraint node set, a causal node set and a causal relationship set in the data file, wherein the causal node set includes a cause node and an effect node, the effect node is configured with forward and reverse rule attributes, and the constraint node is configured with forward and reverse constraint attributes, and a unique identifier is assigned to each node in the constraint node set and the causal node set to construct a node relationship training data set; A model construction module, for constructing a layout optimization model and calculating node layout coordinates, training a force-directed graph layout optimizer based on the node relationship training data set, the force-directed graph layout optimizer applies an attraction coefficient and a repulsion coefficient to the causal node set, obtains a balanced distance between nodes through iterative calculation, constructs a hierarchical layout tree according to the balanced distance, calculates the depth level of each causal node to obtain a level coefficient, traverses the causal relationship set to construct an adjacency matrix, calculates node complexity weights based on the adjacency matrix, multiplies the level coefficient and the node complexity weight by a node width parameter and a height parameter respectively to obtain causal node coordinates, multiplies the level coefficient and the sequence number weight of the constraint node by a node layout parameter respectively to obtain constraint node coordinates, and constructs a spatial distribution model based on the causal node coordinates and the constraint node coordinates; A causal graph determination module is used to input the spatial distribution model into a node overlap detector, the node overlap detector calculates a distance matrix between adjacent nodes, triggers a position shift for node pairs that are less than a minimum spacing threshold, and inputs the shifted node coordinates into a path planner, the path planner calculates an optimal connection path based on the causal relationship set to avoid overlapping connection lines, and generates a software test case causal graph with an adaptive layout, and outputs the software test case causal graph for display.

[0014] In a third aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the test case causal graph data processing method when executing the program.

[0015] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the test case causal graph data processing method.

[0016] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which, when executed by a processor, implements the steps of the test case causal graph data processing method.

[0017] It can be seen from the above technical solution that the present application provides a test case causal graph data processing method and device, which innovatively constructs a causal graph structure data extraction mechanism and realizes the standardized processing of data through node identifier allocation. A force-directed graph layout optimizer is designed, combining the gravitational repulsion coefficient and the hierarchical layout tree, and the accurate calculation of node coordinates is realized through node complexity weights and hierarchical coefficients. A node overlap detector and a path planner are introduced to realize the adaptive offset of node positions and the optimized planning of connection paths. This method effectively solves the shortcomings of traditional technologies in node layout, spatial distribution and path planning, and significantly improves the visualization effect and practicality of software test case causal graphs. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0019] Figure 1 A flow chart of a test case causal graph data processing method in an embodiment of the present application; Figure 2 It is a structural diagram of a test case cause-effect graph data processing device in an embodiment of the present application; Figure 3 It is a schematic diagram of the structure of an electronic device in an embodiment of the present application.

[0020] Reference numerals: Electronic device 9600, central processing unit 9100, memory 9140, communication module 9110, input unit 9120, audio processor 9130, display 9160, power supply 9170, buffer memory 9141, application / function storage unit 9142, data storage unit 9143, driver program storage unit 9144, antenna 9111, speaker 9131, microphone 9132. DETAILED DESCRIPTION

[0021] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0022] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0023] Taking into account the problems existing in the prior art, the present application provides a test case causal graph data processing method and device, which innovatively constructs a causal graph structure data extraction mechanism and realizes the standardized processing of data through node identifier allocation. A force-directed graph layout optimizer is designed, combining the gravitational repulsion coefficient and the hierarchical layout tree, and the accurate calculation of node coordinates is realized through node complexity weights and hierarchical coefficients. A node overlap detector and a path planner are introduced to realize the adaptive offset of node positions and the optimized planning of connection paths. This method effectively solves the shortcomings of traditional technologies in node layout, spatial distribution and path planning, and significantly improves the visualization effect and practicality of software test case causal graphs.

[0024] In order to effectively solve the deficiencies of traditional technologies in terms of node layout, spatial distribution and path planning, and significantly improve the visualization effect and practicality of software test case causal graphs, the present application provides an embodiment of a test case causal graph data processing method, see Figure 1 The test case causal graph data processing method specifically includes the following contents: Step S101: receiving a data file and extracting causal graph structure data, extracting a constraint node set, a causal node set and a causal relationship set in the data file, wherein the causal node set includes a cause node and an effect node, the effect node is configured with forward and reverse rule attributes, and the constraint node is configured with forward and reverse constraint attributes, assigning a unique identifier to each node in the constraint node set and the causal node set, and constructing a node relationship training data set; Optionally, this embodiment focuses on the data processing requirements of the software test case cause-effect graph, and innovatively designs a structured data extraction and preprocessing method. In large-scale software testing scenarios, the cause-effect relationships and constraints between test cases are intricate, and the original data files need to be accurately parsed and structured. This embodiment first constructs a dedicated data parser that can accurately identify and extract various types of node information and relationship information in data files.

[0025] This embodiment designs a three-layer data structure template, which is used to parse constraint node information, causal node information, and node relationship information respectively. The data parsing process adopts a streaming processing mechanism, converting the data file content into a character stream and then parsing it according to preset grammar rules. The parser first identifies the node type identifier, and then extracts the node attribute information and relationship description information. This hierarchical parsing strategy ensures the accuracy and completeness of data extraction.

[0026] This embodiment innovatively designs a bidirectional attribute configuration mechanism. For the result node, forward rule attributes and reverse rule attributes are configured to describe the expected state and abnormal state of the test result. The forward rule attribute represents the expected output of the test case under normal conditions, and the reverse rule attribute describes the output result under abnormal conditions. This bidirectional attribute design makes the test case more complete and can effectively cover various test scenarios.

[0027] This embodiment optimizes the attribute configuration scheme of the constraint node. The positive constraint attribute of the constraint node is used to describe the necessary conditions for test execution, and the reverse constraint attribute defines the limit conditions of the test. For example, in Web application testing, a functional test case may require the user to have specific permissions (positive constraint) and require the system load not to exceed a specific threshold (reverse constraint). This constraint attribute design ensures the executability of the test case.

[0028] This embodiment implements an efficient unique identifier allocation mechanism. A distributed ID generation algorithm is used to ensure the uniqueness of each node identifier in a large-scale test scenario. The generation of the identifier takes into account factors such as node type, creation time, and sequence number: ID = Type_prefix + Timestamp + Sequence, where Type_prefix is ​​the node type prefix, Timestamp is the timestamp, and Sequence is the incremental sequence number. This identifier format facilitates rapid retrieval and association analysis of nodes.

[0029] This embodiment optimizes the process of constructing a node relationship training data set. Based on the extracted node information and relationship information, a training sample containing node attribute features and relationship features is constructed. For each node pair, its attribute feature vector and relationship feature vector are extracted to form structured training data. These training data will be used for subsequent layout optimization model training to provide data support for realizing adaptive layout.

[0030] This embodiment has shown significant advantages in actual software testing. Taking the order processing test of the e-commerce system as an example, it can accurately extract the causal relationship of order status conversion (such as payment completion leading to order status update), business constraints (such as account balance limit) and other information, and establish a clear node association relationship. This structured data processing solution provides a reliable foundation for subsequent test case analysis and execution.

[0031] This embodiment achieves efficient organization and management of test data. Through standardized data extraction and preprocessing, the comprehensibility and maintainability of test cases are significantly improved. Testers can clearly understand the test logic and quickly locate and modify problems in test cases. At the same time, the structured data format also facilitates version management and reuse of test cases.

[0032] This embodiment establishes an extensible data processing framework. Through flexible data structure templates and attribute configuration mechanisms, it can adapt to different types of test scenario requirements. When a new test dimension needs to be added, only the corresponding data structure template and attribute definition need to be expanded without modifying the overall framework, which greatly improves the scalability of the system.

[0033] This embodiment lays the foundation for the subsequent test process optimization. By establishing a complete node relationship training data set, it provides necessary data support for automated testing and intelligent testing. These structured test data not only support the current cause-effect graph construction, but can also be used to optimize test strategies and improve test coverage.

[0034] Step S102: construct a layout optimization model and calculate the node layout coordinates, train a force-directed graph layout optimizer based on the node relationship training data set, the force-directed graph layout optimizer applies an attraction coefficient and a repulsion coefficient to the causal node set, obtains the balance distance between nodes through iterative calculation, constructs a hierarchical layout tree according to the balance distance, calculates the depth level of each causal node to obtain the level coefficient, traverses the causal relationship set to construct an adjacency matrix, calculates the node complexity weight based on the adjacency matrix, multiplies the level coefficient and the node complexity weight by the node width parameter and the height parameter respectively to obtain the causal node coordinates, multiplies the level coefficient and the sequence number weight of the constraint node by the node layout parameters respectively to obtain the constraint node coordinates, and constructs a spatial distribution model based on the causal node coordinates and the constraint node coordinates.

[0035] Optionally, this embodiment innovatively designs a force-directed adaptive layout algorithm for the layout optimization problem of the causal graph of software test cases. In order to ensure the readability and aesthetics of the causal graph, this embodiment first constructs a force-directed graph layout optimizer based on the node relationship training data set, which adjusts the node position by simulating the gravitational force and repulsive force in the physical system.

[0036] This embodiment designs a dual-coefficient force-guided model. The calculation formulas of the attraction coefficient F_attract and the repulsion coefficient F_repel are:

[0037] Where d is the distance between nodes, w is the connection weight, and k1 and k2 are adjustable coefficient parameters. This mechanical model ensures that connected nodes tend to be close to each other and unconnected nodes move away from each other, thus forming a clear visual hierarchy.

[0038] This embodiment optimizes the training process of the layout optimizer. Node position features and connection relationship features are extracted from the node relationship training data set to construct a layout optimization loss function:

[0039] Among them, L_distance represents the distance loss between nodes, L_overlap represents the node overlap loss, L_aesthetic represents the aesthetic loss, and α, β, and γ are weight coefficients. The model parameters are optimized by the gradient descent method to achieve a balance between readability and aesthetics in the layout result.

[0040] This embodiment innovatively implements a mechanism for constructing a hierarchical layout tree. Based on the equilibrium distance calculated by the force-directed model, a hierarchical clustering algorithm is used to construct a node hierarchy tree. The depth level of the node is determined by calculating the shortest path length from each causal node to the root node. The calculation of the hierarchy coefficient takes into account the normalized value of the path length and the preset hierarchy weight:

[0041] This hierarchical layout strategy ensures a clear presentation of cause-effect relationships.

[0042] This embodiment designs a complexity weight calculation method. By traversing the causal relationship set, an adjacency matrix A is constructed, where A[i][j]=1 indicates that there is a connection between nodes i and j. The adjacency matrix is ​​exponentially operated to obtain a reachability matrix, and the out-degree and in-degree values ​​of each node are calculated. The complexity weight of a node is defined as:

[0043] Among them, OutDegree is the out-degree value, InDegree is the in-degree value, and w1 and w2 are weight coefficients. This weight calculation method reflects the importance of the node in the causal network.

[0044] This embodiment shows significant advantages in software testing scenarios. Taking the interface test of the microservice architecture as an example, when there are complex service call relationships, this solution can clearly display the dependencies between interfaces and the test process. Through reasonable layout optimization, test cases with strong correlation are visually closer, which makes it easier for testers to understand and manage test logic.

[0045] This embodiment implements adaptive coordinate calculation. For causal nodes, the horizontal coordinate is obtained by multiplying the level coefficient with the node width parameter, and the vertical coordinate is obtained by multiplying the complexity weight with the height parameter. For constraint nodes, considering their serial number in the test process, the normalized serial number weight is multiplied with the layout parameter to determine the position. This calculation method ensures the balance and readability of the node layout.

[0046] This embodiment innovatively constructs a spatial distribution model. Based on the calculated node coordinates, a node distribution probability model is constructed using a kernel density estimation method:

[0047] Where K is the kernel function, h is the bandwidth parameter, and (xi,yi) is the node coordinate. This probabilistic model is helpful for subsequent node overlap detection and layout optimization.

[0048] This embodiment shows good scalability in practical applications. When the scale of test cases increases, the layout optimizer can automatically adjust the layout parameters to maintain the clarity and readability of the cause-effect diagram. By dynamically adjusting the parameters of the force-directed model, the system can adapt to test scenarios of different scales and complexities.

[0049] This embodiment provides strong support for the visual management of test cases. Through the optimized layout algorithm, testers can intuitively understand the relationship between test cases and quickly identify key test paths and potential test blind spots. This visualization capability significantly improves test efficiency and test coverage.

[0050] This embodiment establishes a complete layout optimization framework. From the training of the force-directed model to the construction of the spatial distribution model, a set of systematic layout optimization solutions is formed. This framework is not only applicable to current test case management, but can also be extended to other scenarios that require relationship diagram visualization.

[0051] Step S103: Input the spatial distribution model into a node overlap detector, which calculates a distance matrix between adjacent nodes, triggers a position offset for node pairs that are less than a minimum spacing threshold, and inputs the offset node coordinates into a path planner, which calculates an optimal connection path based on the causal relationship set to avoid overlapping connection lines, and generates a software test case causal graph with an adaptive layout, and outputs the software test case causal graph for display.

[0052] Optionally, this embodiment innovatively designs an adaptive layout optimization solution for the problems of node overlap and connection line overlap in the causal graph of software test cases. In complex test scenarios, the visualization of a large number of nodes and connection relationships often leads to visual confusion, affecting the tester's understanding of the test logic. Therefore, this embodiment first constructs an efficient node overlap detector and uses a KD tree data structure to achieve fast spatial proximity search.

[0053] This embodiment designs a dynamic distance matrix calculation method. Based on the KD tree spatial index, the Euclidean distance between each node and its nearest neighbor node is calculated:

[0054] Where (xi,yi) and (xj,yj) are the coordinates of nodes i and j respectively. By maintaining the nearest neighbor node set, the complexity of distance calculation is significantly reduced, making the overlap detection process more efficient.

[0055] This embodiment optimizes the position offset strategy. When it is detected that the distance between the node pairs is less than the preset minimum spacing threshold, the overlap vector is calculated and the offset is generated:

[0056] Where D is the actual distance, D_min is the minimum spacing threshold, Direction is the overlap direction vector, and Scale is the offset scale factor. This dynamic offset mechanism ensures the uniformity and readability of node layout.

[0057] This embodiment innovatively implements a path planning algorithm. An improved A search method is used to discretize the node coordinate space into a grid cost map. The design of the cost function takes into account multiple factors:

[0058] Where Distance represents the path length, Crossing represents the number of intersections with other paths, Smoothness represents the path smoothness, and wi is the weight coefficient.

[0059] This embodiment optimizes the generation process of connection paths. For each causal relationship, multiple candidate paths are generated and smoothed using Bézier curves:

[0060] where P0 and P3 are the path endpoints, P1 and P2 are the control points, and t ∈ [0, 1]. By adjusting the positions of the control points, natural transitions and aesthetic presentations of the connecting lines are achieved.

[0061] This embodiment demonstrates significant advantages in software integration testing scenarios. Taking the end-to-end testing of a microservices architecture as an example, when there is a complex service call chain, this solution can clearly display each node in the test process and their dependencies. Through reasonable node layout and connection line planning, it helps testers quickly understand the test logic and locate potential problems.

[0062] This embodiment implements an adaptive graphics rendering mechanism. Based on the calculated node coordinates and connection paths, a graphics rendering buffer is constructed. The rendering process takes into account the hierarchical relationship and importance of the nodes, and enhances the expression effect of information through appropriate visual encodings (such as color, size, shape, etc.).

[0063] This embodiment innovatively designs an interactive layout adjustment function. When testers need to manually adjust the positions of certain nodes, the system can update the layout of the affected area in real time and automatically optimize the relevant connection paths. This interactive ability greatly improves the maintainability of the causal diagram.

[0064] This embodiment shows good performance in practical applications. Even when dealing with a large-scale test case set, the overlap detection and path planning algorithms can still maintain high execution efficiency. Through optimization techniques such as spatial indexing and heuristic search, the real-time response ability of layout adjustment is ensured.

[0065] This embodiment provides intuitive visual support for test case management. Through clear node layout and connection paths, testers can quickly grasp the logical relationships between test cases, effectively identify blind spots and redundancies in test coverage. This visualization ability significantly improves the design efficiency of test scenarios.

[0066] This embodiment establishes a complete visualization framework. From node overlap detection to path planning optimization, and then to the final graphics rendering, a systematic visualization solution is formed. This framework is not only applicable to the causal diagram representation of test cases, but can also be extended to other scenarios that require complex relationship visualization.

[0067] This embodiment provides a basis for subsequent test optimization. Through intuitive visualization, the test team can better understand and optimize the test strategy and improve test efficiency and quality. At the same time, this visualization capability also provides an important reference for automated test case generation.

[0068] From the above description, it can be seen that the test case causal graph data processing method provided in the embodiment of the present application can realize the standardized processing of data through the allocation of node identifiers by innovatively constructing a causal graph structure data extraction mechanism. A force-directed graph layout optimizer is designed, combining the gravitational repulsion coefficient and the hierarchical layout tree, and the accurate calculation of node coordinates is realized through node complexity weights and hierarchical coefficients. A node overlap detector and a path planner are introduced to realize the adaptive offset of node positions and the optimized planning of connection paths. This method effectively solves the shortcomings of traditional technologies in node layout, spatial distribution and path planning, and significantly improves the visualization effect and practicality of software test case causal graphs.

[0069] In one embodiment of the test case causal graph data processing method of the present application, the following contents may also be specifically included: Step S201: construct a data parser to read the data file content, convert the data file content into a character stream, parse the character stream based on a preset data structure template to extract constraint node information, causal node information, and inter-node relationship information, respectively establish a constraint node set and a causal node set according to the node information, establish a causal relationship set according to the inter-node relationship information, and store the constraint node set, causal node set, and causal relationship set into a node data cache; Step S202: Read the node set information from the node data cache, traverse the causal node set to mark each node as a cause node or an effect node, traverse the effect node to configure positive and negative rule attribute identifiers for each effect node, traverse the constraint node set to configure positive and negative constraint attribute identifiers for each constraint node, generate a globally unique identifier and assign it to each node, and write the configured node information into the node attribute table.

[0070] Optionally, this embodiment innovatively designs a set of efficient data parsing and node marking solutions for the data preprocessing requirements of the software test case causal graph. This embodiment first builds a dedicated data parser, adopts a multi-level streaming processing architecture, and ensures efficient parsing and accurate extraction of large-scale test data.

[0071] This embodiment designs a hierarchical data structure template. The template definition adopts the JSON Schema format and contains three main parts: constraint node template (defining test preconditions and restrictions), causal node template (describing test input and expected output), and relationship template (describing the dependencies between nodes). During data parsing, the parser first converts the data file into a character stream, and then performs structured parsing according to the preset template:

[0072] Among them, type represents the node type, condition represents the constraint condition, priority represents the priority, value represents the node value, and dependency represents the dependency relationship.

[0073] This embodiment optimizes the data cache mechanism. A hierarchical cache strategy is adopted to store the node sets obtained by parsing in different cache levels:

[0074] The Primary_Cache is used to store frequently accessed core node information, and the Secondary_Cache is used to store complete node sets and relationship data. This hierarchical caching strategy significantly improves data access efficiency.

[0075] This embodiment innovatively implements a node marking algorithm. By analyzing the dependencies between nodes, a depth-first search is used to determine the type of the node: if the node has only outgoing edges, it is marked as a cause node; if the node has only incoming edges, it is marked as a result node; if it has both outgoing and incoming edges, it is marked according to its main role in the test process.

[0076] This embodiment optimizes the rule attribute configuration scheme. For the fruit node, the forward and reverse rule attributes are configured:

[0077] Among them, expected_output defines the expected result of normal execution, and error_output defines the output status under abnormal circumstances. This two-way rule configuration ensures the completeness of the test case.

[0078] This embodiment shows significant advantages in the Web application testing scenario. Taking the user registration function test as an example, the constraint node can define the username rules (length limit, character requirements, etc.), the cause node can be the input user information, and the result node can be the registration result status. Through clear node marking and attribute configuration, testers can accurately grasp the test logic.

[0079] This embodiment implements an efficient identifier generation mechanism. A distributed ID generation algorithm is used to generate a globally unique identifier by combining the node type, timestamp, and random factors:

[0080] Where f(NodeType) is the node type encoding function, which ensures the uniqueness and traceability of the identifier.

[0081] This embodiment innovatively designs the attribute table storage structure. The node attribute table adopts a column storage solution to store node ID, type, attribute and other information in columns, supporting efficient attribute query and update operations. At the same time, an incremental update mechanism for the attribute table is implemented to ensure the real-time performance of the data.

[0082] This embodiment shows good scalability in practical applications. When the test scenario is expanded or the test requirements are changed, only the corresponding data structure template needs to be adjusted without modifying the core logic of the parser. This flexible architecture design significantly improves the maintainability of the system.

[0083] This embodiment provides a solid data foundation for test case management. Through standardized data processing and attribute configuration, a clear test case knowledge base is established. The test team can quickly understand the test logic and efficiently design and maintain test cases.

[0084] This embodiment establishes a complete data preprocessing framework. From data parsing to node labeling, and then to attribute configuration, a systematic data processing solution is formed. This framework not only supports the current causal graph construction, but can also be extended to other test data processing scenarios.

[0085] This embodiment provides support for subsequent test automation. Through structured data processing and attribute configuration, it lays the foundation for automatic generation and intelligent optimization of test cases. These pre-processed data can also be used for test coverage analysis and test strategy optimization.

[0086] In one embodiment of the test case causal graph data processing method of the present application, the following contents may also be specifically included: Step S301: extracting node position feature vectors and connection relationship feature vectors from the node relationship training data set, training model parameters of the force-directed graph layout optimizer based on the layout optimization loss function, inputting the model parameters into the gravitational calculation unit and the repulsive calculation unit respectively, the gravitational calculation unit calculates the gravitational coefficient according to the connection relationship between nodes, and the repulsive calculation unit calculates the repulsive coefficient according to the spatial distance between nodes, and inputting the calculated gravitational coefficient and repulsive coefficient into the layout optimizer; Step S302: Input the causal node set into the layout optimizer, calculate the gravitational action value between the connected nodes based on the gravitational coefficient, calculate the repulsive action value between all node pairs based on the repulsive coefficient, apply the gravitational action value and the repulsive action value to the nodes for iterative calculation, determine whether the node position change is less than the preset convergence threshold, and output the equilibrium distance between the nodes when the position change is less than the preset convergence threshold.

[0087] Optionally, this embodiment innovatively designs a force-directed graph layout solution based on deep learning for the layout optimization problem of the software test case causal graph. By analyzing the node relationship training data set, feature vectors containing location information and connection relationships are extracted. These feature vectors contain the topological structure and spatial distribution characteristics between the test case nodes.

[0088] This embodiment designs a dual feature vector representation method. The position feature vector P contains the initial coordinates and attribute information of the node:

[0089] Where (x, y) is the coordinate, type is the node type, weight is the node weight, and level is the level information. The connection relationship feature vector R describes the dependency relationship between nodes:

[0090] Among them, source and target are the starting and ending nodes of the connection, strength is the connection strength, and direction is the dependency direction.

[0091] This embodiment optimizes the design of the layout optimization loss function. The loss function comprehensively considers multiple optimization objectives:

[0092] Among them, L_distance represents the distance loss between nodes, L_density represents the node density loss, L_direction represents the direction consistency loss, and L_aesthetic represents the aesthetic loss. is the weight coefficient. This multi-objective loss function ensures the overall optimization of the layout results.

[0093] This embodiment innovatively implements a gravity calculation mechanism. The gravity calculation unit calculates the gravity coefficient based on the connection relationship characteristics:

[0094] Where k1 is the gravitational constant, strength is the connection strength, and distance is the distance between nodes. This gravitational model ensures the clustering effect of related nodes, making logically related test cases visually closer.

[0095] This embodiment optimizes the repulsion calculation strategy. The repulsion calculation unit considers the spatial distance and attribute differences between nodes:

[0096] Where k2 is the repulsion constant, d0 is the feature distance, and type_diff is the node type difference. This repulsion model prevents excessive node aggregation and maintains the clarity of the layout.

[0097] This embodiment shows significant advantages in microservice testing scenarios. Taking the service call chain test as an example, when there are complex service dependencies, the force-directed layout can automatically arrange the test nodes of related services in appropriate locations, making the test process more intuitive. Through gravity, service test nodes with close call relationships naturally gather together; through repulsion, nodes in different test scenarios maintain an appropriate distance.

[0098] This embodiment implements an adaptive iterative optimization mechanism. In each iteration, the node forces are calculated and the positions are updated:

[0099] Where η is the learning rate, which is adjusted dynamically to ensure convergence. At the same time, the position change is calculated:

[0100] When Delta is less than a preset threshold, it is considered that the equilibrium state is reached.

[0101] This embodiment innovatively designs a convergence judgment strategy. It not only considers the position change of a single node, but also evaluates the stability of the overall layout: When Stability is lower than the threshold, the final node-to-node equilibrium distance matrix is ​​output. This strategy ensures the global convergence of layout optimization.

[0102] This embodiment shows good performance in practical applications. Even when processing large-scale test case sets, the layout optimization algorithm can still maintain a stable convergence speed. Through the optimized force-directed model and efficient iteration strategy, the efficiency of layout calculation is significantly improved.

[0103] This embodiment provides strong support for test case visualization. Through adaptive layout optimization, testers can clearly understand the logical relationship between test cases and quickly identify key test paths. This intuitive layout significantly improves the design and maintenance efficiency of test solutions.

[0104] This embodiment establishes a complete layout optimization framework. From feature extraction to force-directed calculation, and then to iterative optimization, a systematic layout solution is formed. This framework is not only applicable to the causal graph layout of test cases, but can also be extended to the visualization scenarios of other complex relationship graphs.

[0105] This embodiment provides a basis for subsequent test optimization. Through reasonable layout optimization, it helps the test team to better understand and optimize the test strategy and improve test efficiency and quality. At the same time, this layout capability also provides an important reference for automated test case generation.

[0106] In one embodiment of the test case causal graph data processing method of the present application, the following contents may also be specifically included: Step S401: constructing a spatial distance matrix based on the balanced distance, using a hierarchical clustering algorithm to hierarchically divide the distance matrix to obtain a node hierarchy tree, traversing the node hierarchy tree to calculate the shortest path length from each causal node to the root node, normalizing the shortest path length to obtain a node depth level value, and calculating a level coefficient based on the product of the node depth level value and a preset level weight coefficient; Step S402: traverse the causal relationship set to obtain the connection relationship between nodes, construct an N-order square matrix to represent the node connection status to obtain an adjacency matrix, perform a power operation on the adjacency matrix to obtain a node reachability matrix, calculate the out-degree value and in-degree value of each node in the reachability matrix, and use the weighted sum of the out-degree value and the in-degree value as the node complexity weight.

[0107] Optionally, this embodiment innovatively designs a hierarchical analysis solution based on spatial distance and connection relationship for the hierarchical structure optimization problem of software test case causal graph. Based on the balanced distance obtained by force-directed layout optimization, a global spatial distance matrix D is constructed, and its matrix elements are calculated as follows:

[0108] Where (xi,yi) and (xj,yj) represent the spatial coordinates of nodes i and j respectively. This distance representation method accurately reflects the spatial distribution characteristics between test nodes.

[0109] This embodiment optimizes the implementation of the hierarchical clustering algorithm. The hierarchical clustering method is used to process the distance matrix, and the clustering process uses an adaptive distance threshold:

[0110] in is the mean distance, is the standard deviation, It is an adjustable parameter. By setting the dynamic threshold, the rationality of the hierarchical division is ensured, avoiding the problem of over-stratification or too sparse layers.

[0111] This embodiment innovatively implements a node hierarchy tree construction mechanism. A hierarchy tree structure is constructed based on clustering results, and each node records its parent node and child node information:

[0112] Where id is the node identifier, parent is the parent node reference, children is the child node list, and level is the level information. This tree structure clearly expresses the hierarchical relationship between test cases.

[0113] This embodiment designs a shortest path calculation strategy. A breadth-first search algorithm is used to calculate the shortest path length from each causal node to the root node:

[0114] Edge_weight is the weight of each edge on the path. The path length is mapped to the interval [0,1] through normalization:

[0115] This embodiment optimizes the calculation method of the level coefficient. Multiply the node depth level value by the preset level weight coefficient:

[0116] The Weight_factor is dynamically adjusted according to the importance of the node. This calculation method ensures the rationality and interpretability of the hierarchical division.

[0117] This embodiment shows significant advantages in microservice testing scenarios. Taking the order processing process test of the e-commerce system as an example, through hierarchical analysis, the hierarchical relationship of each test stage from order creation, payment processing to logistics distribution is clearly displayed, helping testers to better understand and manage the test process.

[0118] This embodiment implements an efficient adjacency matrix construction method. By traversing the causal relationship set, an N-order adjacency matrix A is constructed:

[0119] This representation method intuitively reflects the direct dependencies between test nodes.

[0120] This embodiment innovatively designs a reachability analysis method. The reachability matrix is ​​obtained by performing a power operation on the adjacency matrix. :

[0121] Where n is the total number of nodes. Through matrix exponentiation, the indirect dependencies between test nodes are discovered, which helps to understand the transitive impact of test cases.

[0122] This embodiment optimizes the calculation of node complexity weights. The out-degree and in-degree of each node are calculated based on the reachability matrix:

[0123] OutDegree indicates the number of nodes affected by other nodes, and InDegree indicates the number of nodes affected by other nodes. is the weight coefficient. This complexity measure reflects the importance of the node in the test network.

[0124] This embodiment shows good scalability in practical applications. When the scale of test cases grows, the hierarchical analysis method can still maintain stable performance, providing strong support for the management of large-scale test cases. Through reasonable hierarchical division and complexity assessment, the maintainability of test cases is significantly improved.

[0125] This embodiment provides a systematic analysis framework for test case management. From spatial distance analysis to hierarchical structure division, and then to complexity evaluation, a complete analysis solution is formed. This framework not only supports the current cause-effect diagram analysis, but can also be extended to other test analysis scenarios.

[0126] This embodiment lays the foundation for subsequent test optimization. Through clear hierarchical structure and complexity analysis, the test team can better understand the dependencies of test cases, optimize test strategies, and improve test efficiency. At the same time, this analysis capability also provides important guidance for automated testing.

[0127] In one embodiment of the test case causal graph data processing method of the present application, the following contents may also be specifically included: Step S501: read the node width parameter and height parameter from the layout parameter configuration table, multiply the level coefficient by the node width parameter to calculate the horizontal coordinate of the causal node, multiply the node complexity weight by the node height parameter to calculate the vertical coordinate of the causal node, traverse the constraint node set to obtain the sequence number of each constraint node, normalize the constraint node sequence number to obtain the sequence number weight, and multiply the level coefficient and sequence number weight of the constraint node by the node layout parameter to calculate the horizontal and vertical coordinates of the constraint node; Step S502: Input the causal node coordinates and the constraint node coordinates into the spatial distribution model builder, calculate the spatial distribution density matrix based on the node coordinates, use the non-parametric kernel density estimation method to build a node distribution probability model, and integrate the node distribution probability model with the coordinate mapping relationship to obtain the spatial distribution model.

[0128] Optionally, this embodiment innovatively designs an adaptive coordinate calculation and distribution modeling scheme for the spatial layout optimization problem of the software test case causal graph. This embodiment first defines a flexible layout parameter configuration mechanism, including node width parameters (Width_param) and height parameters (Height_param). These parameters are dynamically adjusted through the configuration table to ensure the configurability and adaptability of the layout.

[0129] This embodiment optimizes the calculation method of the causal node coordinates. The horizontal coordinate calculation adopts the hierarchical weighted formula:

[0130] Where Level_coef is the level coefficient, Width_param is the width parameter, and Scale_x is the horizontal scaling factor. The vertical coordinate calculation is combined with the node complexity:

[0131] Where Complexity_weight is the complexity weight, Height_param is the height parameter, and Scale_y is the vertical scaling factor.

[0132] This embodiment innovatively implements the normalization of the sequence numbers of constraint nodes. The sequence numbers of constraint nodes are normalized to min-max:

[0133] Where Sequence is the original sequence number, Min_seq and Max_seq are the minimum and maximum values ​​of the sequence number respectively. This normalization process ensures the uniform distribution of constraint nodes.

[0134] This embodiment designs a calculation strategy for constrained node coordinates. The calculation of horizontal and vertical coordinates comprehensively considers the level coefficient and the sequence number weight:

[0135] in is the weight coefficient, and Layout_param is the layout parameter. This calculation method ensures the reasonable distribution of constraint nodes.

[0136] This embodiment optimizes the construction of the spatial distribution density matrix. A two-dimensional density matrix is ​​constructed based on all node coordinates:

[0137] Where K is the kernel function, h is the bandwidth parameter, and (xi,yj) is the grid point coordinate. This density representation method intuitively reflects the spatial distribution characteristics of the nodes.

[0138] This embodiment shows significant advantages in the microservice integration test scenario. Taking the test case of the payment system as an example, the causal nodes represent different payment process test points, and the constraint nodes represent various payment restriction conditions. Through reasonable coordinate calculation, related test nodes are naturally clustered in space to form a clear test logic block.

[0139] This embodiment implements a non-parametric kernel density estimation method. Density estimation is performed using a Gaussian kernel function:

[0140] Where n is the number of nodes, h is the bandwidth parameter, and (xi,yi) is the node coordinate. This estimation method accurately captures the distribution characteristics of the nodes.

[0141] This embodiment innovatively designs a distribution probability model. The kernel density estimation result is converted into a probability distribution:

[0142] This probabilistic model provides a basis for subsequent node overlap detection and position adjustment.

[0143] This embodiment optimizes the integration solution of the spatial distribution model. The node distribution probability model is combined with the coordinate mapping relationship:

[0144] Where Prob is the probability distribution matrix and Coord_map is the coordinate mapping relationship. This integration solution supports subsequent layout optimization.

[0145] This embodiment shows good scalability in practical applications. When the scale of test cases grows, the distribution model can dynamically adapt to maintain the clarity and readability of the layout. Through appropriate parameter adjustment, the system can handle test scenarios of different scales and complexities.

[0146] This embodiment provides systematic support for test case visualization. From coordinate calculation to distribution modeling, a complete set of spatial layout solutions is formed. This solution not only supports the current causal diagram layout, but can also be extended to the visualization requirements of other test scenarios.

[0147] This embodiment lays the foundation for subsequent layout optimization. Through an accurate spatial distribution model, the system can better handle problems such as node overlap and connection line overlap, and improve the readability and practicality of the test case cause-and-effect diagram. At the same time, this distribution model also provides an important reference for automated layout optimization.

[0148] In one embodiment of the test case causal graph data processing method of the present application, the following contents may also be specifically included: Step S601: input the node coordinate information in the spatial distribution model into the node overlap detector, construct a KD tree spatial index structure based on the node coordinates, use the KD tree to calculate the nearest neighbor node set of each node, calculate the Euclidean distance of the node pairs in the nearest neighbor node set to obtain a distance matrix, and compare the distance matrix with a preset minimum spacing threshold to generate an overlap detection result; Step S602: Filter out node pairs whose distance is less than the minimum spacing threshold from the overlap detection results, calculate the overlap vector between the node pairs, calculate the position offset based on the direction of the overlap vector, apply the position offset to the overlapping nodes to adjust the coordinates, and update the adjusted node coordinates to the spatial distribution model.

[0149] Optionally, this embodiment innovatively designs a set of overlap detection and position adjustment solutions based on KD trees to solve the node overlap problem of software test case causal graphs. In complex test scenarios, the layout of a large number of test nodes is prone to visual overlap, affecting the readability of the causal graph. This embodiment first constructs an efficient KD tree spatial index structure to achieve fast adjacent node search.

[0150] This embodiment optimizes the KD tree construction strategy and adopts an adaptive segmentation dimension selection method:

[0151] Among them, var(coordinates) calculates the variance of the coordinates of each dimension. The dimension with the largest variance is selected for segmentation to ensure the balance of the tree structure. The node storage structure contains location information and node attributes:

[0152] This embodiment innovatively implements the nearest neighbor node search. Using an improved radius search algorithm, the search radius is dynamically adjusted:

[0153] Where node_size is the node size and search_factor is the search factor. Perform a region search on each node:

[0154] This search strategy ensures that no potential overlapping nodes are missed.

[0155] This embodiment designs a distance matrix calculation method. Calculate the Euclidean distance for the node pairs in the nearest neighbor node set:

[0156] Where (xi,yi) is the node center coordinate, and ri is the node radius. This distance calculation takes into account the actual space occupied by the node and provides more accurate overlap detection.

[0157] This embodiment optimizes the overlap detection judgment standard. Compare the distance matrix with the minimum spacing threshold:

[0158] Min_distance is dynamically adjusted according to the node type and importance:

[0159] This embodiment shows significant advantages in microservice testing scenarios. Taking API interface testing as an example, when multiple related test cases are concentrated in the same area, the overlap detector can accurately identify visually crowded areas and maintain clear visibility of test nodes through position adjustment.

[0160] This embodiment realizes the accurate calculation of the overlap vector. For the overlapping node pairs, the overlap vector is calculated:

[0161] Where overlap_ratio is the overlap coefficient. Calculate the position offset based on the overlap vector:

[0162] This calculation method ensures the naturalness of node separation.

[0163] This embodiment innovatively designs a position adjustment strategy. Considering the importance and constraints of the node, the actual offset is calculated:

[0164] Among them, importance_weight reflects the importance of the node, and constraint_factor indicates the degree of position constraint. This adjustment strategy ensures the position stability of key nodes.

[0165] This embodiment optimizes the coordinate update mechanism. Iteratively adjust the overlapping nodes:

[0166] At the same time, check whether new overlaps are generated after adjustment, and perform multiple rounds of optimization if necessary. Finally, update the adjusted coordinates into the spatial distribution model.

[0167] This embodiment shows good performance in practical applications. Through KD tree indexing and efficient overlap detection algorithm, the computational overhead can be kept low even when processing large-scale test cases. The system can quickly respond to layout changes and adjust node positions in real time.

[0168] This embodiment provides reliable guarantee for test case visualization. Through accurate overlap detection and reasonable position adjustment, the clarity and readability of the cause-effect diagram are ensured. Testers can better understand the relationship between test cases and improve test efficiency.

[0169] This embodiment establishes a complete layout optimization framework. From spatial index construction to position adjustment, a systematic overlap processing solution is formed. This framework is not only applicable to the current causal graph layout, but can also be extended to other visualization scenarios.

[0170] This embodiment provides a basis for subsequent layout optimization. Through dynamic overlap detection and adjustment, the system can continuously optimize node layout and adapt to the evolution and changes of test cases. This adaptive capability provides long-term support for test case management.

[0171] In one embodiment of the test case causal graph data processing method of the present application, the following contents may also be specifically included: Step S701: Input the offset node coordinates and causal relationship set into the path planner, build a gridded path cost map based on the node coordinates, call the A-star search algorithm for each connection relationship to calculate the candidate path set from the start node to the target node, use the Bezier curve to smooth the candidate path to obtain the connection line path, calculate the number of intersections between the connection line paths as the path cost, and select the connection line path with the smallest path cost as the optimal connection path; Step S702: traverse the causal relationship set to obtain the connection relationship between nodes, draw connection lines according to the connection relationship and the optimal connection path, write the node coordinate information and the connection line path information into the graphics drawing buffer, call the graphics rendering engine to convert the buffer data into a software test case causal graph, and output the software test case causal graph to the display device.

[0172] Optionally, this embodiment innovatively designs a set of intelligent path planning solutions based on cost maps for the path planning and rendering optimization problems of the cause-effect graph of software test cases. In complex test scenarios, a large number of connection relationships can easily lead to overlapping connection lines, affecting the readability of the cause-effect graph. This embodiment first constructs an accurate gridded path cost map to achieve intelligent planning of connection paths.

[0173] This embodiment optimizes the cost map construction strategy. The two-dimensional space is discretized into grid cells, and the cost value of each cell is calculated as follows:

[0174] Node_density represents the node density, Edge_density represents the density of existing edges, Distance_factor represents the distance factor to the node, and wi is the weight coefficient. This cost calculation ensures that the path avoids congested areas.

[0175] This embodiment innovatively improves A Search algorithm. The heuristic function design considers multiple factors:

[0176] Where manhattan_distance is the Manhattan distance, crossing_penalty is the cross penalty term, and smoothness_factor is the smoothness factor. is the weight coefficient. This heuristic design guides the algorithm to find a better path.

[0177] This embodiment designs a candidate path generation mechanism. By adjusting the parameters of the A star search, multiple candidate paths are generated for each connection relationship:

[0178] Each path Pi is a sequence of grid points. By adjusting the search parameters and cost weights, the diversity and feasibility of candidate paths are ensured.

[0179] This embodiment optimizes the smoothing process of the Bezier curve. Apply cubic Bezier curve interpolation to each candidate path:

[0180] Where P0 and P3 are the endpoints of the path, P1 and P2 are control points, and t∈[0,1]. The selection of control points takes into account the overall shape of the path and the node orientation.

[0181] This embodiment shows significant advantages in microservice testing scenarios. Taking the service call chain test as an example, when there are complex service dependencies, this solution can generate a clear connection path, accurately display the call relationship between services, avoid the confusion of connection lines, and make the test logic clearer.

[0182] This embodiment achieves accurate evaluation of path cost. The number of intersections is calculated for each smoothed path:

[0183] Where intersection_count is the number of intersections with other paths, path_length is the path length, and λ is the length weight. The path with the smallest total cost is selected as the optimal solution.

[0184] This embodiment innovatively designs a graphics drawing buffer. The buffer adopts a hierarchical structure:

[0185] Each layer contains corresponding drawing information and supports independent updating and rendering. This layered design improves rendering efficiency and maintainability.

[0186] This embodiment optimizes the calling mechanism of the rendering engine. According to different types of graphic elements, corresponding rendering strategies are selected:

[0187] Ensures the correct rendering and visual effects of various elements.

[0188] This embodiment shows good performance in practical applications. Through efficient path planning algorithms and optimized rendering mechanisms, a smooth interactive experience can be maintained even when processing large-scale test cases. The system can respond to layout changes in real time and quickly update connection paths.

[0189] This embodiment provides a complete solution for test case visualization. From path planning to graphics rendering, a systematic visualization solution is formed. Testers can clearly understand the relationship between test cases and improve test efficiency.

[0190] This embodiment establishes a flexible visualization framework. Through configurable parameters and scalable rendering strategies, the system can adapt to different test scenario requirements. This framework is not only applicable to the current cause-effect diagram drawing, but can also be extended to other test visualization scenarios.

[0191] This embodiment provides a basis for subsequent test optimization. Through intuitive visual expression, it helps the test team better understand and optimize the test strategy, improve test coverage and efficiency. At the same time, this visualization capability also provides an important reference for automated testing.

[0192] In order to effectively solve the deficiencies of traditional technologies in terms of node layout, spatial distribution and path planning, and significantly improve the visualization effect and practicality of software test case causal graphs, the present application provides an embodiment of a test case causal graph data processing device for implementing all or part of the contents of the test case causal graph data processing method, see Figure 2 The test case causal graph data processing device specifically includes the following contents: The data preprocessing module 10 is used to receive a data file and extract causal graph structure data, extract the constraint node set, causal node set and causal relationship set in the data file, the causal node set includes a cause node and an effect node, the effect node is configured with positive and negative rule attributes, the constraint node is configured with positive and negative constraint attributes, a unique identifier is assigned to each node in the constraint node set and the causal node set, and a node relationship training data set is constructed; A model construction module 20 is used to construct a layout optimization model and calculate node layout coordinates, train a force-directed graph layout optimizer based on the node relationship training data set, apply an attraction coefficient and a repulsion coefficient to the causal node set, obtain a balanced distance between nodes through iterative calculation, construct a hierarchical layout tree according to the balanced distance, calculate the depth level of each causal node to obtain a level coefficient, traverse the causal relationship set to construct an adjacency matrix, calculate the node complexity weight based on the adjacency matrix, multiply the level coefficient and the node complexity weight by the node width parameter and the height parameter respectively to obtain the causal node coordinates, multiply the level coefficient and the sequence number weight of the constraint node by the node layout parameter respectively to obtain the constraint node coordinates, and construct a spatial distribution model based on the causal node coordinates and the constraint node coordinates; The causal graph determination module 30 is used to input the spatial distribution model into a node overlap detector, which calculates the distance matrix between adjacent nodes, triggers position offset for node pairs that are less than a minimum spacing threshold, and inputs the offset node coordinates into a path planner. The path planner calculates the optimal connection path based on the causal relationship set to avoid overlapping connection lines, and generates a software test case causal graph with an adaptive layout, and outputs the software test case causal graph for display.

[0193] From the above description, it can be seen that the test case causal graph data processing device provided in the embodiment of the present application can realize the normalized processing of data through the allocation of node identifiers by innovatively constructing a causal graph structure data extraction mechanism. A force-directed graph layout optimizer is designed, combining the gravitational repulsion coefficient and the hierarchical layout tree, and the accurate calculation of node coordinates is realized through node complexity weights and hierarchical coefficients. A node overlap detector and a path planner are introduced to realize the adaptive offset of node positions and the optimized planning of connection paths. This method effectively solves the shortcomings of traditional technologies in node layout, spatial distribution and path planning, and significantly improves the visualization and practicality of software test case causal graphs.

[0194] From the hardware level, in order to effectively solve the deficiencies of traditional technologies in terms of node layout, spatial distribution, and path planning, and significantly improve the visualization effect and practicality of the software test case causal graph, the present application provides an embodiment of an electronic device for implementing all or part of the contents of the test case causal graph data processing method, and the electronic device specifically includes the following contents: Processor, memory, communication interface and bus; wherein the processor, memory and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between the test case cause and effect diagram data processing device and the core business system, user terminal and related database and other related equipment; the logic controller can be a desktop computer, a tablet computer and a mobile terminal, etc., but the present embodiment is not limited thereto. In the present embodiment, the logic controller can be implemented with reference to the embodiment of the test case cause and effect diagram data processing method and the embodiment of the test case cause and effect diagram data processing device in the embodiment, and the contents thereof are incorporated herein, and the repeated parts are not repeated.

[0195] It is understandable that the user terminal may include a smart phone, a tablet electronic device, a network set-top box, a portable computer, a desktop computer, a personal digital assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Among them, the smart wearable device may include smart glasses, a smart watch, a smart bracelet, etc.

[0196] In practical applications, part of the test case causal graph data processing method can be executed on the electronic device side as described above, or all operations can be completed in the client device. The specific selection can be based on the processing capability of the client device and the limitations of the user's usage scenario. This application does not limit this. If all operations are completed in the client device, the client device may also include a processor.

[0197] The client device may have a communication module (i.e., a communication unit) that can communicate with a remote server to achieve data transmission with the server. The server may include a server on the task scheduling center side, and other implementation scenarios may also include a server on an intermediate platform, such as a server on a third-party server platform that has a communication link with the task scheduling center server. The server may include a single computer device, or a server cluster consisting of multiple servers, or a server structure of a distributed device.

[0198] Figure 3 FIG. 9 is a schematic block diagram of the system structure of the electronic device 9600 according to an embodiment of the present application. Figure 3As shown, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. It is worth noting that Figure 3 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.

[0199] In one embodiment, the test case causal graph data processing method function may be integrated into the central processing unit 9100. The central processing unit 9100 may be configured to perform the following control: Step S101: receiving a data file and extracting causal graph structure data, extracting a constraint node set, a causal node set and a causal relationship set in the data file, wherein the causal node set includes a cause node and an effect node, the effect node is configured with forward and reverse rule attributes, and the constraint node is configured with forward and reverse constraint attributes, assigning a unique identifier to each node in the constraint node set and the causal node set, and constructing a node relationship training data set; Step S102: construct a layout optimization model and calculate node layout coordinates, train a force-directed graph layout optimizer based on the node relationship training data set, apply an attraction coefficient and a repulsion coefficient to the causal node set, obtain a balanced distance between nodes through iterative calculation, construct a hierarchical layout tree according to the balanced distance, calculate the depth level of each causal node to obtain a level coefficient, traverse the causal relationship set to construct an adjacency matrix, calculate the node complexity weight based on the adjacency matrix, multiply the level coefficient and the node complexity weight by the node width parameter and the height parameter respectively to calculate the causal node coordinates, multiply the level coefficient and the sequence number weight of the constraint node by the node layout parameter respectively to calculate the constraint node coordinates, and construct a spatial distribution model based on the causal node coordinates and the constraint node coordinates; Step S103: Input the spatial distribution model into a node overlap detector, which calculates a distance matrix between adjacent nodes, triggers a position offset for node pairs that are less than a minimum spacing threshold, and inputs the offset node coordinates into a path planner, which calculates an optimal connection path based on the causal relationship set to avoid overlapping connection lines, and generates a software test case causal graph with an adaptive layout, and outputs the software test case causal graph for display.

[0200] From the above description, it can be seen that the electronic device provided in the embodiment of the present application realizes the normalized processing of data through the allocation of node identifiers by innovatively constructing a causal graph structure data extraction mechanism. A force-directed graph layout optimizer is designed, combining the gravitational repulsion coefficient and the hierarchical layout tree, and the accurate calculation of node coordinates is realized through node complexity weights and hierarchical coefficients. A node overlap detector and a path planner are introduced to realize the adaptive offset of node positions and the optimized planning of connection paths. This method effectively solves the shortcomings of traditional technologies in node layout, spatial distribution and path planning, and significantly improves the visualization and practicality of the causal graph of software test cases.

[0201] In another embodiment, the test case causal graph data processing device can be configured separately from the central processing unit 9100. For example, the test case causal graph data processing device can be configured as a chip connected to the central processing unit 9100, and the test case causal graph data processing method function is implemented through the control of the central processing unit.

[0202] like Figure 3 As shown, the electronic device 9600 may also include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is worth noting that the electronic device 9600 does not necessarily have to include Figure 3 In addition, the electronic device 9600 may also include Figure 3 For components not shown, reference may be made to the prior art.

[0203] like Figure 3 As shown, the central processing unit 9100 is sometimes also referred to as a controller or an operation control, and may include a microprocessor or other processor device and / or logic device. The central processing unit 9100 receives input and controls the operation of various components of the electronic device 9600.

[0204] The memory 9140 may be, for example, one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The above-mentioned information related to the failure may be stored, and a program for executing the relevant information may also be stored. The CPU 9100 may execute the program stored in the memory 9140 to implement information storage or processing, etc.

[0205] The input unit 9120 provides input to the central processing unit 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used to display display objects such as images and texts. The display may be, for example, an LCD display, but is not limited thereto.

[0206] The memory 9140 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that saves information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application / function storage unit 9142, which is used to store application programs and function programs or processes for executing the operation of the electronic device 9600 through the central processor 9100.

[0207] The memory 9140 may also include a data storage unit 9143 for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit 9144 of the memory 9140 may include various drivers for communication functions of the electronic device and / or for executing other functions of the electronic device (such as messaging applications, address book applications, etc.).

[0208] The communication module 9110 is a transmitter / receiver that sends and receives signals via the antenna 9111. The communication module 9110 (transmitter / receiver) is coupled to the central processor 9100 to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal.

[0209] Based on different communication technologies, multiple communication modules 9110 may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless LAN module. The communication module 9110 (transmitter / receiver) is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide an audio output via the speaker 9131 and receive an audio input from the microphone 9132, thereby realizing a common telecommunication function. The audio processor 9130 may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor 9130 is also coupled to the central processor 9100, so that recording can be performed on the local machine through the microphone 9132, and the sound stored on the local machine can be played through the speaker 9131.

[0210] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all the steps in the test case cause-effect graph data processing method in the above embodiment, where the execution subject is a server or a client. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, all the steps in the test case cause-effect graph data processing method in the above embodiment are implemented. For example, when the processor executes the computer program, the following steps are implemented: Step S101: receiving a data file and extracting causal graph structure data, extracting a constraint node set, a causal node set and a causal relationship set in the data file, wherein the causal node set includes a cause node and an effect node, the effect node is configured with forward and reverse rule attributes, and the constraint node is configured with forward and reverse constraint attributes, assigning a unique identifier to each node in the constraint node set and the causal node set, and constructing a node relationship training data set; Step S102: construct a layout optimization model and calculate node layout coordinates, train a force-directed graph layout optimizer based on the node relationship training data set, apply an attraction coefficient and a repulsion coefficient to the causal node set, obtain a balanced distance between nodes through iterative calculation, construct a hierarchical layout tree according to the balanced distance, calculate the depth level of each causal node to obtain a level coefficient, traverse the causal relationship set to construct an adjacency matrix, calculate the node complexity weight based on the adjacency matrix, multiply the level coefficient and the node complexity weight by the node width parameter and the height parameter respectively to calculate the causal node coordinates, multiply the level coefficient and the sequence number weight of the constraint node by the node layout parameter respectively to calculate the constraint node coordinates, and construct a spatial distribution model based on the causal node coordinates and the constraint node coordinates; Step S103: Input the spatial distribution model into a node overlap detector, which calculates a distance matrix between adjacent nodes, triggers a position offset for node pairs that are less than a minimum spacing threshold, and inputs the offset node coordinates into a path planner, which calculates an optimal connection path based on the causal relationship set to avoid overlapping connection lines, and generates a software test case causal graph with an adaptive layout, and outputs the software test case causal graph for display.

[0211] From the above description, it can be seen that the computer-readable storage medium provided in the embodiment of the present application realizes the normalized processing of data through the allocation of node identifiers by innovatively constructing a causal graph structure data extraction mechanism. A force-directed graph layout optimizer is designed, combining the gravitational repulsion coefficient and the hierarchical layout tree, and the accurate calculation of node coordinates is realized through node complexity weights and hierarchical coefficients. A node overlap detector and a path planner are introduced to realize the adaptive offset of node positions and the optimized planning of connection paths. This method effectively solves the shortcomings of traditional technologies in node layout, spatial distribution and path planning, and significantly improves the visualization and practicality of the causal graph of software test cases.

[0212] The embodiments of the present application also provide a computer program product capable of implementing all the steps of the test case causal graph data processing method in the above embodiment, where the execution subject is a server or a client. When the computer program / instruction is executed by a processor, the steps of the test case causal graph data processing method are implemented. For example, the computer program / instruction implements the following steps: Step S101: receiving a data file and extracting causal graph structure data, extracting a constraint node set, a causal node set and a causal relationship set in the data file, wherein the causal node set includes a cause node and an effect node, the effect node is configured with forward and reverse rule attributes, and the constraint node is configured with forward and reverse constraint attributes, assigning a unique identifier to each node in the constraint node set and the causal node set, and constructing a node relationship training data set; Step S102: construct a layout optimization model and calculate node layout coordinates, train a force-directed graph layout optimizer based on the node relationship training data set, apply an attraction coefficient and a repulsion coefficient to the causal node set, obtain a balanced distance between nodes through iterative calculation, construct a hierarchical layout tree according to the balanced distance, calculate the depth level of each causal node to obtain a level coefficient, traverse the causal relationship set to construct an adjacency matrix, calculate the node complexity weight based on the adjacency matrix, multiply the level coefficient and the node complexity weight by the node width parameter and the height parameter respectively to calculate the causal node coordinates, multiply the level coefficient and the sequence number weight of the constraint node by the node layout parameter respectively to calculate the constraint node coordinates, and construct a spatial distribution model based on the causal node coordinates and the constraint node coordinates; Step S103: Input the spatial distribution model into a node overlap detector, which calculates a distance matrix between adjacent nodes, triggers a position offset for node pairs that are less than a minimum spacing threshold, and inputs the offset node coordinates into a path planner, which calculates an optimal connection path based on the causal relationship set to avoid overlapping connection lines, and generates a software test case causal graph with an adaptive layout, and outputs the software test case causal graph for display.

[0213] From the above description, it can be seen that the computer program product provided by the embodiment of the present application realizes the normalized processing of data through the allocation of node identifiers by innovatively constructing a causal graph structure data extraction mechanism. A force-directed graph layout optimizer is designed, combining the gravitational repulsion coefficient and the hierarchical layout tree, and the accurate calculation of node coordinates is realized through node complexity weights and hierarchical coefficients. A node overlap detector and a path planner are introduced to realize the adaptive offset of node positions and the optimized planning of connection paths. This method effectively solves the deficiencies of traditional technologies in node layout, spatial distribution and path planning, and significantly improves the visualization and practicality of the causal graph of software test cases.

[0214] It should be understood by those skilled in the art that embodiments of the present invention may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0215] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (apparatus), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0216] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0217] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0218] The present invention uses specific embodiments to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A test case causal graph data processing method, characterized in that: The method comprises: Receive a data file and extract causal graph structure data, extract a constraint node set, a causal node set and a causal relationship set in the data file, the causal node set includes a cause node and an effect node, the effect node is configured with positive and negative rule attributes, the constraint node is configured with positive and negative constraint attributes, a unique identifier is assigned to each node in the constraint node set and the causal node set, and a node relationship training data set is constructed; Constructing a layout optimization model and calculating node layout coordinates, training a force-directed graph layout optimizer based on the node relationship training data set, applying an attraction coefficient and a repulsion coefficient to the causal node set, obtaining a balanced distance between nodes through iterative calculation, constructing a hierarchical layout tree according to the balanced distance, calculating the depth level of each causal node to obtain a level coefficient, traversing the causal relationship set to construct an adjacency matrix, calculating a node complexity weight based on the adjacency matrix, multiplying the level coefficient and the node complexity weight by a node width parameter and a height parameter to obtain causal node coordinates, multiplying the level coefficient and the sequence number weight of the constraint node by a node layout parameter to obtain constraint node coordinates, and constructing a spatial distribution model based on the causal node coordinates and the constraint node coordinates; The spatial distribution model is input into a node overlap detector, which calculates a distance matrix between adjacent nodes, triggers a position shift for node pairs that are less than a minimum spacing threshold, and inputs the shifted node coordinates into a path planner, which calculates an optimal connection path based on the causal relationship set to avoid overlapping connection lines, and generates a software test case causal graph with an adaptive layout, and outputs the software test case causal graph for display.

2. The test case causal graph data processing method according to claim 1 is characterized in that: The receiving of data files and extracting causal graph structure data, extracting constraint node sets, causal node sets and causal relationship sets in the data files, wherein the causal node sets include cause nodes and effect nodes, the effect nodes are configured with forward and reverse rule attributes, and the constraint nodes are configured with forward and reverse constraint attributes, including: Construct a data parser to read the content of a data file, convert the content of the data file into a character stream, parse the character stream based on a preset data structure template to extract constraint node information, causal node information, and inter-node relationship information, establish a constraint node set and a causal node set according to the node information, establish a causal relationship set according to the inter-node relationship information, and store the constraint node set, causal node set, and causal relationship set in a node data cache; Read the node set information from the node data cache, traverse the causal node set to mark each node as a cause node or a result node, traverse the result node to configure positive and negative rule attribute identifiers for each result node, traverse the constraint node set to configure positive and negative constraint attribute identifiers for each constraint node, generate a globally unique identifier and assign it to each node, and write the configured node information into the node attribute table.

3. The test case causal graph data processing method according to claim 1 is characterized in that: The construction of the layout optimization model and calculation of the node layout coordinates, training the force-directed graph layout optimizer based on the node relationship training data set, the force-directed graph layout optimizer applying the attraction coefficient and the repulsion coefficient to the causal node set, and obtaining the equilibrium distance between nodes through iterative calculation, includes: Extracting node position feature vectors and connection relationship feature vectors from a node relationship training data set, training model parameters of a force-directed graph layout optimizer based on a layout optimization loss function, inputting the model parameters into an attraction calculation unit and a repulsion calculation unit, respectively, wherein the attraction calculation unit calculates an attraction coefficient according to the connection relationship between nodes, and the repulsion calculation unit calculates a repulsion coefficient according to the spatial distance between nodes, and inputting the calculated attraction coefficient and repulsion coefficient into the layout optimizer; The causal node set is input into the layout optimizer, the gravitational action value between the connected nodes is calculated based on the gravitational coefficient, the repulsive action value between all node pairs is calculated based on the repulsive coefficient, the gravitational action value and the repulsive action value are applied to the nodes for iterative calculation, and it is determined whether the change in node position is less than a preset convergence threshold. When the position change is less than the preset convergence threshold, the equilibrium distance between nodes is output.

4. The test case causal graph data processing method according to claim 1 is characterized in that: The step of constructing a hierarchical layout tree according to the balanced distance, calculating the depth level of each causal node to obtain a level coefficient, traversing the causal relationship set to construct an adjacency matrix, and calculating the node complexity weight based on the adjacency matrix includes: A spatial distance matrix is ​​constructed based on the balanced distance, a hierarchical clustering algorithm is used to hierarchically divide the distance matrix to obtain a node hierarchy tree, the node hierarchy tree is traversed to calculate the shortest path length from each causal node to the root node, the shortest path length is normalized to obtain a node depth level value, and a level coefficient is calculated based on the product of the node depth level value and a preset level weight coefficient; The causal relationship set is traversed to obtain the connection relationship between nodes, an N-order square matrix is ​​constructed to represent the node connection status to obtain an adjacency matrix, the adjacency matrix is ​​subjected to power operation to obtain a node reachability matrix, the out-degree value and the in-degree value of each node in the reachability matrix are calculated, and the weighted sum of the out-degree value and the in-degree value is used as the node complexity weight.

5. The test case causal graph data processing method according to claim 1 is characterized in that: The causal node coordinates are calculated by multiplying the level coefficient and the node complexity weight by the node width parameter and the height parameter respectively, the constraint node coordinates are calculated by multiplying the level coefficient and the sequence number weight of the constraint node by the node layout parameter respectively, and the spatial distribution model is constructed based on the causal node coordinates and the constraint node coordinates, including: Read the node width parameter and height parameter from the layout parameter configuration table, multiply the level coefficient by the node width parameter to calculate the horizontal coordinate of the causal node, multiply the node complexity weight by the node height parameter to calculate the vertical coordinate of the causal node, traverse the constraint node set to obtain the sequence number of each constraint node, normalize the constraint node sequence number to obtain the sequence number weight, and multiply the level coefficient and sequence number weight of the constraint node by the node layout parameter to calculate the horizontal and vertical coordinates of the constraint node; The causal node coordinates and the constraint node coordinates are input into the spatial distribution model builder, the spatial distribution density matrix is ​​calculated based on the node coordinates, a node distribution probability model is constructed using a non-parametric kernel density estimation method, and the node distribution probability model is integrated with the coordinate mapping relationship to obtain a spatial distribution model.

6. The test case causal graph data processing method according to claim 1 is characterized in that: The step of inputting the spatial distribution model into a node overlap detector, wherein the node overlap detector calculates a distance matrix between adjacent nodes and triggers a position shift for a node pair whose distance is less than a minimum distance threshold, comprises: Input the node coordinate information in the spatial distribution model into the node overlap detector, construct a KD tree spatial index structure based on the node coordinates, use the KD tree to calculate the nearest neighbor node set of each node, calculate the Euclidean distance of the node pairs in the nearest neighbor node set to obtain a distance matrix, and compare the distance matrix with a preset minimum spacing threshold to generate an overlap detection result; Node pairs whose distance is less than a minimum spacing threshold are selected from the overlap detection results, the overlap vector between the node pairs is calculated, the position offset is calculated based on the direction of the overlap vector, the position offset is applied to the overlapped nodes to adjust the coordinates, and the adjusted node coordinates are updated to the spatial distribution model.

7. The test case causal graph data processing method according to claim 1 is characterized in that: The offset node coordinates are input into a path planner, the path planner calculates an optimal connection path based on the causal relationship set to avoid overlapping connection lines, and generates a software test case causal graph with an adaptive layout, and outputs and displays the software test case causal graph, including: The offset node coordinates and causal relationship set are input into the path planner, a gridded path cost map is constructed based on the node coordinates, the A-star search algorithm is called for each connection relationship to calculate the candidate path set from the start node to the target node, the candidate path is smoothed using the Bezier curve to obtain the connection line path, the number of intersections between the connection line paths is calculated as the path cost, and the connection line path with the smallest path cost is selected as the optimal connection path; Traverse the causal relationship set to obtain the connection relationship between nodes, draw connection lines according to the connection relationship and the optimal connection path, write the node coordinate information and the connection line path information into the graphics drawing buffer, call the graphics rendering engine to convert the buffer data into a software test case causal graph, and output the software test case causal graph to a display device.

8. A test case causal graph data processing device, characterized in that: The device comprises: A data preprocessing module is used to receive a data file and extract causal graph structure data, extract a constraint node set, a causal node set and a causal relationship set in the data file, wherein the causal node set includes a cause node and an effect node, the effect node is configured with forward and reverse rule attributes, and the constraint node is configured with forward and reverse constraint attributes, and a unique identifier is assigned to each node in the constraint node set and the causal node set to construct a node relationship training data set; A model construction module, for constructing a layout optimization model and calculating node layout coordinates, training a force-directed graph layout optimizer based on the node relationship training data set, the force-directed graph layout optimizer applies an attraction coefficient and a repulsion coefficient to the causal node set, obtains a balanced distance between nodes through iterative calculation, constructs a hierarchical layout tree according to the balanced distance, calculates the depth level of each causal node to obtain a level coefficient, traverses the causal relationship set to construct an adjacency matrix, calculates node complexity weights based on the adjacency matrix, multiplies the level coefficient and the node complexity weight by a node width parameter and a height parameter respectively to obtain causal node coordinates, multiplies the level coefficient and the sequence number weight of the constraint node by a node layout parameter respectively to obtain constraint node coordinates, and constructs a spatial distribution model based on the causal node coordinates and the constraint node coordinates; A causal graph determination module is used to input the spatial distribution model into a node overlap detector, the node overlap detector calculates a distance matrix between adjacent nodes, triggers a position shift for node pairs that are less than a minimum spacing threshold, and inputs the shifted node coordinates into a path planner, the path planner calculates an optimal connection path based on the causal relationship set to avoid overlapping connection lines, and generates a software test case causal graph with an adaptive layout, and outputs the software test case causal graph for display.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the test case causal graph data processing method described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the test case causal graph data processing method described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Vulnerability utilization chain construction technology based on attack and defense combination

    CN116405246A

  • Visual perception algorithm-oriented dangerous test case generation method and related equipment

    CN116665174A

  • Business data analysis method and device based on big data, equipment and storage medium

    CN119669309A

  • Software testing system that employs a graphical interface to generate test cases configured as hybrid tree structures

    US5414836A

  • Danger test case generation method for visual perception algorithm, and related device

    WO2024255158A1