Test Case Causal Diagram Data Processing Method and Device

By building a force-oriented graph layout optimizer and introducing a node overlap detector, the node location and connection path are optimized, and the node layout and path planning problems in the data processing of causal graphs in test cases are solved, improving the visualization effect and practicality of the causal graph.

CN120029926BActive Publication Date: 2025-08-01KAIYUN LIANCHUANG (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The existing test cases causal graph data processing methods have shortcomings in node layout, spatial distribution and path planning. They lack systematic layout optimization, and it is difficult to realize the reasonable distribution between nodes and visual display of complex relationships. There is also a lack of effective node overlap detection and connection line overlap avoidance mechanisms, which affects the readability and practicality of the causal graph.

Method used

By building a force-oriented graph layout optimizer, combining gravitational repulsion coefficients and hierarchical layout trees, node coordinates are calculated and adaptive layout is constructed, node overlap detectors and path planners are introduced, node locations and connection paths are optimized, and node normalization processing and adaptive offsets are realized.

Benefits of technology

It significantly improves the visualization effect and practicality of the causal graph of software test cases, ensures the balance and readability of node layout, avoids overlapping of connection lines, and improves the comprehensibility and management efficiency of test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120029926B_ABST
    Figure CN120029926B_ABST
Patent Text Reader

Abstract

The embodiments of this application provide a method and device for processing test case cause-and-effect diagram data. By innovatively constructing a cause-and-effect diagram structure data extraction mechanism, data normalization processing is achieved through node identifier allocation. A force-directed graph layout optimizer is designed, which combines the gravitational and repulsive force coefficients and a hierarchical layout tree to accurately calculate node coordinates through node complexity weights and hierarchical coefficients. A node overlap detector and a path planner are introduced to achieve adaptive offset of node positions and optimized planning of connection paths. This method effectively solves the deficiencies of traditional technologies in aspects such as node layout, spatial distribution, and path planning, and significantly improves the visualization effect and practicality of software test case cause-and-effect diagrams.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing, and in particular to a method and device for processing test case causal diagram data. Background Art

[0002] The existing methods for processing test case causal diagram data have obvious deficiencies. Traditional systems lack systematic layout optimization for causal nodes and constraint nodes, making it difficult to achieve reasonable distribution among nodes, and there are limitations in the visual display of complex relationships.

[0003] In addition, there are bottlenecks in the node layout of the existing technology. Most systems fail to effectively use the force-directed graph algorithm for dynamic layout, lacking comprehensive consideration of node levels and complexity, resulting in an unintuitive graphical layout result.

[0004] There are technical shortcomings in the path planning of existing systems. The lack of effective node overlap detection and connection line intersection avoidance mechanisms affects the readability and practicality of causal diagrams. Solving these problems is of great significance for improving the display effect of software test case causal diagrams. Summary of the Invention

[0005] In view of the problems in the existing technology, this application provides a method and device for processing test case causal diagram data, which can effectively solve the deficiencies of traditional technologies in aspects such as node layout, spatial distribution, and path planning, and significantly improve the visualization effect and practicality of software test case causal diagrams.

[0006] To solve at least one of the above problems, this application provides the following technical solutions:

[0007] In a first aspect, this application provides a method for processing test case causal diagram data, including:

[0008] Receiving a data file and extracting causal diagram structure data, extracting a set of constraint nodes, a set of causal nodes, and a set of causal relationships from the data file, where the set of causal nodes includes cause nodes and effect nodes, the effect nodes are configured with positive and negative rule attributes, the constraint nodes are configured with positive and negative constraint attributes, assigning a unique identifier to each node in the set of constraint nodes and the set of causal nodes, and constructing a node relationship training data set;

[0009] Build a layout optimization model and calculate the node layout coordinates. Train a force-directed graph layout optimizer based on the node relationship training dataset. The force-directed graph layout optimizer applies gravitational and repulsive coefficients to the causal node set, obtains the equilibrium distance between nodes through iterative calculation, constructs a hierarchical layout tree based on the equilibrium 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 height parameter respectively to calculate the causal node coordinates, multiplies the level coefficient and the sequence number weight of the constraint node by the node layout parameter to calculate the constraint node coordinates, and constructs a spatial distribution model based on the causal node coordinates and the constraint node coordinates;

[0010] Input the spatial distribution model into a node overlap detector. The node overlap detector calculates the distance matrix between adjacent nodes, triggers position offsets for node pairs with distances less than the 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 connection line overlaps, and generates a causal graph of software test cases with an adaptive layout, and outputs and displays the causal graph of software test cases.

[0011] Further, it also includes: building 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 node relationship information, respectively establishing a constraint node set, a causal node set according to the node information, establishing a causal relationship set according to the node relationship information, and storing the constraint node set, the causal node set, and the causal relationship set in a node data cache;

[0012] 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 nodes 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 a node attribute table.

[0013] Further, it also includes: extracting node position feature vectors and connection relationship feature vectors from the node relationship training dataset, training the model parameters of the force-directed graph layout optimizer based on a layout optimization loss function, inputting the model parameters into a gravitational calculation unit and a repulsive calculation unit respectively. The gravitational calculation unit calculates the gravitational coefficient according to the connection relationship between nodes, the repulsive calculation unit calculates the repulsive coefficient according to the spatial distance between nodes, and inputs the calculated gravitational coefficient and repulsive coefficient into the layout optimizer;

[0014] Input the set of causal nodes into the layout optimizer, calculate the gravitational force values between the connected nodes based on the gravitational coefficient, calculate the repulsive force values between all node pairs based on the repulsive coefficient, perform iterative calculations on the nodes by applying the gravitational force values and the repulsive force values, and determine whether the change in node position is less than a preset convergence threshold. When the change in position is less than the preset convergence threshold, output the equilibrium distance between the nodes.

[0015] Further, it also includes: constructing a spatial distance matrix based on the equilibrium distance, using the hierarchical clustering algorithm to perform hierarchical partitioning on 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 the node depth level value, and calculating the level coefficient based on the product of the node depth level value and a preset level weight coefficient;

[0016] Traverse the set of causal relationships to obtain the connection relationships between nodes, construct an N - order square matrix to represent the node connection status to obtain an adjacency matrix, perform 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 in - degree value as the node complexity weight.

[0017] Further, it also includes: 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 abscissa of the causal node, multiply the node complexity weight by the node height parameter to calculate the ordinate of the causal node, traverse the set of constraint nodes to obtain the serial number of each constraint node, normalize the serial number of the constraint node to obtain the serial number weight, and multiply the level coefficient and serial number weight of the constraint node by the node layout parameter respectively to calculate the abscissa and ordinate of the constraint node;

[0018] Input the causal node coordinates and 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 construct a node distribution probability model, and integrate the node distribution probability model with the coordinate mapping relationship to obtain a spatial distribution model.

[0019] Further, it also includes: 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 for 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;

[0020] Filter out node pairs with a distance 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 for coordinate adjustment, and update the adjusted node coordinates to the spatial distribution model.

[0021] Further, it also includes: inputting the offset node coordinates and the causal relationship set into the path planner, constructing a grid path cost map based on the node coordinates, calling the A* search algorithm for each connection relationship to calculate the candidate path set from the start node to the target node, using a Bezier curve to smooth the candidate paths to obtain the connection path, calculating the number of intersection points between the connection paths as the path cost, and selecting the connection path with the minimum path cost as the optimal connection path;

[0022] Traverse the causal relationship set to obtain the connection relationships between nodes, draw connection lines according to the connection relationships and the optimal connection path, write the node coordinate information and the connection path information into the graphic rendering buffer, call the graphic rendering engine to convert the buffer data into a causal graph of software test cases, and output the causal graph of the software test cases to the display device.

[0023] In a second aspect, the present application provides a device for processing causal graph data of test cases, including:

[0024] A data preprocessing module, configured to receive a data file and extract causal graph structure data, extract a set of constraint nodes, a set of causal nodes, and a set of causal relationships from the data file, where the set of causal nodes includes cause nodes and effect nodes, the effect nodes are configured with forward and reverse rule attributes, the constraint nodes are configured with forward and reverse constraint attributes, assign a unique identifier to each node in the set of constraint nodes and the set of causal nodes, and construct a node relationship training data set;

[0025] A model construction module, configured 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, the force-directed graph layout optimizer applies a gravitational coefficient and a repulsive coefficient to the set of causal nodes, obtains the 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 set of causal relationships 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 calculate the causal node coordinates, multiplies the level coefficient and the sequence number weight of the constraint node by the node layout parameter to calculate the constraint node coordinates, and constructs a spatial distribution model based on the causal node coordinates and the constraint node coordinates;

[0026] A cause-and-effect diagram 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 offset for node pairs with a distance less than the minimum spacing threshold, and inputs the offset node coordinates into a path planner. The path planner calculates an optimal connection path based on the set of causal relationships to avoid overlapping connection lines, and generates a cause-and-effect diagram of software test cases with an adaptive layout, and outputs and displays the cause-and-effect diagram of software test cases.

[0027] In a third aspect, the present application provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor. When the processor executes the program, the steps of the test case cause-and-effect diagram data processing method described above are implemented.

[0028] In a fourth aspect, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the test case cause-and-effect diagram data processing method described above are implemented.

[0029] In a fifth aspect, the present application provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, the steps of the test case cause-and-effect diagram data processing method described above are implemented.

[0030] As can be seen from the above technical solutions, the present application provides a test case cause-and-effect diagram data processing method and apparatus. By innovatively constructing a cause-and-effect diagram structure data extraction mechanism, data normalization processing is achieved through node identifier allocation. A force-directed graph layout optimizer is designed, combined with a gravitational and repulsive force coefficient and a hierarchical layout tree, and precise calculation of node coordinates is achieved through node complexity weights and hierarchical coefficients. A node overlap detector and a path planner are introduced to achieve adaptive offset of node positions and optimal planning of connection paths. This method effectively solves the deficiencies of traditional technologies in aspects such as node layout, spatial distribution, and path planning, and significantly improves the visualization effect and practicality of the cause-and-effect diagram of software test cases. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the following drawings are some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0032] Figure 1 is a schematic flowchart of the test case cause-and-effect diagram data processing method in the embodiments of the present application;

