Test path generation method and device based on business flow chart, equipment and medium

By identifying and dynamically adjusting key test paths in the business process diagram, constructing a coverage prediction model, and optimizing the test case set, the redundancy and insufficient coverage issues in test path generation in existing technologies are resolved, enabling efficient business scenario testing.

CN120909937APending Publication Date: 2025-11-07PING AN HEALTH INSURANCE CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511064955.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-30
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing test path generation methods based on business process models suffer from problems such as generating redundant paths and insufficiently refined coverage calculations when dealing with complex business scenarios, leading to wasted test resources and omissions of critical paths.

Method used

By acquiring node and path topology information from the business process diagram, key test paths are identified based on node importance weights and historical execution probabilities. Priorities are dynamically adjusted by combining branch conditional probabilities and external response events. A path coverage prediction model is constructed, test case sets are configured, and a multi-objective optimization algorithm is used for dynamic adjustment.

Benefits of technology

It improved the testing efficiency of business scenarios, ensured priority testing of high-risk and high-frequency paths, reduced testing time and resource waste, and improved the accuracy of test coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120909937A_ABST
    Figure CN120909937A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of software testing, is suitable for the medical field and the financial field, and discloses a service flow chart-based test path generation method, device and equipment and a medium, and the method comprises the steps: obtaining a service flow chart of a service scene, and extracting nodes of the service flow chart and path topology information between the nodes; on the basis of the service importance weight and the historical execution probability of each node, key test paths in the path topology information are identified, and priorities of the key test paths are sorted; constructing a path coverage rate prediction model based on the dynamically adjusted priority of the key path and the historical execution probability of the key path, and predicting the coverage rate of each key path in the business flow chart based on the constructed path coverage rate prediction model; and configuring a test case set based on the predicted coverage rate of each key path in the business flow chart, and dynamically adjusting the configured test case set based on a multi-objective optimization algorithm. According to the invention, the test efficiency of the business scene is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of software testing, and is suitable for the medical field and the financial field, and in particular relates to a test path generation method, device and equipment based on a business process diagram and a medium. BACKGROUND

[0002] With the continuous advancement of enterprise digital transformation, business process models are widely used in defining and implementing complex business logic. Especially in the financial field, such as loan approval and payment verification, and in the medical field, such as patient treatment and treatment path management. In order to ensure the stable execution of these business processes, automatic test path generation technology has become an indispensable important support.

[0003] However, the existing test path generation method based on the business process model still has significant deficiencies, which seriously affects the test efficiency and quality. At present, some tools mainly parse the nodes in the business process model statically, and generate all possible paths by using graph traversal algorithm. For example, when dealing with a loan application process containing multiple conditional branches, the dynamic interaction between paths, data dependency relationship and business rule constraints in the actual execution process are ignored, resulting in a large number of redundant or impossible test paths in practice, causing waste of test resources. In addition, some tools try to optimize the path by path coverage calculation, but the coverage calculation method is usually too simple and lacks fine control. For example, in an insurance claim process involving complex cost calculation and exception handling, the existing method often cannot effectively identify and prioritize paths that carry high-risk boundary conditions or key business rules, easily missing key test points, and thus failing to fully cover core business scenarios and potential fault points.

[0004] Therefore, how to improve the test efficiency of the business scenario is a technical problem to be solved. SUMMARY

[0005] The present application provides a test path generation method, device, equipment and medium based on a business process diagram, to solve the technical problem of how to improve the test efficiency of the business scenario.

[0006] In a first aspect, the present application provides a test path generation method based on a business process diagram, comprising:

[0007] Obtaining a business process diagram of a business scenario, and extracting nodes and path topology information between the nodes of the business process diagram;

[0008] Based on the business importance weight and historical execution probability of each node, identifying a key test path in the path topology information, and sorting the priority of the key test path;

[0009] based on the branch condition probability and the external response event of the business process graph, dynamically adjusting the priority of the generated critical path;

[0010] based on the dynamically adjusted priority of the critical path and the historical execution probability of the critical path, constructing a path coverage rate prediction model, and predicting the coverage rate of each critical path in the business process graph based on the constructed path coverage rate prediction model;

[0011] based on the predicted coverage rate of each critical path in the business process graph, configuring a test case set, and dynamically adjusting the configured test case set based on a multi-objective optimization algorithm.

[0012] In a second aspect, the present application provides a test path generation device based on a business process graph, comprising:

[0013] an acquisition module configured to acquire a business process graph of a business scenario and extract node and path topology information between nodes of the business process graph;

[0014] an identification module configured to identify a critical test path in the path topology information based on a business importance weight and a historical execution probability of each node, and sort the priority of the critical test path;

[0015] an adjustment module configured to dynamically adjust the priority of the generated critical path based on a branch condition probability and an external response event of the business process graph;

[0016] a construction module configured to construct a path coverage rate prediction model based on the dynamically adjusted priority of the critical path and the historical execution probability of the critical path, and predict the coverage rate of each critical path in the business process graph based on the constructed path coverage rate prediction model;

[0017] a configuration module configured to configure a test case set based on the predicted coverage rate of each critical path in the business process graph, and dynamically adjust the configured test case set based on a multi-objective optimization algorithm.

[0018] In a third aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the test path generation method based on a business process graph when executing the computer program.

[0019] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executable on a processor to implement the steps of the test path generation method based on a business process graph.

[0020] The method, device, equipment and medium for generating a test path based on a business process diagram can obtain a business process diagram of a business scenario through a client, extract node and path topology information between nodes of the business process diagram, identify a key test path in the path topology information based on a business importance weight and a historical execution probability of each node, sort a priority of the key test path, dynamically adjust the priority of the generated key path based on a branch condition probability and an external response event of the business process diagram, construct a path coverage rate prediction model based on the priority of the dynamically adjusted key path and the historical execution probability of the key path, predict a coverage rate of each key path in the business process diagram based on the constructed path coverage rate prediction model, configure a test case set based on the predicted coverage rate of each key path in the business process diagram, and dynamically adjust the configured test case set based on a multi-objective optimization algorithm. In the application, when a business scenario test is performed, the most critical test path for the business can be identified according to the importance weight and the historical execution probability of the node, and the business path with high risk and high frequency is tested preferentially. In addition, by predicting the coverage rate of each key path, a tester can preferentially complete the test path with a low coverage rate within a limited time, and the test efficiency of the business scenario is effectively improved. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the description of the embodiments of the present application. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can also be obtained by those skilled in the art without any creative labor.

[0022] Figure 1 is an application environment schematic diagram of the test path generation method based on the business process diagram in an embodiment of the present application;

[0023] Figure 2 is a flow schematic diagram of the test path generation method based on the business process diagram in an embodiment of the present application;

[0024] Figure 3 is Figure 2 is a specific implementation flow schematic diagram of step S10 in the method;

[0025] Figure 4 is Figure 2 is a specific implementation flow schematic diagram of step S20 in the method;

[0026] Figure 5 is Figure 2 is a specific implementation flow schematic diagram of step S30 in the method;

[0027] Figure 6 is Figure 2 a specific implementation flowchart of step S40 in

[0028] Figure 7 is Figure 2 a specific implementation flowchart of step S50 in

[0029] Figure 8 is a structural schematic diagram of a test path generation device based on a business process diagram in an embodiment of the present application;

[0030] Figure 9 is a structural schematic diagram of a computer device in an embodiment of the present application;

[0031] Figure 10 is another structural schematic diagram of a computer device in an embodiment of the present application. DETAILED DESCRIPTION

[0032] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of the present application.

[0033] The business process diagram based test path generation method provided by the embodiments of the present application can be applied in an application environment such as Figure 1 Figure 1 ​Fig. 1 is an application environment schematic diagram of a test path generation method based on a business process graph in an embodiment of the present application; wherein a client communicates with a server through a network. The server can obtain a business process graph of a business scenario through the client, and extract nodes of the business process graph and path topology information between the nodes; based on business importance weights and historical execution probabilities of the nodes, identify key test paths in the path topology information, and sort priorities of the key test paths; based on branch condition probabilities and external response events of the business process graph, dynamically adjust the priorities of the generated key paths; based on the dynamically adjusted priorities of the key paths and historical execution probabilities of the key paths, construct a path coverage rate prediction model, and predict coverage rates of the key paths in the business process graph based on the constructed path coverage rate prediction model; based on the predicted coverage rates of the key paths in the business process graph, configure a test case set, and dynamically adjust the configured test case set based on a multi-objective optimization algorithm. In the present application, when testing a business scenario, the most critical test paths for the business can be identified according to the importance weights and historical execution probabilities of the nodes, and high-risk and high-frequency business paths are tested preferentially. In addition, by predicting the coverage rates of the key paths, a tester can preferentially complete test paths with low coverage rates within a limited time, effectively improving the test efficiency of the business scenario. The present application will be described in detail below through specific embodiments.

[0034] Referring to Fig. 1, Figure 2 Figure 2 Fig. 2 is a flowchart of a test path generation method based on a business process graph provided in an embodiment of the present application, which specifically includes the following steps:

[0035] S10: Obtain a business process graph of a business scenario, and extract nodes of the business process graph and path topology information between the nodes. In the present embodiment, through extraction of the business process graph, the operation process and data flow of the business can be clearly presented. Specifically, as shown in Fig. 3, Figure 3 Figure 3 Fig. 4 is a specific implementation flowchart of step S10, which specifically includes the following steps S11-S13:

[0036] ​​S11: calling a business process graph corresponding to a business scenario from a preset business process library, wherein the business process graph contains nodes, connection relationships between the nodes, and branch condition annotations. Specifically, in the embodiment of the present application, by calling a process graph from a preset business process library, a standardized business process graph can be quickly extracted for each business scenario, avoiding the tedious process of manually drawing a process graph each time and improving the efficiency of test design. For example, in the business process of loan application, by calling a preset loan application process graph, standardized process graphs of the links of customer information audit, credit scoring, and loan approval in the business process can be quickly obtained, providing a reliable basis for subsequent testing. In a medical scenario, a standardized treatment process graph can be obtained from the business process library for the patient from the operations of registration, diagnosis and treatment, to payment and medicine taking, ensuring full coverage of the medical service process in testing.

[0037] S12: traversing the nodes in the business process graph and constructing a path topology graph between the nodes based on the connection relationships between the nodes and the branch condition annotations. Specifically, in the embodiment of the present application, each node in the business process graph is traversed, and based on the connection relationships between the nodes, each process node and its mutual relationship can be clearly displayed, helping the test personnel to understand the business process comprehensively. Through the branch condition annotations, a path topology graph can be generated to show the connection relationships between the nodes, ensuring the comprehensiveness and effectiveness of the test path. For example, in the credit card application process, there can be multiple decision points, such as credit check, risk control, and quota calculation, and after traversing the nodes, the path relationship between each node can be clearly seen.

[0038] S13: analyzing the association relationship of the input edges and the output edges of each node in the path topology graph to generate path topology information containing node connection weights and path constraint conditions. Specifically, in the embodiment of the present application, by analyzing the input edges and the output edges of each node, the association relationship of the path can be analyzed in depth, ensuring that the mutual dependency relationship of each key node is considered. Through the weights of the node connection and the path constraint conditions, different importance and priority can be given to each path, so as to realize more reasonable path priority sorting. For example, in the loan application process, the association relationship between the risk assessment node and the loan quota node is very important, and by analyzing the input and output between the nodes, it can be identified which risk assessment conditions are crucial to the entire process, thereby providing the test personnel with the basis for the priority sorting of the path and ensuring that the high-risk path is tested first.

[0039] S20: Identify the key test paths in the path topology information based on the business importance weight and the historical execution probability of each node, and sort the priority of the key test paths. In the embodiment of the application, according to the importance weight and the historical execution probability of the node, the test path most critical to the business can be identified, the high-risk and high-frequency business path is tested preferentially, the test resource is concentrated in the place most likely to expose defects, and the test efficiency of the business scene is effectively improved. Specifically, as shown in Figure 4 the, Figure 4 is a specific implementation process schematic diagram of step S20, specifically comprising steps S21-S23 as follows:

[0040] S21: Identify the type of each node in the business flowchart, and assign a business importance weight to each node based on the identified node type. Specifically, in the embodiment of the application, by identifying the type of each node in the business flowchart, the nodes can be classified into different types, such as decision nodes, operation nodes, condition nodes, etc. For example, in the loan approval process, important nodes can include credit scoring, income verification, risk control, etc., and the weight of the decision node will be given a higher value because it directly affects whether to approve the loan. By this weight assignment, the fault points in the loan approval process can be tested preferentially, and the core part of the business process can be fully verified.

[0041] S22: Calculate the criticality score of each path in the path topology graph based on the business importance weight and the historical execution probability of each node. Specifically, in the embodiment of the application, the criticality score of each path can be calculated in combination with the business importance weight and the historical execution probability. The higher the historical execution probability and the greater the importance, the higher the criticality score of the path. For example, in the loan approval process, historical data shows that some nodes of the approval path are often triggered and have a greater impact on the approval result. By calculating the criticality score of these paths, these paths can be tested preferentially to ensure that the core functions of the financial product are verified in different scenarios.

[0042] S23: Identify the path whose criticality score exceeds a preset threshold as a key test path, and generate an initial priority sequence of the key test paths according to the descending order of the criticality scores. Specifically, in the embodiment of the application, by identifying the path whose criticality score exceeds the set threshold as the key test path, it can be ensured that the tester includes the most critical path in the test range. For example, in the process of loan approval, based on historical data and importance weight, the approval process, credit scoring, risk assessment, etc. may be marked as key test paths according to the descending order of their criticality scores. The tester can test the generated key test paths according to the priority order.