[0033] Figure 2This is a structural diagram of a test case causal graph data processing device in an embodiment of the present application;

[0034] Figure 3 Schematic diagram of the structure of the electronic device in the embodiment of the present application.

[0035] Reference numerals:

[0036] 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

[0037] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0038] The acquisition, storage, use, and processing of data in this application's technical solution comply with relevant national laws and regulations.

[0039] 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 normalized data processing through node identifier allocation. A force-directed graph layout optimizer is designed, combining the gravitational repulsion coefficient and the hierarchical layout tree, and accurately calculates the node coordinates through the node complexity weight and the hierarchy coefficient. A node overlap detector and a path planner are introduced to realize adaptive offset of node positions and 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.

[0040] In order to effectively solve the shortcomings of traditional technologies in terms of node layout, spatial distribution and path planning, and significantly improve the visualization and practicality of software test case causal graphs, this 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:

[0041] Step S101: Receive a data file and extract causal graph structure data. Extract the set of constraint nodes, the set of causal nodes, and the set of causal relationships in the data file. The set of causal nodes includes 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. Assign a unique identifier to each node in the set of constraint nodes and the set of causal nodes, and construct a node relationship training data set.

[0042] Optionally, this embodiment focuses on the data processing requirements of software test case causal graphs and innovatively designs a structured data extraction and preprocessing method. In large-scale software testing scenarios, the causal relationships and constraint conditions among test cases are intricate, and precise parsing and structured processing of the original data file are required. This embodiment first constructs a dedicated data parser, which can accurately identify and extract various node information and relationship information in the data file.

[0043] This embodiment designs a three-layer data structure template for parsing constraint node information, causal node information, and inter-node relationship information respectively. The data parsing process adopts a streaming processing mechanism. After converting the content of the data file into a character stream, it is parsed through preset syntax 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 integrity of data extraction.

[0044] This embodiment innovatively designs a two-way attribute configuration mechanism. For effect nodes, forward and reverse rule attributes are configured to describe the expected state and abnormal state of test results. The forward rule attribute represents the expected output of a test case under normal conditions, and the reverse rule attribute describes the output result in abnormal situations. This two-way attribute design makes test cases more complete and can effectively cover various test scenarios.

[0045] This embodiment optimizes the attribute configuration scheme of constraint nodes. The forward constraint attribute of constraint nodes is used to describe the necessary conditions for test execution, and the reverse constraint attribute defines the limiting conditions of the test. For example, in Web application testing, a certain functional test case may require the user to have specific permissions (forward constraint) and at the same time require the system load not to exceed a specific threshold (reverse constraint). This constraint attribute design ensures the executability of test cases.

[0046] This embodiment implements an efficient unique identifier allocation mechanism. By adopting a distributed ID generation algorithm, it ensures the uniqueness of identifiers for each node in large-scale test scenarios. The generation of identifiers 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 incrementing sequence number. This identifier format facilitates the rapid retrieval and correlation analysis of nodes.

[0047] This embodiment optimizes the construction process of the node relationship training data set. Based on the extracted node information and relationship information, training samples containing node attribute features and relationship features are constructed. For each pair of nodes, their attribute feature vectors and relationship feature vectors 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.

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

[0049] This embodiment realizes the 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 the version management and reuse of test cases.

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

[0051] This embodiment lays a foundation for the subsequent optimization of the test process. By establishing a complete node relationship training data set, it provides the necessary data support for automated testing and intelligent testing. These structured test data not only support the current construction of causal diagrams but can also be used for the optimization of test strategies and the improvement of test coverage.

[0052] Step S102: Build a layout optimization model and calculate the node layout coordinates. Train a force-directed graph layout optimizer based on the node relationship training dataset. The force-directed graph layout optimizer applies an attraction coefficient and a repulsion coefficient to the causal node set, obtains the balanced distance between nodes through iterative calculation, constructs a hierarchical layout tree based on 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 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 calculate the causal node coordinates, multiplies 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 constructs a spatial distribution model based on the causal node coordinates and the constraint node coordinates.