[0043] S30: dynamically adjusting the priority of the generated critical path based on the branch condition probability of the business process graph and external response events. Specifically, in the embodiment of the present application, by introducing branch condition probability and external response events such as network failure and interface exception, the priority of the test path can be dynamically adjusted according to changes in actual business operation. Specifically, as shown in FIG. 3, the priority of the test path is dynamically adjusted based on the branch condition probability of the business process graph and external response events. Figure 5 Figure 5 is a specific implementation flowchart of step S30, specifically including steps S31-S34 as follows:

[0044] S31: updating the branch condition probability of each node in the business process graph, and real-time monitoring of external response events. Specifically, in the embodiment of the present application, by updating the branch condition probability of each node, it can be ensured that the business process graph always reflects the latest business status. For example, the decision conditions of some nodes in the business process are affected by the external environment, by updating these conditions in real time, the process graph can be more consistent with the actual business dynamics. For example, the financial payment system can real-time monitor the return result of the payment request, and the medical system can capture the emergency needs of the patient.

[0045] S32: analyzing the type of the monitored external response event, and generating a path weight adjustment coefficient based on the relevance of the type of the external response event and the critical test path. Specifically, in the embodiment of the present application, the key role of generating the path weight adjustment coefficient is to dynamically adjust the priority of the path through the relevance of the type of the response event and the critical path. For example, in the financial scenario, when the payment fails or is rejected, the type of these events will affect the path weight of the subsequent payment process. Through the path weight adjustment coefficient, the test priority of the payment failure path can be automatically increased.

[0046] S33: calculating the critical path priority score based on the updated branch condition probability of each node and the path weight adjustment coefficient. Specifically, in the embodiment of the present application, the updated branch condition probability and the path weight adjustment coefficient make the priority score of the test path more accurate, and through this comprehensive calculation, it can be ensured that the importance and influence of the critical path in the business process are fully reflected. For example, in the loan approval process, as the branch conditions such as risk control and credit scoring change, the priority score will be recalculated, so as to ensure that the risk audit, credit evaluation and other critical paths are tested and executed in priority.

[0047] ​S34: Reorder the priority of the critical test paths according to the calculated critical path priority score. Specifically, in the embodiments of the present application, by reordering the priority of the test paths, it can be ensured that the most critical and most likely to fail paths are tested first. For example, in the loan approval process, the priority of some paths may change after updating the branch condition probability. By reordering, it can be ensured that the most critical risk control path or approval path is tested first.

[0048] S40: Construct a path coverage prediction model based on the dynamically adjusted priority of the critical path and the historical execution probability of the critical path, and predict the coverage of each critical path in the business process graph based on the constructed path coverage prediction model. In the embodiments of the present application, by using historical data and dynamically adjusted priority, a path coverage prediction model is constructed, which can predict which paths will be covered by testing and which paths may be missed, so as to actively discover the testing blind area. By predicting the coverage of each critical path, the tester can prioritize the test paths with lower coverage in a limited time, improving the time utilization efficiency of testing. Specifically, as shown in the following table, the priority of each path in the loan approval process is dynamically adjusted based on the historical execution probability, and the coverage of each path is predicted based on the constructed path coverage prediction model. Figure 6 Figure 6 is a specific implementation flowchart of step S40, specifically comprising the following steps S41-S43:

[0049] S41: Weighted fusion of the dynamically adjusted critical path priority and the historical execution probability of the corresponding path to generate a path coverage feature vector. Specifically, in the embodiments of the present application, the dynamically adjusted critical path priority and the historical execution probability are weighted and fused to obtain a more accurate path coverage feature vector. The historical execution data of the path and the importance of the current business will be reflected in the feature vector, thereby providing more reliable path prediction. For example, in a financial system, the credit score, income verification, risk assessment, etc. in the loan approval process may have different priorities and historical execution probabilities. By combining the priorities and execution probabilities of these paths, a more accurate path feature vector can be generated, so that high-risk and frequently executed paths are prioritized during testing.

[0050] S42: Train the path coverage prediction model based on the path coverage feature vectors and the real coverage rate labels in the historical test data set. Specifically, in the embodiments of the present application, by combining the path coverage feature vectors and the real coverage rate labels, a model that can accurately predict the path coverage rate can be effectively trained. For example, in a financial scenario, based on historical test data, an accurate prediction model can be trained for each path in the loan approval process, thereby helping the test team to identify which paths may have insufficient coverage and to supplement testing in a timely manner.