[0053] Optionally, for the layout optimization problem of the software test case causal graph, this embodiment innovatively designs a force-directed adaptive layout algorithm. 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 dataset, and this optimizer adjusts the node positions by simulating the gravitational and repulsive forces in the physical system.

[0054] This embodiment designs a double-coefficient force-directed model. The calculation formulas for the attraction coefficient F_attract and the repulsion coefficient F_repel are:

[0055]

[0056] 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 the connected nodes tend to approach each other while the non-connected nodes move away from each other, thus forming a clear visual hierarchy.

[0057] This embodiment optimizes the training process of the layout optimizer. Extract the node position features and connection relationship features from the node relationship training dataset, and construct a layout optimization loss function:

[0058]

[0059] where L_distance represents the node distance loss, L_overlap represents the node overlap loss, L_aesthetic represents the aesthetics loss, and α, β, and γ are weight coefficients. Optimize the model parameters through the gradient descent method to balance the layout results between readability and aesthetics.

[0060] This embodiment innovatively implements a hierarchical layout tree construction mechanism. 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:

[0061]

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

[0063] 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:

[0064]

[0065] Where 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.

[0066] This embodiment demonstrates significant advantages in software testing scenarios. Taking interface testing within a microservices architecture as an example, when complex service call relationships exist, this solution can clearly demonstrate the dependencies between interfaces and the test flow. Through rational layout optimization, closely related test cases are visually closer, making it easier for testers to understand and manage test logic.

[0067] This embodiment implements adaptive coordinate calculation. For causal nodes, the horizontal coordinate is obtained by multiplying the hierarchy coefficient with the node width parameter, and the vertical coordinate is obtained by multiplying the complexity weight with the height parameter. For constraint nodes, the position is determined by multiplying the normalized sequence weight with the layout parameter, taking into account the node's sequence number in the test flow. This calculation method ensures a balanced and readable node layout.

[0068] This embodiment innovatively constructs a spatial distribution model. Based on the calculated node coordinates, a kernel density estimation method is used to construct a node distribution probability model:

[0069]

[0070] Where K is the kernel function, h is the bandwidth parameter, and (xi,yi) are the node coordinates. This probabilistic model helps with subsequent node overlap detection and layout optimization.

[0071] 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 causal graph. By dynamically adjusting the parameters of the force-directed model, the system can adapt to test scenarios of different scales and complexities.

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

[0073] 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 systematic layout optimization scheme is formed. This framework is not only applicable to the current test case management, but also can be extended to other scenarios that require the visualization of relationship graphs.

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

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

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

[0077]

[0078] 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.

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

[0080]

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

[0082] This embodiment innovatively implements a path planning algorithm. By using an improved A search method, the node coordinate space is discretized into a grid cost map. The design of the cost function takes into account multiple factors:

[0083]

[0084] 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.

[0085] This embodiment optimizes the generation process of the connection path. For each causal relationship, multiple candidate paths are generated and smoothed using Bezier curves:

[0086]

[0087] 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, the natural transition and aesthetic presentation of the connection lines are achieved.

[0088] This embodiment demonstrates significant advantages in the software integration testing scenario. Taking the end-to-end testing of the microservice 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.

[0089] 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 encoding (such as color, size, shape, etc.).

[0090] 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 graph.

[0091] This embodiment exhibits 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 a high execution efficiency. Through optimization techniques such as spatial indexing and heuristic search, the real-time response ability of layout adjustment is ensured.

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

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

[0094] This embodiment provides a basis for subsequent test optimization. Through intuitive visual display, the test team can better understand and optimize test strategies, improving test efficiency and quality. At the same time, this visualization ability also provides an important reference for the generation of automated test cases.

[0095] As can be seen from the above description, the test case causal graph data processing method provided by the embodiments of the present application can, by innovatively constructing a causal graph structure data extraction mechanism, achieve the standardized processing of data through node identifier allocation. Design a force-directed graph layout optimizer, combine the gravitational and repulsive force coefficients and the hierarchical layout tree, and accurately calculate the node coordinates through the node complexity weight and the hierarchical coefficient. Introduce a node overlap detector and a path planner to achieve the adaptive offset of node positions and the optimized planning of connection paths. This method effectively solves the deficiencies of traditional technologies in aspects such as node layout, spatial distribution, and path planning, and significantly improves the visualization effect and practicality of software test case causal graphs.

[0096] In an embodiment of the test case causal graph data processing method of the present application, the following content may also be specifically included:

[0097] Step S201: Construct a data parser to read the content of the 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 node relationship information, establish a constraint node set, a causal node set respectively according to the node information, establish a causal relationship set according to the node relationship information, and store the constraint node set, the causal node set, and the causal relationship set into the node data cache;

[0098] 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 nodes 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.

[0099] Optionally, for the data preprocessing requirements of the cause-and-effect diagram of software test cases, this embodiment innovatively designs an efficient data parsing and node marking scheme. This embodiment first constructs a dedicated data parser, adopts a multi-level streaming processing architecture, and ensures the efficient parsing and accurate extraction of large-scale test data.

[0100] This embodiment designs a hierarchical data structure template. The template definition adopts the JSON Schema format and includes three main parts: the constraint node template (defining test preconditions and limiting conditions), the causal node template (describing test inputs and expected outputs), and the relationship template (describing the dependency relationships between nodes). During the data parsing process, the parser first converts the data file into a character stream and then performs structured parsing according to the preset template:

[0101]

[0102] where 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.

[0103] This embodiment optimizes the data caching mechanism. Adopting a hierarchical caching strategy, the parsed node sets are stored in different cache levels:

[0104]

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

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

[0107] This embodiment optimizes the rule attribute configuration scheme. For effect nodes, positive and negative rule attributes are configured:

[0108]

[0109] Among them, expected_output defines the expected results of normal execution, and error_output defines the output status in abnormal situations. This two-way rule configuration ensures the completeness of test cases.

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

[0111] This embodiment implements an efficient identifier generation mechanism. Using a distributed ID generation algorithm, combined with node type, timestamp, and random factor to generate a globally unique identifier:

[0112]

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

[0114] This embodiment innovatively designs the storage structure of the attribute table. The node attribute table adopts a columnar storage scheme, storing information such as node ID, type, and attributes in separate columns, supporting efficient attribute query and update operations. At the same time, an incremental update mechanism for the attribute table is implemented to ensure data timeliness.

[0115] This embodiment shows good scalability in practical applications. When the test scenario expands or the test requirements change, 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.

[0116] 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.

[0117] This embodiment establishes a complete data preprocessing framework. From data parsing to node marking, and then to attribute configuration, a systematic data processing solution is formed. This framework not only supports the current cause-and-effect diagram construction but also can be extended to other test data processing scenarios.

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

[0119] In an embodiment of the method for processing causal graph data of test cases in this application, it may specifically include the following content:

[0120] Step S301: Extract the node position feature vector and the connection relationship feature vector from the node relationship training dataset, train the model parameters of the force-directed graph layout optimizer based on the layout optimization loss function, input the model parameters into the gravitational calculation unit and the repulsive force calculation unit respectively. The gravitational calculation unit calculates the gravitational coefficient according to the connection relationship between nodes, and the repulsive force calculation unit calculates the repulsive force coefficient according to the spatial distance between nodes, and inputs the calculated gravitational coefficient and repulsive force coefficient into the layout optimizer;

[0121] Step S302: Input the causal node set into the layout optimizer, calculate the gravitational action value between connected nodes based on the gravitational coefficient, calculate the repulsive force action value between all node pairs based on the repulsive force coefficient, perform iterative calculation on the nodes by applying the gravitational action value and the repulsive force action value, and determine whether the node position change amount is less than the preset convergence threshold. When the position change amount is less than the preset convergence threshold, output the equilibrium distance between nodes.

[0122] Optionally, for the layout optimization problem of the software test case causal graph in this embodiment, an innovative force-directed graph layout scheme based on deep learning is designed. By analyzing the node relationship training dataset, feature vectors containing position information and connection relationships are extracted, and these feature vectors contain the topological structure and spatial distribution characteristics between test case nodes.

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

[0124]

[0125] where (x, y) are the coordinates, type is the node type, weight is the node weight, and level is the hierarchical information. The connection relationship feature vector R describes the dependency relationship between nodes:

[0126]

[0127] where source and target are the start and end nodes of the connection, strength is the connection strength, and direction is the dependency direction.

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

[0129]

[0130] Among them, L_distance represents the node - to - node distance loss, L_density represents the node density loss, L_direction represents the direction consistency loss, and L_aesthetic represents the aesthetic loss. are weight coefficients. This multi - objective loss function ensures the overall optimization of the layout result.

[0131] This embodiment innovatively implements a gravitational calculation mechanism. The gravitational calculation unit calculates the gravitational coefficient based on the connection relationship features:

[0132]

[0133] Among them, k1 is the gravitational constant, strength is the connection strength, and distance is the node - to - node distance. This gravitational model ensures the aggregation effect of related nodes, making logically related test cases closer visually.

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

[0135]

[0136] Among them, k2 is the repulsive force constant, d0 is the characteristic distance, and type_diff is the node type difference. This repulsive force model prevents nodes from over - aggregating and maintains the clarity of the layout.

[0137] This embodiment shows significant advantages in the microservice testing scenario. Taking the service call chain test as an example, when there are complex service dependency relationships, the force - directed layout can automatically arrange the test nodes of related services in appropriate positions, making the test process more intuitive. Through the gravitational effect, the test nodes of services with close call relationships naturally aggregate; through the repulsive force effect, the nodes of different test scenarios maintain an appropriate distance.

[0138] This embodiment implements an adaptive iterative optimization mechanism. In each iteration, calculate the force on the nodes and update their positions:

[0139]

[0140] Among them, η is the learning rate, which is dynamically adjusted to ensure convergence. At the same time, calculate the position change amount:

[0141]

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

[0143] In this embodiment, a convergence judgment strategy is innovatively designed. It not only considers the position changes of individual nodes but also evaluates the stability of the overall layout:

[0144]

[0145] When Stability is lower than the threshold, the final equilibrium distance matrix between nodes is output. This strategy ensures the global convergence of layout optimization.

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

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

[0148] 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 also can be extended to other complex relationship graph visualization scenarios.

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

[0150] In an embodiment of the test case causal graph data processing method of the present application, the following content may also be specifically included:

[0151] Step S401: Based on the equilibrium distance, construct a spatial distance matrix, use the hierarchical clustering algorithm to hierarchically partition the distance matrix to obtain a node hierarchy tree, traverse the node hierarchy tree to calculate the shortest path length from each causal node to the root node, normalize the shortest path length to obtain a node depth level value, and calculate a level coefficient based on the product of the node depth level value and a preset level weight coefficient;

[0152] Step S402: Traverse the causal relationship set to obtain the connection relationships between nodes, construct an N-order square matrix to represent the node connection status to obtain an adjacency matrix, perform 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 in-degree value as the node complexity weight.

[0153] Optionally, for the hierarchical structure optimization problem of software test case causal diagrams, this embodiment innovatively designs a set of hierarchical analysis schemes based on spatial distance and connection relationships. 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:

[0154] 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 among test nodes.

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

[0156]

[0157] where is the mean of the distances, is the standard deviation, is an adjustable parameter. By setting the dynamic threshold, the rationality of the hierarchical division is ensured, and the problems of over-stratification or overly sparse levels are avoided.

[0158] This embodiment innovatively implements the construction mechanism of the node hierarchy tree. Based on the clustering results, a hierarchical tree structure is constructed, and each node records the information of its parent node and child nodes:

[0159]

[0160] where id is the node identifier, parent is the reference to the parent node, children is the list of child nodes, and level is the hierarchical information. This tree structure clearly expresses the hierarchical relationship among test cases.

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

[0162]

[0163] where Edge_weight is the weight of each edge on the path. Through normalization, the path length is mapped to the interval [0, 1]:

[0164]

[0165] In this embodiment, the calculation method of the hierarchical coefficient is optimized. Multiply the node depth level value by the preset hierarchical weight coefficient:

[0166]

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

[0168] This embodiment shows significant advantages in the microservice test scenario. Taking the test of the order processing process in an 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 shown, helping testers better understand and manage the test process.

[0169] This embodiment implements an efficient method for constructing an adjacency matrix. By traversing the set of causal relationships, an N-order adjacency matrix A is constructed:

[0170]

[0171] This representation method intuitively reflects the direct dependency relationship between test nodes.

[0172] This embodiment innovatively designs a reachability analysis method. Perform a power operation on the adjacency matrix to obtain the reachability matrix :

[0173]

[0174] where n is the total number of nodes. Through matrix power operation, the indirect dependency relationship between test nodes is discovered, which helps to understand the transmission impact of test cases.

[0175] This embodiment optimizes the calculation of the node complexity weight. Calculate the out-degree and in-degree of each node based on the reachability matrix:

[0176]

[0177] where OutDegree represents the number of nodes that affect other nodes, and InDegree represents the number of nodes affected by other nodes, is the weight coefficient. This complexity metric reflects the importance of nodes in the test network.

[0178] 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 evaluation, the maintainability of test cases is significantly improved.

[0179] 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 scheme is formed. This framework not only supports the current cause-and-effect diagram analysis but can also be extended to other test analysis scenarios.

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

[0181] In an embodiment of the test case cause-and-effect diagram data processing method of this application, the following content may also be specifically included:

[0182] Step S501: Read the node width parameter and height parameter from the layout parameter configuration table, multiply the hierarchical coefficient by the node width parameter to calculate the abscissa of the causal node, multiply the node complexity weight by the node height parameter to calculate the ordinate of the causal node, traverse the set of constraint nodes to obtain the serial number of each constraint node, normalize the serial number of the constraint node to obtain the serial number weight, and multiply the hierarchical coefficient and serial number weight of the constraint node by the node layout parameter to calculate the horizontal and vertical coordinates of the constraint node;