[0051] ​S43: input each critical path in the business process graph into the path coverage prediction model to predict the coverage of each critical path in the business process graph. Specifically, in the embodiment of the present application, inputting each critical path in the business process graph into the path coverage prediction model can help the tester to predict the test coverage of each critical path in real time, so as to dynamically optimize the test plan and priority. For example, in the financial scenario, by inputting each critical path of the loan approval process into the coverage prediction model, the tester can predict which paths have been fully tested and which paths may have test blind spots, so as to optimize the test plan and ensure comprehensive testing of the loan process.

[0052] S50: configure a test case set based on the predicted coverage of each critical path in the business process graph, and dynamically adjust the configured test case set based on a multi-objective optimization algorithm. In the embodiment of the present application, according to the path coverage prediction result, the test case set is reasonably configured, and combined with the multi-objective optimization algorithm, a balance can be found among the optimization targets of test coverage, execution time, resource consumption, etc., to realize the optimal configuration of test cases. Specifically, as shown in the following Figure 7 Figure 7 is a specific implementation process schematic diagram of step S50, specifically comprising the following steps S51-S53:

[0053] S51: minimize the execution time of the test case set and maximize the critical path coverage as the target, and construct a multi-objective optimization function. Specifically, in the embodiment of the present application, by collecting the actual coverage of each critical path in real time, the test progress can be accurately tracked, and it can be found in time which paths are fully tested and which paths may be missed. This helps to ensure the comprehensiveness and efficiency of the test. By obtaining the actual coverage in real time, the expected and actual results can be compared, so as to verify whether the test case meets the requirements and avoid missing critical paths and functions. For example, in the loan approval process, the coverage rate data of critical paths such as credit scoring, income verification, risk control audit, etc. can be collected in real time to help the test team ensure that the coverage rate of these critical links is high enough, and the test case is adjusted in time to cover all important paths.

[0054] S52: iteratively generate a test case set solution by using an evolutionary algorithm, and select an optimal solution set that minimizes the execution time of the test case set and maximizes the critical path coverage and the upper limit of the critical path coverage in the solution space. Specifically, in the embodiment of the present application, by calculating the deviation between the predicted coverage and the actual coverage of the critical path, it can be known which paths have actual test results inconsistent with the prediction, and possible test blind spots or errors can be identified. Calculating the coverage deviation is an important step in optimizing the test process. In the loan approval process, there may be cases where the coverage rate of some paths is not accurately predicted. By analyzing the coverage deviation of these paths, deficiencies in the test can be found in time and optimized and adjusted.​

[0055] S53: Monitor the real-time critical path coverage, and trigger the multi-objective optimization function to reconfigure the test case set and dynamically update the test case set when detecting that the critical path coverage deviation exceeds the preset tolerance. Specifically, in the embodiment of the present application, by combining the predicted coverage, the actual coverage and the coverage deviation, a complete test coverage evaluation report can be generated to systematically show the coverage of the test. For example, a coverage evaluation report about each critical path in the loan approval process is generated, and the financial institution can identify which paths are not fully tested and which paths have been tested enough, helping it to allocate test resources more accurately in future versions.

[0056] In an embodiment of the present application, after the test case set is configured based on the predicted coverage of each critical path in the business process graph and the configured test case set is dynamically adjusted based on the multi-objective optimization algorithm, the method further comprises the following steps S61-S63:

[0057] S61: Execute the dynamically adjusted test case set on the business scenario, and collect the actual coverage of each critical path in the business process graph in real time. Specifically, in the embodiment of the present application, by executing the dynamically adjusted test case set and collecting the actual coverage of each critical path in real time, the execution effect of the test can be tracked in time to ensure that each critical path in the business process is verified enough.

[0058] S62: Calculate the coverage deviation of the critical path based on the predicted coverage and the actual coverage of the critical path, and visually analyze the calculated coverage deviation of the critical path. Specifically, in the embodiment of the present application, in the process of loan approval, multiple critical paths need to be verified, such as credit scoring, risk assessment, income verification, etc. Collecting the coverage data of these paths in real time can help the financial institution quickly find the omissions of certain critical paths during the test process to ensure the accuracy of loan approval.

[0059] S63: Based on the visual analysis of the predicted coverage, the actual coverage and the coverage deviation of the critical path, generate a test coverage evaluation report of the business scenario. Specifically, in the embodiment of the present application, by combining the data of the predicted coverage, the actual coverage and the coverage deviation, a detailed test coverage evaluation report can be generated to provide comprehensive coverage analysis, which can help decision makers understand the comprehensiveness of the test and potential blind spots in the test.