[0183] Step S502: Input the causal node coordinates and 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 construct the node distribution probability model, and integrate the node distribution probability model with the coordinate mapping relationship to obtain the spatial distribution model.

[0184] Optionally, for the problem of spatial layout optimization of software test case cause-and-effect diagrams, this embodiment innovatively designs a set of adaptive coordinate calculation and distribution modeling schemes. This embodiment first defines a flexible layout parameter configuration mechanism, including the node width parameter (Width_param) and height parameter (Height_param), which are dynamically adjusted through the configuration table to ensure the configurability and adaptability of the layout.

[0185] This embodiment optimizes the calculation method of causal node coordinates. The abscissa calculation uses the hierarchical weighting formula:

[0186]

[0187] Among them, Level_coef is the hierarchical coefficient, Width_param is the width parameter, and Scale_x is the horizontal scaling factor. The ordinate calculation combines the node complexity:

[0188]

[0189] Among them, Complexity_weight is the complexity weight, Height_param is the height parameter, and Scale_y is the vertical scaling factor.

[0190] This embodiment innovatively realizes the normalization processing of the serial numbers of constraint nodes. Perform min-max normalization on the serial numbers of constraint nodes:

[0191]

[0192] Among them, Sequence is the original serial number, and Min_seq and Max_seq are the minimum and maximum values of the serial numbers respectively. This normalization processing ensures the uniform distribution of constraint nodes.

[0193] This embodiment designs a calculation strategy for the coordinates of constraint nodes. The horizontal and vertical coordinate calculations comprehensively consider the hierarchical coefficient and the serial number weight:

[0194]

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

[0196] This embodiment optimizes the construction of the spatial distribution density matrix. Based on the coordinates of all nodes, a two-dimensional density matrix is constructed:

[0197]

[0198] Among them, K is the kernel function, h is the bandwidth parameter, and (xi, yj) are the coordinates of the grid points. This density representation method intuitively reflects the spatial distribution characteristics of the nodes.

[0199] This embodiment shows significant advantages in the microservice integration test scenario. Taking the test cases 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, the relevant test nodes naturally gather in space, forming clear test logic blocks.

[0200] This embodiment realizes the non-parametric kernel density estimation method. Use the Gaussian kernel function for density estimation:

[0201]

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

[0203] This embodiment innovatively designs a distribution probability model. Convert the kernel density estimation result into a probability distribution:

[0204]

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

[0206] This embodiment optimizes the integration scheme of the spatial distribution model. Combine the node distribution probability model with the coordinate mapping relationship:

[0207]

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

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

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

[0211] This embodiment lays a foundation for subsequent layout optimization. Through an accurate spatial distribution model, the system can better handle problems such as node overlap and connection line intersection, improving the readability and practicality of the test case causal graph. At the same time, this distribution model also provides an important reference for automated layout optimization.

[0212] In an embodiment of the test case causal graph data processing method of this application, the following content may also be specifically included:

[0213] 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 set of nearest neighbor nodes for each node, calculate the Euclidean distance for the node pairs in the set of nearest neighbor nodes to obtain a distance matrix, and compare the distance matrix with a preset minimum spacing threshold to generate an overlap detection result;

[0214] Step S602: Screen out node pairs with a distance 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 for coordinate adjustment, and update the adjusted node coordinates to the spatial distribution model.

[0215] Optionally, for the node overlap problem of the software test case cause-and-effect diagram, this embodiment innovatively designs a set of overlap detection and position adjustment solutions based on the KD-tree. In complex test scenarios, the layout of a large number of test nodes is prone to visual overlap, affecting the readability of the cause-and-effect diagram. This embodiment first constructs an efficient KD-tree spatial index structure to achieve fast neighboring node search.

[0216] This embodiment optimizes the construction strategy of the KD-tree. An adaptive splitting dimension selection method is adopted:

[0217]

[0218] where var(coordinates) calculates the variance of the coordinates of each dimension. The dimension with the largest variance is selected for splitting, ensuring the balance of the tree structure. The node storage structure includes position information and node attributes:

[0219]

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

[0221]

[0222] where node_size is the node size and search_factor is the search factor. Perform regional search on each node:

[0223]

[0224] This search strategy ensures that potential overlapping nodes are not missed.

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

[0226]

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

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

[0229]

[0230] Among them, Min_distance is dynamically adjusted according to the node type and importance:

[0231]

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

[0233] This embodiment realizes the accurate calculation of the overlap vector. For overlapping node pairs, calculate the overlap vector:

[0234]

[0235] Among them, overlap_ratio is the overlap degree coefficient. Calculate the position offset based on the overlap vector:

[0236]

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

[0238] This embodiment innovatively designs a position adjustment strategy. Considering the importance of the nodes and the constraint conditions, calculate the actual offset:

[0239]

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

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

[0242]

[0243] 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 to the spatial distribution model.

[0244] This embodiment shows good performance in practical applications. Through the KD-tree index and efficient overlap detection algorithms, even when dealing with a large number of test cases, it can maintain a low computational overhead. The system can quickly respond to layout changes and adjust the node positions in real time.

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

[0246] This embodiment establishes a complete layout optimization framework. From the construction of the spatial index to the position adjustment, a systematic overlap processing scheme is formed. This framework is not only applicable to the current cause-and-effect diagram layout but also can be extended to other visualization scenarios.

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

[0248] In an embodiment of the test case cause-and-effect diagram data processing method of the present application, the following content may also be specifically included:

[0249] Step S701: Input the offset node coordinates and the cause-and-effect relationship set into the path planner. Based on the node coordinates, construct a grid path cost map. For each connection relationship, call the A* search algorithm to calculate the set of candidate paths from the start node to the target node. Use the Bezier curve to smooth the candidate paths to obtain the connection path. Calculate the number of intersection points between the connection paths as the path cost, and select the connection path with the minimum path cost as the optimal connection path;

[0250] Step S702: Traverse the cause-and-effect relationship set to obtain the connection relationships between nodes. Draw the connection lines according to the connection relationships and the optimal connection path. Write the node coordinate information and the connection path information into the graphics drawing buffer. Call the graphics rendering engine to convert the buffer data into a software test case cause-and-effect diagram, and output the software test case cause-and-effect diagram to the display device.

[0251] Optionally, for the path planning and rendering optimization problems of the software test case cause-and-effect diagram, this embodiment innovatively designs an intelligent path planning scheme based on the cost map. In complex test scenarios, a large number of connection relationships are likely to cause the connection lines to overlap, affecting the readability of the cause-and-effect diagram. This embodiment first constructs an accurate grid path cost map to achieve the intelligent planning of the connection path.

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

[0253]

[0254] Among them, 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 crowded areas.

[0255] This embodiment innovatively improves A Search algorithm. The design of the heuristic function takes into account multiple factors:

[0256]

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

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

[0259]

[0260] Among them, each path Pi is a sequence of a series of grid points. By adjusting the search parameters and cost weights, the diversity and feasibility of the candidate paths are ensured.

[0261] This embodiment optimizes the smoothing process of the Bezier curve. Cubic Bezier curve interpolation is applied to each candidate path:

[0262]

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

[0264] This embodiment shows significant advantages in the microservice test scenario. Taking the service call chain test as an example, when there are complex service dependency relationships, this solution can generate clear connection paths, accurately display the call relationships between services, avoid the mixing of connection lines, and make the test logic clearer.

[0265] This embodiment realizes the accurate evaluation of the path cost. The number of intersection points is calculated for each smoothed path:

[0266]

[0267] Where intersection_count is the number of intersection points with other paths, path_length is the path length, and λ is the length weight. The path with the minimum total cost is selected as the optimal solution.

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

[0269]

[0270] Each layer contains corresponding drawing information and supports independent updates and rendering. This hierarchical design improves the rendering efficiency and maintainability.

[0271] This embodiment optimizes the call mechanism of the rendering engine. Select corresponding rendering strategies according to different types of graphic elements:

[0272]

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

[0274] This embodiment shows good performance in practical applications. Through an efficient path planning algorithm and an optimized rendering mechanism, a smooth interaction experience can be maintained even when dealing with large-scale test cases. The system can respond to layout changes in real time and quickly update the connection paths.

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

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

[0277] This embodiment provides a basis for subsequent test optimization. Through intuitive visual expressions, it helps the test team better understand and optimize test strategies, improving test coverage and efficiency. At the same time, this visualization ability also provides an important reference for automated testing.

[0278] In order to effectively solve the deficiencies of traditional technologies in aspects such as node layout, spatial distribution, and path planning, and significantly improve the visualization effect and practicality of the cause-and-effect diagram of software test cases, this application provides an embodiment of a test case cause-and-effect diagram data processing device for implementing all or part of the content of the test case cause-and-effect diagram data processing method. See Figure 2 , the test case cause-and-effect diagram data processing device specifically includes the following content:

[0279] A data preprocessing module 10 is configured to receive a data file and extract causal graph structure data, extract a set of constraint nodes, a set of causal nodes, and a set of causal relationships from the data file. The set of causal nodes includes 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. A unique identifier is assigned to each node in the set of constraint nodes and the set of causal nodes, and a node relationship training data set is constructed.

[0280] A model construction module 20 is configured to construct a layout optimization model and calculate node layout coordinates. Based on the node relationship training data set, a force-directed graph layout optimizer is trained. The force-directed graph layout optimizer applies gravitational and repulsive coefficients to the set of causal nodes, obtains the equilibrium distance between nodes through iterative calculation, constructs a hierarchical layout tree according to the equilibrium distance, calculates the depth level of each causal node to obtain a level coefficient, traverses the set of causal relationships 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 calculate the causal node coordinates, multiplies the level coefficient and the sequence number weight of the constraint nodes by the node layout parameter respectively to calculate the constraint node coordinates, and constructs a spatial distribution model based on the causal node coordinates and the constraint node coordinates.

[0281] A causal graph determination module 30 is configured to input the spatial distribution model into a node overlap detector. The node overlap detector calculates the distance matrix between adjacent nodes, triggers position offsets for node pairs with a distance less than the minimum spacing threshold, inputs the offset node coordinates into a path planner. The path planner calculates the optimal connection path based on the set of causal relationships to avoid connection line overlaps, and generates a software test case causal graph with an adaptive layout, and outputs and displays the software test case causal graph.

[0282] As can be seen from the above description, the test case causal graph data processing device provided by the embodiments of the present application can, by innovatively constructing a causal graph structure data extraction mechanism, realize the standardized processing of data through node identifier assignment. Design a force-directed graph layout optimizer, combine gravitational and repulsive coefficients and a hierarchical layout tree, and accurately calculate node coordinates through node complexity weights and level coefficients. Introduce a node overlap detector and a path planner to realize the adaptive offset of node positions and the optimal planning of connection paths. This method effectively solves the deficiencies of traditional technologies in aspects such as node layout, spatial distribution, and path planning, and significantly improves the visualization effect and practicality of software test case causal graphs.

[0283] At the hardware level, in order to effectively address the deficiencies of traditional technologies in aspects such as node layout, spatial distribution, and path planning, and significantly enhance the visualization effect and practicality of the cause-and-effect diagram of software test cases, this application provides an embodiment of an electronic device for implementing all or part of the content in the method for processing cause-and-effect diagram data of test cases. The electronic device specifically includes the following:

[0284] A processor, a memory, a communications interface, and a bus; wherein, the processor, the memory, and the communications interface communicate with each other through the bus; the communications interface is used to implement information transmission between the device for processing cause-and-effect diagram data of test cases and related devices such as a core business system, a user terminal, and a related database, etc. This logical controller can be a desktop computer, a tablet computer, a mobile terminal, etc., and this embodiment is not limited thereto. In this embodiment, this logical controller can be implemented with reference to the embodiments of the method for processing cause-and-effect diagram data of test cases in the embodiments, as well as the embodiments of the device for processing cause-and-effect diagram data of test cases, and its content is incorporated herein, and repeated parts will not be elaborated.

[0285] It can be understood 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.

[0286] In practical applications, part of the method for processing cause-and-effect diagram data of test cases can be executed on the electronic device side as described above, or all operations can be completed in the client device. Specifically, it can be selected according to the processing capacity of the client device and the limitations of the user usage scenario, etc. This application does not make any limitations in this regard. If all operations are completed in the client device, the client device may further include a processor.

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

[0288] Figure 3 This is a schematic block diagram of the system composition of the electronic device 9600 according to the embodiment of this application. AsFigure 3 As shown, the electronic device 9600 may include a central processing unit 9100 and a memory 9140; the memory 9140 is coupled to the central processing unit 9100. It should be noted that this 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.

[0289] In one embodiment, the function of the test case causal diagram data processing method may be integrated into the central processing unit 9100. Among them, the central processing unit 9100 may be configured to perform the following controls:

[0290] Step S101: Receive a data file and extract causal diagram structure data, extract a set of constraint nodes, a set of causal nodes, and a set of causal relationships in the data file. The set of causal nodes includes 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. Assign a unique identifier to each node in the set of constraint nodes and the set of causal nodes, and construct a node relationship training data set;

[0291] 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. The force-directed graph layout optimizer applies a gravitational coefficient and a repulsive coefficient to the set of causal nodes, obtains the equilibrium distance between nodes through iterative calculation, constructs a hierarchical layout tree according to the equilibrium distance, calculates the depth level of each causal node to obtain a level coefficient, traverses the set of causal relationships 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 calculate the causal node coordinates, multiplies 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 constructs a spatial distribution model based on the causal node coordinates and the constraint node coordinates;

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

[0293] As can be seen from the above description, the electronic device provided by the embodiments of the present application innovatively constructs a causal graph structure data extraction mechanism, and realizes the normalization processing of data through node identifier allocation. A force-directed graph layout optimizer is designed, which combines the gravitational and repulsive force coefficients and the hierarchical layout tree to accurately calculate the node coordinates through the node complexity weight and the hierarchical coefficient. A node overlap detector and a path planner are introduced to realize the adaptive offset of the node positions and the optimal planning of the connection paths. This method effectively solves the deficiencies of the traditional technology in aspects such as node layout, spatial distribution, and path planning, and significantly improves the visualization effect and practicality of the causal graph of software test cases.