[0060] It can be seen that in the above scheme, when the business scenario test is performed, the test path most critical to the business can be identified according to the importance weight and the historical execution probability of the node, and the high-risk and high-frequency business path is tested preferentially. In addition, by predicting the coverage of each critical path, the tester can preferentially complete the test path with low coverage in limited time, thereby effectively improving the test efficiency of the business scenario.

[0061] It should be understood that the size of the serial number of each step in the above embodiment does not mean the order of execution, and the execution order of each process should be determined according to its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application.

[0062] In an embodiment, a business flowchart-based test path generation device is provided, which corresponds to the business flowchart-based test path generation method in the above embodiment. As shown in Figure 8 Figure 8 is a structural schematic diagram of the business flowchart-based test path generation device in an embodiment of the present application, which includes an acquisition module 81, an identification module 82, an adjustment module 83, a construction module 84, and a configuration module 85. The functions of each functional module are described in detail as follows:

[0063] The acquisition module 81 is configured to acquire the business flowchart of the business scenario, and extract the node and the path topology information between the nodes of the business flowchart;

[0064] The identification module 82 is configured to identify the critical test path in the path topology information based on the business importance weight and the historical execution probability of each node, and sort the priority of the critical test path;

[0065] The adjustment module 83 is configured to dynamically adjust the priority of the generated critical path based on the branch condition probability of the business flowchart and the external response event;

[0066] The construction module 84 is configured to construct a path coverage prediction model based on the priority of the dynamically adjusted critical path and the historical execution probability of the critical path, and predict the coverage of each critical path in the business flowchart based on the constructed path coverage prediction model;

[0067] The configuration module 85 is configured to configure a test case set based on the predicted coverage of each critical path in the business flowchart, and dynamically adjust the configured test case set based on a multi-objective optimization algorithm.

[0068] In an embodiment, the acquisition module 81 is specifically configured to:

[0069] ​obtaining a business flowchart of a business scenario, and extracting node and path topology information between nodes of the business flowchart;

[0070] identifying a key test path in the path topology information based on a business importance weight and a historical execution probability of each node, and sorting a priority of the key test path;

[0071] dynamically adjusting the priority of the generated key path based on a branch condition probability of the business flowchart and an external response event;

[0072] constructing a path coverage rate prediction model based on the dynamically adjusted priority of the key path and a historical execution probability of the key path, and predicting a coverage rate of each key path in the business flowchart based on the constructed path coverage rate prediction model;

[0073] configuring a test case set based on the predicted coverage rate of each key path in the business flowchart, and dynamically adjusting the configured test case set based on a multi-objective optimization algorithm.

[0074] In an embodiment, the identifying module 82 is specifically configured to:

[0075] identify a type of each node in the business flowchart, and assign a business importance weight to each node based on the identified type of the node;

[0076] calculate a criticality score of each path in the path topology graph based on the business importance weight and the historical execution probability of each node;

[0077] identify a path with a criticality score exceeding a preset threshold as a key test path, and generate an initial priority sequence of the key test path according to a descending order of the criticality score.

[0078] In an embodiment, the adjusting module 83 is specifically configured to:

[0079] update a branch condition probability of each node in the business flowchart, and listen to an external response event in real time;

[0080] analyze a type of the listened external response event, and generate a path weight adjustment coefficient based on a relevance of the type of the external response event to the key test path;

[0081] calculate a key path priority score based on the updated branch condition probability of each node and the path weight adjustment coefficient;

[0082] re-sort the priority of the key test path according to the calculated key path priority score.

[0083] In an embodiment, the constructing module 84 is further configured to:

[0084] The dynamically adjusted critical path priority is weighted and fused with the historical execution probability of the corresponding path to generate a path coverage feature vector;

[0085] Based on the path coverage feature vector and the real coverage rate label in the historical test data set, a path coverage rate prediction model is trained.

[0086] Each critical path in the business process graph is input into the path coverage rate prediction model to predict the coverage rate of each critical path in the business process graph.

[0087] In an embodiment, the configuration module 85 is specifically configured to:

[0088] The execution time of the minimum test case set and the maximum critical path coverage rate are taken as targets to construct a multi-objective optimization function:

[0089] An evolutionary algorithm is used to iteratively generate test case set solutions, and the optimal solution set that minimizes the execution time of the test case set and maximizes the critical path coverage rate and the upper limit of the critical path coverage rate is screened in the solution space.

[0090] The real-time critical path coverage rate is monitored, and when it is detected that the critical path coverage rate deviation exceeds the preset tolerance, the multi-objective optimization function is triggered to reconfigure the test case set, and the test case set is dynamically updated.

[0091] In an embodiment, the business process graph-based test path device is also used for:

[0092] The dynamically adjusted test case set is executed on the business scenario, and the actual coverage rate of each critical path in the business process graph is collected in real time.

[0093] Based on the predicted coverage rate and the actual coverage rate of the critical path, the coverage rate deviation of the critical path is calculated, and the calculated coverage rate deviation of the critical path is visually analyzed.

[0094] Based on the predicted coverage rate, the actual coverage rate and the visual analysis of the coverage rate deviation of the critical path, a test coverage rate evaluation report of the business scenario is generated.

[0095] The application provides a business process graph-based test path generation device, which can identify the most critical test path for the business according to the importance weight and the historical execution probability of the node when testing the business scenario, and preferentially test the high-risk and high-frequency business path.

[0096] The specific definition of the business flowchart-based test path generation apparatus can refer to the definition of the business flowchart-based test path generation method, which will not be repeated here. Each module in the above business flowchart-based test path generation apparatus can be realized by software, hardware, and a combination thereof, in whole or in part. The above modules can be embedded in or independent of the processor in the computer device in hardware form, or can be stored in the memory in the computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to each module.

[0097] In one embodiment, a computer device is provided, which can be a server, and an internal structure diagram thereof can be as shown in Figure 9 Figure 9 is a structural schematic diagram of a computer device in an embodiment of the present application. The computer device includes a processor, a memory, a network interface, and a database connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is configured to communicate with an external client through a network connection. The computer program, when executed by the processor, implements the functions or steps of the server side of the business flowchart-based test path generation method.

[0098] In one embodiment, a computer device is provided, which can be a client, and an internal structure diagram thereof can be as shown in Figure 10 Figure 10 is another structural schematic diagram of a computer device in an embodiment of the present application. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. The processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for running the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is configured to communicate with an external server through a network connection. The computer program, when executed by the processor, implements the functions or steps of the client side of the business flowchart-based test path generation method.

[0099] In one embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the following steps when executing the computer program:

[0100] ​​obtaining a business flowchart of a business scenario, and extracting nodes of the business flowchart and path topology information between the nodes;

[0101] identifying key test paths in the path topology information based on business importance weights and historical execution probabilities of the nodes, and sorting priorities of the key test paths;

[0102] dynamically adjusting the priorities of the generated key paths based on branch condition probabilities and external response events of the business flowchart;

[0103] constructing a path coverage rate prediction model based on the dynamically adjusted priorities of the key paths and historical execution probabilities of the key paths, and predicting coverage rates of the key paths in the business flowchart based on the constructed path coverage rate prediction model;

[0104] configuring a test case set based on the predicted coverage rates of the key paths in the business flowchart, and dynamically adjusting the configured test case set based on a multi-objective optimization algorithm.

[0105] In one embodiment, a computer readable storage medium is provided, and the computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the following steps:

[0106] obtaining a business flowchart of a business scenario, and extracting nodes of the business flowchart and path topology information between the nodes;

[0107] identifying key test paths in the path topology information based on business importance weights and historical execution probabilities of the nodes, and sorting priorities of the key test paths;

[0108] dynamically adjusting the priorities of the generated key paths based on branch condition probabilities and external response events of the business flowchart;

[0109] constructing a path coverage rate prediction model based on the dynamically adjusted priorities of the key paths and historical execution probabilities of the key paths, and predicting coverage rates of the key paths in the business flowchart based on the constructed path coverage rate prediction model;

[0110] configuring a test case set based on the predicted coverage rates of the key paths in the business flowchart, and dynamically adjusting the configured test case set based on a multi-objective optimization algorithm.

[0111] It should be noted that the functions or steps that the computer readable storage medium or the computer device can implement are described above with reference to the method embodiments, and the related descriptions of the server side and the client side are not repeated here.

[0112] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, storage, database or other medium used in the embodiments provided by the present application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration but not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0113] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above-mentioned functional units and modules is exemplified, and in actual application, the above-mentioned functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.

[0114] The above-mentioned embodiments are only used to illustrate the technical solutions of the present application, but not limit it. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features. The modification or replacement does not make the essence of the corresponding technical solution deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.

Claims

1. A method for generating a test path based on a business process graph, characterized by, The method comprises the following steps: obtaining a business flowchart of a business scenario, and extracting nodes and path topology information between the nodes of the business flowchart; identifying key test paths in the path topology information based on the business importance weight and historical execution probability of each node, and sorting the priority of the key test paths; dynamically adjusting the priority of the generated key paths based on the branch condition probability and external response event of the business flowchart; constructing a path coverage prediction model based on the priority of the dynamically adjusted key paths and the historical execution probability of the key paths, and predicting the coverage of each key path in the business flowchart based on the constructed path coverage prediction model; configuring a test case set based on the predicted coverage of each key path in the business flowchart, and dynamically adjusting the configured test case set based on a multi-objective optimization algorithm.