[0294] In another embodiment, the test case causal graph data processing device can be separately configured 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 to implement the functions of the test case causal graph data processing method through the control of the central processing unit.

[0295] As Figure 3 shown, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It should be noted that the electronic device 9600 does not necessarily have to include Figure 3 all the components shown in Figure 3 ; in addition, the electronic device 9600 may further include

[0296] components not shown in Figure 3 ; reference may be made to the prior art.

[0297] Among them, the memory 9140 can be, for example, one or more of a buffer, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices. The above information related to failures can be stored, and in addition, a program for executing relevant information can be stored. And the central processing unit 9100 can execute the program stored in the memory 9140 to implement information storage or processing, etc.

[0298] 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 supply power to the electronic device 9600. The display 9160 is used for displaying display objects such as images and texts. The display can be, for example, an LCD display, but is not limited thereto.

[0299] The memory 9140 can be a solid-state memory, for example, a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It can also be a memory that stores information even when power is off, can be selectively erased and has more data stored. Examples of such a memory are sometimes referred to as EPROMs, etc. The memory 9140 can also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 can include an application / function storage unit 9142, which is used to store application programs and function programs or the processes for operating the electronic device 9600 by the central processing unit 9100.

[0300] The memory 9140 can also include a data storage unit 9143, which is used to store 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 can include various drivers of the electronic device for communication functions and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).

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

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

[0303] Embodiments of the present application also provide a computer-readable storage medium capable of implementing all steps in the test case causal diagram data processing method where the execution subject in the above embodiments is a server or a client. A computer program is stored on the computer-readable storage medium. When the computer program is executed by a processor, all steps in the test case causal diagram data processing method where the execution subject in the above embodiments is a server or a client are implemented. For example, when the processor executes the computer program, the following steps are implemented:

[0304] Step S101: Receive a data file and extract causal diagram structure data. Extract a set of constraint nodes, a set of causal nodes, and a set of causal relationships from the data file. The set of causal nodes includes 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. Assign a unique identifier to each node in the set of constraint nodes and the set of causal nodes, and construct a node relationship training data set;

[0305] 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. The force-directed graph layout optimizer applies a gravitational coefficient and a repulsive coefficient to the set of causal nodes, obtains the equilibrium distance between nodes through iterative calculation, constructs a hierarchical layout tree according to the equilibrium distance, calculates the depth level of each causal node to obtain a level coefficient, traverses the set of causal relationships 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 calculate the causal node coordinates, multiplies the level coefficient and the sequence number weight of the constraint node by the node layout parameter to calculate the constraint node coordinates, and constructs a spatial distribution model based on the causal node coordinates and the constraint node coordinates;

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

[0307] As can be seen from the above description, the computer-readable storage medium provided by the embodiments of the present application innovatively constructs a causal graph structure data extraction mechanism to achieve the normalization processing of data through node identifier allocation. A force-directed graph layout optimizer is designed, which combines the gravitational and repulsive force coefficients and the hierarchical layout tree to accurately calculate the node coordinates through the node complexity weight and the hierarchical coefficient. A node overlap detector and a path planner are introduced to achieve the adaptive offset of the node positions and the optimal planning of the connection paths. This method effectively solves the deficiencies of the traditional technology in aspects such as node layout, spatial distribution, and path planning, and significantly improves the visualization effect and practicality of the causal graph of software test cases.

[0308] An embodiment of the present application also provides a computer program product capable of implementing all the steps in the test case causal graph data processing method whose execution subject in the above embodiment is a server or a client. When the computer program / instructions are executed by a processor, the steps of the test case causal graph data processing method are implemented. For example, the computer program / instructions implement the following steps:

[0309] Step S101: Receive a data file and extract causal graph structure data, extract the set of constraint nodes, the set of causal nodes, and the set of causal relationships in the data file. The set of causal nodes includes 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. Assign a unique identifier to each node in the set of constraint nodes and the set of causal nodes, and construct a node relationship training data set;

[0310] 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. The force-directed graph layout optimizer applies a gravitational coefficient and a repulsive force coefficient to the set of causal nodes, obtains the 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 hierarchical coefficient, traverses the set of causal relationships to construct an adjacency matrix, calculates the node complexity weight based on the adjacency matrix, multiply the hierarchical coefficient and the node complexity weight by the node width parameter and the height parameter respectively to calculate the causal node coordinates, multiply the hierarchical coefficient and the sequence number weight of the constraint nodes 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;

[0311] Step S103: Input the spatial distribution model into a node overlap detector. The node overlap detector calculates the distance matrix between adjacent nodes, triggers position offsets for node pairs with distances less than the 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 causal graph of software test cases with an adaptive layout, and outputs and displays the causal graph of software test cases.

[0312] As can be seen from the above description, the computer program product provided by the embodiments of the present application innovatively constructs a causal graph structure data extraction mechanism and realizes the normalization processing of data through node identifier allocation. A force-directed graph layout optimizer is designed, which combines the gravitational and repulsive force coefficients and a hierarchical layout tree, and accurately calculates node coordinates 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 optimal planning of connection paths. This method effectively solves the deficiencies of traditional technologies in aspects such as node layout, spatial distribution, and path planning, and significantly improves the visualization effect and practicality of the causal graph of software test cases.

[0313] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, apparatus, or computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.

[0314] The present invention is described with reference to the flowcharts and / or block diagrams of methods, devices (apparatuses), and computer program products according to the embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, and 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 the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a device for realizing the functions specified in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0315] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device realizes the functions in the process Figure 1One or more processes and / or blocks Figure 1 The functions specified in one or more blocks.

[0316] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one Figure 1 One or more processes and / or blocks Figure 1 The steps of the functions specified in one or more blocks.

[0317] In the present invention, specific embodiments are used to elaborate on the principles and implementation manners 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 of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A method for processing causal diagram data of test cases, characterized in that The method includes: Receiving a data file and extracting causal graph structure data, extracting a set of constraint nodes, a set of causal nodes, and a set of causal relationships from the data file, where the set of causal nodes includes cause nodes and effect nodes, the effect nodes are configured with forward and reverse rule attributes, the constraint nodes are configured with forward and reverse constraint attributes, assigning a unique identifier to each node in the set of constraint nodes and the set of causal nodes, and constructing a node relationship training data set; 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 applying a gravitational coefficient and a repulsive coefficient to the set of causal nodes, obtaining an equilibrium distance between nodes through iterative calculation, constructing a hierarchical layout tree according to the equilibrium distance, calculating the depth level of each causal node to obtain a level coefficient, traversing the set of causal relationships 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 node height parameter respectively to calculate the causal node coordinates, multiplying the level coefficient and the sequence number weight of the constraint node by a node layout parameter to calculate the constraint node coordinates, and constructing a spatial distribution model based on the causal node coordinates and the constraint node coordinates; Inputting the spatial distribution model into a node overlap detector, the node overlap detector calculating a distance matrix between adjacent nodes, triggering a position offset for node pairs with a distance less than a minimum spacing threshold, inputting the offset node coordinates into a path planner, the path planner calculating an optimal connection path based on the set of causal relationships to avoid overlapping connection lines, and generating a causal graph of software test cases with an adaptive layout, and outputting and displaying the causal graph of software test cases.