2. The test path generation method based on a business process graph according to claim 1, characterized in that, The method comprises the following steps: calling a business flowchart corresponding to the business scenario from a preset business flow library, wherein the business flowchart contains nodes, connection relationships between the nodes, and branch condition annotations; traversing the nodes in the business flowchart, and constructing a path topology graph between the nodes based on the connection relationships between the nodes and the branch condition annotations; analyzing the association relationship between the input edges and the output edges of each node in the path topology graph, and generating path topology information containing node connection weights and path constraint conditions.

3. The test path generation method based on business process graph according to claim 2, characterized in that, The method comprises the following steps: identifying the types of each node in the business flowchart, and assigning a business importance weight to each node based on the identified node type; calculating the criticality score of each path in the path topology graph based on the business importance weight and the historical execution probability of each node; identifying a path as a key test path if the criticality score of the path exceeds a preset threshold, and generating an initial priority sequence of the key test paths in descending order of the criticality score.

4. The method of claim 1, wherein, The method comprises the following steps: updating the branch condition probability of each node in the business flowchart, and real-time monitoring external response events; analyzing the type of the monitored external response event, generating a path weight adjustment coefficient based on the association between the type of the external response event and the key test paths; calculating the key path priority score based on the updated branch condition probability of each node and the path weight adjustment coefficient; reordering the priority of the key test paths according to the calculated key path priority score.

5. The method of claim 1, wherein, The method comprises the following steps: weighting and fusing the dynamically adjusted key path priority and the historical execution probability of the corresponding path to generate a path coverage feature vector; training a path coverage rate prediction model based on path coverage feature vectors and true coverage rate labels in a historical test data set; inputting each critical path in the business process graph into the path coverage rate prediction model to predict the coverage rate of each critical path in the business process graph.

6. The test path generation method based on business process graph according to claim 1, wherein, configuring a test case set based on the predicted coverage rate of each critical path in the business process graph, and dynamically adjusting the configured test case set based on a multi-objective optimization algorithm, including: minimizing the execution time of the test case set and maximizing the critical path coverage rate as the target, constructing a multi-objective optimization function: using an evolutionary algorithm to iteratively generate a test case set solution, and screening the optimal solution set of minimizing the execution time of the test case set and maximizing the critical path coverage rate and the upper limit of the critical path coverage rate in the solution space; monitoring the real-time critical path coverage rate, and triggering the multi-objective optimization function to reconfigure the test case set and dynamically update the test case set when detecting that the critical path coverage rate deviation exceeds the preset tolerance.

7. The test path generation method based on business process graph according to claim 1, wherein, After configuring the test case set based on the predicted coverage rate of each critical path in the business process graph and dynamically adjusting the configured test case set based on the multi-objective optimization algorithm, the method further includes: executing the dynamically adjusted test case set on the business scenario, and collecting the actual coverage rate of each critical path in the business process graph in real time; calculating the critical path coverage rate deviation based on the predicted coverage rate and the actual coverage rate of the critical path, and visually analyzing the calculated critical path coverage rate deviation; generating a test coverage rate evaluation report of the business scenario based on the visual analysis of the predicted coverage rate, the actual coverage rate and the coverage rate deviation of the critical path.

8. A test path generation apparatus based on a business process graph, characterized by, including: an acquisition module configured to acquire a business process graph of a business scenario, and extract node and path topology information between nodes of the business process graph; an identification module configured to identify critical test paths in the path topology information based on the business importance weight and historical execution probability of each node, and sort the priority of the critical test paths; an adjustment module configured to dynamically adjust the priority of the generated critical paths based on the branch condition probability and external response event of the business process graph; a construction module configured to construct a path coverage rate prediction model based on the dynamically adjusted priority of the critical paths and the historical execution probability of the critical paths, and predict the coverage rate of each critical path in the business process graph based on the constructed path coverage rate prediction model; a configuration module configured to configure a test case set based on the predicted coverage rate of each critical path in the business process graph, and dynamically adjust the configured test case set based on a multi-objective optimization algorithm.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, The processor executes the computer program to realize the steps of the test path generation method based on the business process graph according to any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 9. The computer program is executed by the processor to realize the steps of the test path generation method based on the business process graph according to any one of claims 1 to 7.

Citation Information

Cited By

  • HRP system multi-module linkage test case self-adaptive generation method and system

    CN122111874A