2. The test case cause-and-effect diagram data processing method according to claim 1, wherein The receiving of the data file and the extraction of the causal graph structure data, the extraction of the set of constraint nodes, the set of causal nodes, and the set of causal relationships from the data file, where the set of causal nodes includes cause nodes and effect nodes, the effect nodes are configured with forward and reverse rule attributes, the constraint nodes are configured with forward and reverse constraint attributes, 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 node relationship information, respectively establishing a set of constraint nodes and a set of causal nodes according to the node information, establishing a set of causal relationships according to the node relationship information, and storing the set of constraint nodes, the set of causal nodes, and the set of causal relationships in a node data cache; Reading node set information from the node data cache, traversing the set of causal nodes to mark each node as a cause node or an effect node, traversing the set of effect nodes to configure a forward and reverse rule attribute identifier for each effect node, traversing the set of constraint nodes to configure a forward and reverse constraint attribute identifier for each constraint node, generating a globally unique identifier and assigning it to each node, and writing the configured node information into a node attribute table.

3. The test case cause-and-effect diagram data processing method according to claim 1, characterized in that Construct the layout optimization model and calculate the node layout coordinates, train the force-directed graph layout optimizer based on the node relationship training dataset, and the force-directed graph layout optimizer applies the gravitational coefficient and the repulsive coefficient to the causal node set, and obtains the equilibrium distance between nodes through iterative calculation, including: Extract the node position feature vector and the connection relationship feature vector from the node relationship training dataset, train the model parameters of the force-directed graph layout optimizer based on the layout optimization loss function, input 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, the repulsive calculation unit calculates the repulsive coefficient according to the spatial distance between nodes, and input the calculated gravitational coefficient and repulsive coefficient into the layout optimizer; Input the causal node set into the layout optimizer, calculate the gravitational action value between connected nodes based on the gravitational coefficient, calculate the repulsive action value between all node pairs based on the repulsive coefficient, perform iterative calculation on the gravitational action value and the repulsive action value applied to the nodes, and judge whether the node position change amount is less than the preset convergence threshold. When the position change amount is less than the preset convergence threshold, output the equilibrium distance between nodes.

4. The test case cause-and-effect diagram data processing method according to claim 1, wherein Construct a hierarchical layout tree according to the equilibrium distance, calculate the depth level of each causal node to obtain the level coefficient, traverse the causal relationship set to construct an adjacency matrix, and calculate the node complexity weight based on the adjacency matrix, including: Construct a spatial distance matrix based on the equilibrium distance, use the hierarchical clustering algorithm to perform hierarchical partitioning on the distance matrix to obtain the node hierarchy tree, traverse the node hierarchy tree to calculate the shortest path length from each causal node to the root node, normalize the shortest path length to obtain the node depth level value, and calculate the level coefficient based on the product of the node depth level value and the preset level weight coefficient; Traverse the causal relationship set to obtain the connection relationship between nodes, construct an N-order square matrix to represent the node connection state to obtain the adjacency matrix, perform power operation on the adjacency matrix to obtain the node reachability matrix, calculate the out-degree value and the 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.

5. The method for processing test case cause-and-effect diagram data according to claim 1, wherein Multiply the level coefficient and the node complexity weight by the node width parameter and the node height parameter respectively to calculate the causal node coordinates, multiply the level coefficient and the serial 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, including: Read the node width parameter and the node height parameter from the layout parameter configuration table, multiply the level coefficient by the node width parameter to calculate the abscissa of the causal node, multiply the node complexity weight by the node height parameter to calculate the ordinate of the causal node, traverse the constraint node set to obtain the serial number of each constraint node, normalize the constraint node serial number to obtain the serial number weight, and multiply the level coefficient and the serial number weight of the constraint node by the node layout parameter to calculate the abscissa and ordinate of the constraint node; Input the causal node coordinates and constraint node coordinates into the spatial distribution model builder, calculate the spatial distribution density matrix based on the node coordinates, construct a node distribution probability model using the non-parametric kernel density estimation method, and integrate the node distribution probability model with the coordinate mapping relationship to obtain the spatial distribution model.

6. The test case cause-and-effect diagram data processing method according to claim 1, wherein Input the spatial distribution model into the node overlap detector. The node overlap detector calculates the distance matrix between adjacent nodes and triggers position offset for node pairs with a distance less than the minimum spacing threshold, including: 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 for each node, calculate the Euclidean distance for node pairs in the nearest neighbor node set to obtain the distance matrix, and compare the distance matrix with the preset minimum spacing threshold to generate an overlap detection result; Select node pairs with a distance less than the minimum spacing threshold from the overlap detection result, 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 for coordinate adjustment, and update the adjusted node coordinates to the spatial distribution model.

7. The test case cause-and-effect diagram data processing method according to claim 1, wherein Input the offset node coordinates into the path planner. The path planner calculates the optimal connection path based on the causal relationship set to avoid overlapping connection lines and generates a causal graph of software test cases with an adaptive layout, and outputs and displays the causal graph of software test cases, including: Input the offset node coordinates and the causal relationship set into the path planner, construct a grid-based path cost map based on the node coordinates, call the A* search algorithm for each connection relationship to calculate the candidate path set from the start node to the target node, smooth the candidate paths using Bezier curves to obtain the connection path, calculate the number of intersection points between the connection paths as the path cost, and select the connection path with the minimum path cost as the optimal connection path; Traverse the causal relationship set to obtain the connection relationships between nodes, draw connection lines according to the connection relationships and the optimal connection path, write the node coordinate information and the connection path information into the graphic drawing buffer, call the graphic rendering engine to convert the buffer data into a causal graph of software test cases, and output the causal graph of software test cases to the display device.

8. A test case cause-and-effect diagram data processing device, characterized in that, The device includes: A data preprocessing module for receiving a data file and extracting causal graph structure data, extracting the constraint node set, causal node set, and causal relationship set in the data file. The causal node set includes cause nodes and effect nodes, the effect nodes are configured with forward and reverse rule attributes, the constraint nodes are configured with forward and reverse constraint attributes, assign a unique identifier to each node in the constraint node set and causal node set, and construct a node relationship training data set; A model construction module, configured to construct a layout optimization model and calculate node layout coordinates, train a force-directed graph layout optimizer based on the node relationship training dataset, the force-directed graph layout optimizer applies a gravitational coefficient and a repulsive coefficient to the causal node set, obtains the 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 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 calculate the causal node coordinates, multiplies 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 constructs a spatial distribution model based on the causal node coordinates and the constraint node coordinates; A causal graph determination module, configured to input the spatial distribution model into a node overlap detector, the node overlap detector calculates the distance matrix between adjacent nodes, triggers position offset for node pairs with a distance less than the minimum spacing threshold, 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 connection line overlap, and generates a software test case causal graph with an adaptive layout, and outputs and displays the software test case causal graph.

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

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

Citation Information

Patent Citations

  • 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