A test case recommendation method and device, and computer-readable storage medium
By constructing a directed topology graph and binary pipeline model, combining the degree weight function value and risk assessment model, the problem of insufficient applicability measurement in test case recommendations is solved, and efficient screening and applicability improvement of test cases is achieved.
Patent Information
- Application Number
- CN202111235861.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-22
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2041-10-22
AI Technical Summary
In the testing process of complex software products, the test case recommendation method cannot effectively measure the applicability of use cases, resulting in an increase in the number of use cases and an increase in the screening complexity.
By constructing a directed topology graph and binary pipeline model based on business function points, a collection of candidate test cases is generated, and a test case with high applicability is filtered out using the degree weight function value and risk assessment model.
It reduces the complexity of test case screening, improves the applicability and rationality of test cases, and ensures the rationality of the recommendation process.
Smart Images

Figure CN116010233B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of IT applications, and in particular to a test case recommendation method and device, and a computer-readable storage medium. Background Art
[0002] With the increasing complexity of software product functionality and the shortening of iteration times under agile development, the need to test new features and regress legacy functionality has become increasingly important. During a complete testing process, numerous test cases are continuously generated. When the number of test cases reaches a certain level, it becomes particularly important to select representative test cases that fully cover established functional areas.
[0003] Currently, many recommended methods for use cases involve extracting requirements from project documents and then outputting test cases based on the descriptions of the requirements and using machine learning models. However, the degree of model training directly affects the output of the use cases, and the results obtained cannot measure the applicability of the generated test cases in the testing process. Moreover, in more complex scenarios, the number of required use cases will increase exponentially, resulting in an increase in the number of use cases and increasing the complexity of screening. Summary of the Invention
[0004] The embodiments of the present invention are intended to provide a test case recommendation method and apparatus, and a computer-readable storage medium, which can reduce the complexity of screening and improve the applicability of test cases during the test case recommendation process.
[0005] The technical solution of the present invention is achieved as follows:
[0006] An embodiment of the present invention provides a test case recommendation method, the method comprising:
[0007] Determine at least one piece of path information based on at least two business function point information corresponding to the test function;
[0008] Determining first execution parameter information of a test function point in each piece of path information in the at least one piece of path information, thereby constructing a binary pipeline model; wherein the test function point is part of the business function point;
[0009] Based on the binary pipeline model, each piece of path information is processed to generate a first candidate test case set corresponding to each piece of path information; wherein the first candidate test case set includes test cases and weight function values corresponding to the test cases;
[0010] Filtering the first set of candidate test cases by using the weight function values corresponding to the test cases to determine a second set of candidate test cases corresponding to each piece of path information;
[0011] Based on the second execution parameter information of the test function points in the second candidate test case set, a risk assessment is performed to determine the test cases to be recommended.
[0012] In the above solution, the determining of at least one piece of path information based on at least two business function point information corresponding to the test function includes:
[0013] Obtain information of at least two business function points corresponding to the test function;
[0014] Based on the information of the at least two service function points, a directed topology graph is constructed, thereby obtaining the at least one path information of the directed topology graph.
[0015] In the above solution, constructing a directed topology graph based on the information of the at least two service function points, thereby obtaining the at least one path information of the directed topology graph, includes:
[0016] Based on the information of the at least two business function points, constructing the directed topology graph through the execution order of their business processes;
[0017] Based on the directed topology graph, the at least one path information from the business process starting point to the business process end point is traversed and obtained.
[0018] In the above scheme, the first execution parameter information of the test function point includes: the situation of the positive use case, the situation of the negative use case, the probability value of the positive use case being executed, the probability value of the negative use case being executed and the proportion in the overall business process.
[0019] In the above solution, the processing of each piece of path information based on the binary pipeline model to generate a first candidate test case set corresponding to each piece of path information includes:
[0020] Executing the test function points in each path information using the binary pipeline model to generate N groups of test cases corresponding to each path information passing through N types of pipelines and a weight function value corresponding to each group of test cases; wherein the N types of pipelines correspond to N combinations of different execution directions; and N is a positive integer greater than or equal to 1;
[0021] The N groups of test cases and the weight function value corresponding to each group of test cases are determined as the first candidate test case set corresponding to each piece of path information.
[0022] In the above solution, the use of the binary pipeline model to execute the test function points in each path information to generate N groups of test cases corresponding to each path information passing through N types of pipelines and the weight function value corresponding to each group of test cases includes:
[0023] Using the N pipelines of the binary pipeline model, perform N combinations of normal execution and abnormal execution on different test function points in each path information, and determine at least one of a test case corresponding to a positive use case and a test case corresponding to a negative use case for each pipeline, thereby obtaining N groups of test cases corresponding to the N pipelines;
[0024] Determine the total function value of all test function points in each path information by using at least one of a probability value of a positive case occurrence and a probability value of a negative case occurrence for each test function point corresponding to each group of test cases in the binary pipeline model;
[0025] Based on the proportion of each test function point in the overall business process and the total function value of all test function points, the weighted function value corresponding to each test function point is determined, thereby determining the weighted function value corresponding to each group of test cases.
[0026] In the above solution, screening the first candidate test case set by using the weight function values corresponding to the test cases to determine the second candidate test case set corresponding to each piece of path information includes:
[0027] Sorting the weight function values corresponding to each group of test cases in the first candidate test case set to obtain a sorting result;
[0028] Based on the sorting result, the test cases corresponding to the largest M weight function values are determined as the second candidate test case set corresponding to each piece of path information, where M is a positive integer greater than or equal to 1.
[0029] In the above solution, the risk assessment is performed based on the second execution parameter information of the test function points in the second candidate test case set to determine the test cases to be recommended, including:
[0030] Based on second execution parameter information of the test function points in the second candidate test case set, obtaining risk assessment values of the test cases in the second candidate test case set using a risk assessment model; the second execution parameter information is parameter information corresponding to the test function points in the second candidate test case set in the first execution parameter information;
[0031] The risk assessment values are sorted, and the test cases corresponding to the largest Y risk assessment values are determined as the test cases to be recommended, where Y is a positive integer greater than or equal to 1.
[0032] In the above solution, obtaining the risk assessment value of the test case in the second candidate test case set based on the second execution parameter information of the test function point through the risk assessment model includes:
[0033] Based on the second execution parameter information of the test function point in the second candidate test case set, obtaining a first risk value, a second risk value, and a third risk value through the risk assessment model;
[0034] A risk assessment value of the test case is determined according to the first risk value, the second risk value, and the third risk value.
[0035] In the above solution, obtaining the first risk value, the second risk value, and the third risk value through the risk assessment model based on the second execution parameter information of the test function point in the second candidate test case set includes:
[0036] Determine a weight coefficient based on the weight of the test function point in the overall business process, the maximum weight of the test function point in the overall business process, and the minimum weight of the test function point in the overall business process;
[0037] Determining the first risk value based on the weight coefficient and the probability value of the execution of the negative use case of the test function point; wherein the test function point is a business function point that has not been executed in the business process;
[0038] Determining the second risk value based on the weight coefficient and the probability value of the execution of the positive use case of the test function point; wherein the test function point is a business function point executed in the business process;
[0039] The third risk value is determined based on the probability value of the execution of the positive use case of the test function point.
[0040] In the above solution, before obtaining information of at least two business function points corresponding to the test function, the method further includes:
[0041] Determine information on multiple candidate business function points based on the test function;
[0042] For the plurality of candidate business function point information, using a tool to automatically identify relevant information of each candidate business function point; wherein the candidate business function point information includes: function point description, input conditions, output results and expected results;
[0043] The relevant information of each of the to-be-selected service function points is screened to obtain the information of the at least two service function points.
[0044] In the above solution, after automatically identifying the relevant information of each of the plurality of to-be-selected service function points using a tool, the method further includes:
[0045] Receive a request to modify information of a selected business function point;
[0046] In response to the request to modify the information of the service function point to be selected, the information of the service function point to be selected is updated.
[0047] An embodiment of the present invention provides a test case recommendation device, which includes: a determination unit, a construction unit, and a generation unit;
[0048] The determining unit is configured to determine at least one piece of path information based on at least two pieces of business function point information corresponding to the test function;
[0049] The construction unit is configured to determine first execution parameter information of a test function point in each piece of path information in the at least one piece of path information, thereby constructing a binary pipeline model; wherein the test function point is part of the business function point;
[0050] The generating unit is configured to process each piece of path information based on the binary pipeline model to generate a first candidate test case set corresponding to each piece of path information; wherein the first candidate test case set includes test cases and weight function values corresponding to the test cases;
[0051] The determining unit is further configured to screen the first candidate test case set by using the weight function values corresponding to the test cases to determine a second candidate test case set corresponding to each piece of path information;
[0052] The determining unit is further configured to perform risk assessment based on the second execution parameter information of the test function points in the second candidate test case set to determine the test cases to be recommended.
[0053] An embodiment of the present invention provides a test case recommendation device, the test case recommendation device comprising:
[0054] A memory for storing executable data instructions;
[0055] A processor is used to execute the executable instructions stored in the memory. When the executable instructions are executed, the processor executes the test case recommendation method.
[0056] An embodiment of the present invention provides a computer-readable storage medium storing executable instructions. When the executable instructions are executed by one or more processors, the processors execute the test case recommendation method.
[0057] An embodiment of the present invention provides a test case recommendation method and device, and a computer-readable storage medium, which determines at least one path information based on at least two business function point information corresponding to a test function; determines the first execution parameter information of the test function point in each path information of the at least one path information, thereby constructing a binary pipeline model; wherein the test function point is part of the business function point; based on the binary pipeline model, processes each path information to generate a first candidate test case set corresponding to each path information; wherein the first candidate test case set includes test cases and weight function values corresponding to the test cases; the first candidate test case set is screened by the weight function values corresponding to the test cases to determine a second candidate test case set corresponding to each path information; and performs a risk assessment based on the second execution parameter information of the test function point in the second candidate test case set to determine the test case to be recommended. The above method is used to implement the solution. According to the business function point information, the execution order of the business process is used to determine the path information, so that the business function points are linked together, so that the generated test cases are representative; the test cases are screened according to the weight function value to reduce the complexity of screening, while also ensuring the applicability of the test cases; recommendations are made based on the obtained risk assessment value, rather than a random screening process in each test process, making the recommendation process more reasonable, reducing the complexity of screening, and ensuring the applicability of the test cases. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 An optional process diagram of the test case recommendation method provided in an embodiment of the present invention Figure 1 ;
[0059] Figure 2 An optional binary pipeline model diagram of the test case recommendation method provided by an embodiment of the present invention;
[0060] Figure 3 An optional process diagram of the test case recommendation method provided in an embodiment of the present invention Figure 2 ;
[0061] Figure 4 An optional process diagram of the test case recommendation method provided in an embodiment of the present invention Figure 3 ;
[0062] Figure 5 An optional directed topology diagram of the test case recommendation method provided by an embodiment of the present invention;
[0063] Figure 6 An optional process diagram of the test case recommendation method provided in an embodiment of the present invention Figure 4 ;
[0064] Figure 7 An optional process diagram of the test case recommendation method provided in an embodiment of the present invention Figure 5 ;
[0065] Figure 8 A schematic diagram of an optional binary pipeline model generating a test case for the test case recommendation method provided in an embodiment of the present invention;
[0066] Figure 9 An optional process diagram of the test case recommendation method provided in an embodiment of the present invention Figure 6 ;
[0067] Figure 10 An optional process diagram of the test case recommendation method provided in an embodiment of the present invention Figure 7 ;
[0068] Figure 11 An optional process diagram of the test case recommendation method provided in an embodiment of the present invention Figure 8 ;
[0069] Figure 12 An optional process diagram of the test case recommendation method provided in an embodiment of the present invention Figure 9 ;
[0070] Figure 13 An optional process diagram of the test case recommendation method provided in an embodiment of the present invention Figure 10 ;
[0071] Figure 14 An optional process diagram of the test case recommendation method provided in an embodiment of the present invention Figure 10 one;
[0072] Figure 15 A model diagram of an optional test case recommendation tool for the test case recommendation method provided in an embodiment of the present invention;
[0073] Figure 16 An optional risk assessment model flow chart of the test case recommendation method provided in an embodiment of the present invention;
[0074] Figure 17 Schematic diagram of the structure of the identity recognition device provided by the embodiment of the present invention Figure 1 ;
[0075] Figure 18 Schematic diagram of the structure of the identity recognition device provided by the embodiment of the present invention Figure 2 . DETAILED DESCRIPTION
[0076] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making any creative efforts shall fall within the scope of protection of the present invention.
[0077] A test case is a description of the testing tasks for a specific software product, typically including test inputs, execution conditions, and expected results. Test cases can be used to verify that a software product meets specific software requirements. As software product functionality continues to grow in complexity, testing new features has become increasingly important. During a complete testing process, numerous test cases are generated. Once the number of test cases reaches a certain level, it's crucial to select representative test cases that fully cover established functional areas.
[0078] Currently, most companies extract keywords and use them as test cases. However, the results obtained cannot measure the applicability of the generated test cases in the testing process.
[0079] In order to enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific implementation methods. Figure 1 This is an optional process diagram of a test case recommendation method provided by an embodiment of the present invention. Figure 1 , will combine Figure 1 The steps shown are explained.
[0080] S101: Determine at least one piece of path information based on at least two business function point information corresponding to a test function.
[0081] In some embodiments of the present invention, the test function is obtained according to the test requirements, and the business function point information is the key function points in the business process and the related information carried.
[0082] In some embodiments of the present invention, the terminal may obtain at least one piece of path information by testing information of at least two service function points corresponding to the function and utilizing the connection between the service function points.
[0083] S102: Determine first execution parameter information of a test function point in each piece of path information in at least one piece of path information, thereby constructing a binary pipeline model; wherein the test function point is part of the business function point.
[0084] In some embodiments of the present invention, the service function point in the path information determined by the service function point information is referred to as a test function point.
[0085] In some embodiments of the present invention, the first execution parameter information of the test function point includes: the situation of the positive use case, the situation of the negative use case, the probability value of the execution of the positive use case, the probability value of the execution of the negative use case and the proportion in the overall business process. There are N function points inside the binary pipeline model, and each function point can be executed normally or abnormally.
[0086] For example, during the login process, the positive use case is the use case and result of being able to log in normally after entering the username and password normally; the negative use case is the use case and result caused by incorrect username or password input, which is not limited in the embodiments of the present invention.
[0087] In some embodiments of the present invention, the terminal can construct a binary pipeline model through the positive use case situation, negative use case situation, probability value of the positive use case being executed, probability value of the negative use case being executed and the proportion in the overall business process of the test function point in each path information in at least one path information.
[0088] For example, Figure 2 It is an optional binary pipeline model for test case recommendation method. Figure 2 The function points in the _{\text{function point}} represent test function points. The binary pipeline model includes n function points: function point 1, function point 2, function point 3, function point 4, function point 5, ..., function point n. Each function point has two execution modes: normal execution and abnormal execution. FF represents normal execution of the test function point, and FR represents abnormal execution of the test function point.
[0089] S103 . Based on the binary pipeline model, process each path information to generate a first candidate test case set corresponding to each path information; wherein the first candidate test case set includes test cases and weight function values corresponding to the test cases.
[0090] In some embodiments of the present invention, each path information will have a corresponding first candidate test case set. The weight function value corresponding to the test case in the first candidate test case set is an indicator for measuring the applicability of the test case, which is used to evaluate the applicability of the test case.
[0091] In some embodiments of the present invention, the terminal can process each path information through a binary pipeline model to generate a test case under each path information and a weight function value corresponding to the test case. The test case under each path information and the weight function value corresponding to the test case constitute the first candidate test case set under each path information.
[0092] S104: Screen the first candidate test case set by using the weight function values corresponding to the test cases to determine the second candidate test case set corresponding to each piece of path information.
[0093] In some embodiments of the present invention, the first candidate test case set includes test cases and weight function values corresponding to the test cases, and the second candidate test case set is obtained by screening the first candidate test case set and retaining only the test cases in the first candidate test case set.
[0094] In some embodiments of the present invention, the terminal may screen the test cases in the first candidate test case set by the weight function values corresponding to the test cases, and form the selected test cases into a second candidate test case set corresponding to each path information.
[0095] S105: Perform risk assessment based on the second execution parameter information of the test function points in the second candidate test case set to determine test cases to be recommended.
[0096] In some embodiments of the present invention, the second execution parameter information of the test function point is parameter information in the first execution parameter information corresponding to the test function point in the second candidate test case set.
[0097] In some embodiments of the present invention, the terminal can perform risk assessment on the test cases in the second candidate test case set based on the second execution parameter information of the test function points in the second candidate test case set, and select test cases with higher risk assessment values as test cases to be recommended.
[0098] It is understandable that, in the embodiment of the present invention, the terminal determines the test case set through the path information of the test function point, which can improve the applicability of the test case during use; and greatly reduces the complexity of the screening through two screenings.
[0099] In some embodiments of the present invention, Figure 3 This is an optional process diagram of the test case recommendation method provided by the embodiment of the present invention. Figure 2 , step S101 can be implemented by step S1011 and step S1012, combining Figure 3 The steps shown are explained.
[0100] S1011. Obtain information of at least two business function points corresponding to the test function.
[0101] In some embodiments of the present invention, the terminal may use a test function to find a service function point in a service process, thereby obtaining information of at least two service function points.
[0102] S1012: Construct a directed topology graph based on information of at least two business function points, thereby obtaining at least one path information of the directed topology graph.
[0103] In some embodiments of the present invention, a topology map is a simplified and regularized representation of a symbolic entity, displaying quantitative information. The size of the map is generally unrelated to the area of the entity. Topology maps offer intuitive quantitative comparisons, are simple to draw, and are an effective form of quantitative map representation, conveying quantitative information graphically. A directed topology map is a graph in which business function points are connected by arrows.
[0104] In some embodiments of the present invention, the terminal may establish a directed topology graph based on the connections between the service function points through information of at least two service function points; and obtain at least one path information according to the direction of the established directed topology graph.
[0105] It can be understood that in some embodiments of the present invention, the terminal obtains information of at least two business function points corresponding to the test function, constructs a directed topology graph based on the information of at least two business function points, and thus obtains at least one path information of the directed topology graph, which can effectively establish connections between the business function points, thereby making the test case more representative.
[0106] In some embodiments of the present invention, Figure 4 This is an optional process diagram of the test case recommendation method provided by the embodiment of the present invention. Figure 3 , step S1012 can be implemented by S10121-S10122, combining Figure 4 The steps shown are explained.
[0107] S10121. Based on information of at least two business function points, construct a directed topology graph through their business process execution sequence.
[0108] In some embodiments of the present invention, the terminal may construct a directed topology graph according to the execution sequence of the service processes between the service function points through information of at least two service function points.
[0109] For example, Figure 5 It is a directed topology graph that is optionally constructed for a test case recommendation method. Figure 5 There are six business function points in the diagram. Business function point 1 is the starting point of the business process; business function points 2 and 3 are mandatory; business function points 4 and 5 are candidate business function points; and business function point 6 is the end point of the business process. Mandatory business function points are those that must be passed from the starting point to the end point of the business process; candidate business function points are those that do not affect the process from the starting point to the end point. Figure 5The direction of the arrow in the figure refers to the direction in which the business function point is executed in the business process.
[0110] S10122. Based on the directed topology graph, traverse to obtain at least one path information from the business process starting point to the business process end point.
[0111] In some embodiments of the present invention, the terminal may obtain all path information from the service process starting point to the service process end point through a directed topology graph.
[0112] For example, Figure 5 As shown in , the terminal can obtain three path information through the directed topology graph, namely, path 1: business function point 1-business function point 2-business function point 3-business function point 6; path 2: business function point 1-business function point 2-business function point 3-business function point 4-business function point 6; path 3: business function point 1-business function point 2-business function point 3-business function point 4-business function point 5-business function point 6.
[0113] It can be understood that in some embodiments of the present invention, the terminal can construct a directed topology graph through business function point information, and based on the directed topology graph, traverse to obtain all path information from the starting point of the business process to the end point of the business process. The path information can not only provide conditions for the generation of test cases.
[0114] In some embodiments of the present invention, Figure 6 This is an optional process diagram of the test case recommendation method provided by the embodiment of the present invention. Figure 4 ,Based on the binary pipeline model, each path information is processed to generate the first candidate test case set corresponding to each path information, which mainly includes the following steps:
[0115] S201. Execute the test function points in each path information using a binary pipeline model to generate N groups of test cases corresponding to each path information passing through N types of pipelines and a weight function value corresponding to each group of test cases; wherein the N types of pipelines correspond to N combinations of different execution directions; and N is a positive integer greater than or equal to 1.
[0116] In some embodiments of the present invention, the binary pipeline model includes test function points in the path information, each test function point has two execution modes, namely normal execution and abnormal execution. Each path information has its own corresponding binary pipeline model.
[0117] In some embodiments of the present invention, the terminal can execute the test function point in each path information through a binary pipeline model. After the execution is completed, N groups of test cases corresponding to each path information passing through N types of pipelines are generated according to the execution status of the test function point, and the weight function value corresponding to each group of test cases is calculated according to the first execution information of the test function point.
[0118] In some embodiments of the present invention, Figure 7 This is an optional process diagram of the test case recommendation method provided by the embodiment of the present invention. Figure 5 , step S201 can be implemented through S2011 to S2013, which will be explained in combination with each step.
[0119] S2011. Use the N pipelines of the binary pipeline model to perform N combinations of normal execution and abnormal execution on different test function points in each path information, determine the test case corresponding to each pipeline in the positive use case, and at least one of the test cases corresponding to the negative use case, thereby obtaining N groups of test cases corresponding to the N pipelines.
[0120] In some embodiments of the present invention, the terminal can perform N combinations of normal execution and abnormal execution of N test function points in the binary pipeline model corresponding to each path information, determine the positive use case and negative use case of each test function point, and thus obtain N groups of test cases under each path information.
[0121] It should be noted that the N pipelines of the binary pipeline model are equivalent to the execution status of N test function points.
[0122] For example, Figure 8 It is an optional binary pipeline model for generating test case diagrams of a test case recommendation method. Figure 8The function points in the middle represent test function points. The specific test case generation process is as follows: path information is input into the binary pipeline model. Based on the execution order of the function points in the path information, the binary pipeline model starts executing the function points one by one. If a function point executes normally, the output is Y; if a function point executes abnormally, the output is N. After all function points have executed, the output is the execution status of all function points, consisting of Y and N. The output execution status is the test case. For example, if all n function points execute normally, the output test case is: {Y1, Y2, Y3, Y4, Y5, ... Yn}; if function points 1 to function point n-1 execute normally, and function point n executes abnormally, the output test case is: {Y1, Y2, Y3, Y4, Y5, ... Nn}; if all n function points execute abnormally, the output test case is: {N1, N2, N3, N4, N5, ... Nn}. Furthermore, the binary pipeline model can calculate the corresponding weight function value of the test case based on the first execution information of the function points. For example, the weight function value of the test case {Y1, Y2, Y3, Y4, Y5, ... Yn} is Data1. The N groups of test cases generated by the binary pipeline and the weight function values corresponding to the N groups of test cases constitute a first candidate test case set. The test cases and the weight function values corresponding to the test cases together constitute an element in the first candidate test case set, for example, {{Y1, Y2, Y3, Y4, Y5, ... Yn}, Data1}, which is not limited in this embodiment of the present invention.
[0123] S2012. Determine the total function value of all test function points in each path information by using at least one of the probability values of the positive use cases and the probability values of the negative use cases for each test function point corresponding to each group of test cases in the binary pipeline model.
[0124] In some embodiments of the present invention, the terminal can calculate the total function value of all test function points in each path information by using at least one of the probability values of the positive use cases and the probability values of the negative use cases corresponding to each test function point in each group of test cases in the binary pipeline model.
[0125] S2013. Based on the proportion of each test function point in the overall business process and the total function value of all test function points, determine the weighted function value corresponding to each test function point, thereby determining the weighted function value corresponding to each group of test cases.
[0126] In some embodiments of the present invention, the terminal can calculate the weighted function value corresponding to each test function point by the proportion of each test function point in the overall business process and the total function value of all test function points, thereby calculating the weighted function value corresponding to each group of test cases.
[0127] For example, when calculating the weight function value corresponding to the test case, the weight function value corresponding to each test function point can be obtained by the following formula (1).
[0128]
[0129] Among them, D i Indicates the weight function value corresponding to the test function point in the test case; Da i Represents the probability value of the test function point being the execution of the positive use case; Ta i Represents the probability value of the test function point being executed by the positive use case; L i Represents the proportion of test function points in the overall business process.
[0130] For example, when calculating the weight function value corresponding to the test case, the weight function value corresponding to each group of test cases can be obtained by the following formula (2).
[0131]
[0132] Among them, Data i Denotes the weight function value of the test case; D i Indicates the weight function value corresponding to the test function point in the test case.
[0133] It can be understood that in some embodiments of the present invention, the terminal can obtain the test case corresponding to each path information and the weight function value corresponding to the test case through the binary pipeline model, provide test cases to be selected, and also provide indicators for screening test cases.
[0134] S202: Determine N groups of test cases and the weight function value corresponding to each group of test cases as a first candidate test case set corresponding to each piece of path information.
[0135] In some embodiments of the present invention, the terminal can use N groups of test cases and the weight function values corresponding to each group of test cases to take a test case and the weight function value corresponding to a test case as a set of data for the first candidate test case set, thereby obtaining the first candidate test case set corresponding to each path information.
[0136] It can be understood that in some embodiments of the present invention, the terminal obtains N groups of test cases under each path information and the weight function value corresponding to each group of test cases by utilizing a binary pipeline model. The test cases and the weight function value corresponding to each group of test cases are the first candidate test case set. In this way, many candidate test cases can be obtained, which is convenient for obtaining the test cases to be recommended later.
[0137] In some embodiments of the present invention, Figure 9This is an optional process diagram of the test case recommendation method provided by the embodiment of the present invention. Figure 6 ,like Figure 9 As shown, the first candidate test case set is screened by the weight function value corresponding to the test case to determine the second candidate test case set corresponding to each path information, which mainly includes the following steps:
[0138] S301 , sorting the weight function values corresponding to each group of test cases in the first candidate test case set to obtain a sorting result.
[0139] In some embodiments of the present invention, the terminal may obtain a ranking result of all test cases in the first candidate test case set by sorting the weight function values corresponding to each group of test cases in the first candidate test case set.
[0140] S302 : Based on the sorting result, determine the test cases corresponding to the largest M weight function values as the second candidate test case set corresponding to each path information, where M is a positive integer greater than or equal to 1.
[0141] In some embodiments of the present invention, the terminal may retain the test cases with larger weight function values according to the sorting results of all test cases in the first candidate test case set as the second candidate test case set corresponding to each path information.
[0142] It can be understood that in some embodiments of the present invention, the terminal can filter the first set of candidate test cases by the weight function value corresponding to the test case, determine the second set of candidate test cases corresponding to each path information, reduce the complexity of screening, and improve the applicability of the test case.
[0143] In some embodiments of the present invention, Figure 10 This is an optional process diagram of the test case recommendation method provided by the embodiment of the present invention. Figure 7 ,like Figure 10 As shown, based on the second execution parameter information of the test function points in the second candidate test case set, risk assessment is performed to determine the test cases to be recommended, which mainly includes the following steps:
[0144] S401. Based on the second execution parameter information of the test function point in the second candidate test case set, a risk assessment value of the test case in the second candidate test case set is obtained through a risk assessment model; the second execution parameter information is the parameter information in the first execution parameter information corresponding to the test function point in the second candidate test case set.
[0145] In some embodiments of the present invention, the terminal can calculate the risk assessment value of each test case in the second candidate test case set using the second execution parameter information of the test function point in the second candidate test case set and the risk assessment formula in the risk assessment model, thereby obtaining the risk assessment value of each test case in the second candidate test case set. The second execution parameter information is the parameter information corresponding to the test function point in the second candidate test case set in the first execution parameter information, including: the situation of the positive use case, the situation of the negative use case, the probability value of the positive use case being executed, the probability value of the negative use case being executed, and the proportion of the positive use case in the overall business process.
[0146] In some embodiments of the present invention, step S401 may be implemented by S4011 and S4012 as follows:
[0147] S4011. Based on the second execution parameter information of the test function point in the second candidate test case set, obtain a first risk value, a second risk value, and a third risk value through a risk assessment model.
[0148] In some embodiments of the present invention, a first risk value represents the probability of a business function point not being executed within a business process (a set of test cases within a candidate test case set). The complexity of a software system's topology determines its vulnerability; that is, the more complex the topology, the greater the probability of a software system error. A second risk value represents the vulnerability of executed business function points within a business process, with each function point representing the cumulative impact of a failure. A third risk value represents the likelihood that a result after executing a test case within a business process will not meet user expectations, deviating from expected requirements and specified functionality.
[0149] In some embodiments of the present invention, the terminal may input the second execution parameter information of the test function point of the test case in the second candidate test case set into the risk assessment model, and the risk assessment model obtains the first risk value, the second risk value and the third risk value through calculation.
[0150] S4012. Determine a risk assessment value of the test case based on the first risk value, the second risk value, and the third risk value.
[0151] In some embodiments of the present invention, the terminal may obtain a risk assessment value of the test case by summing the first risk value, the second risk value, and the third risk value of the test case.
[0152] It can be understood that in some embodiments of the present invention, the terminal can obtain the first risk value, the second risk value and the third risk value through the risk assessment model based on the second execution parameter information of the test function point in the second candidate test case set; determine the risk assessment value of the test case based on the first risk value, the second risk value and the third risk value, and the obtained risk assessment value can be used as a criterion for screening the applicability of the test case, reducing the complexity of screening, and effectively improving the applicability of the test case.
[0153] S402 , sorting the risk assessment values, and determining the test cases corresponding to the largest Y risk assessment values as the test cases to be recommended, where Y is a positive integer greater than or equal to 1.
[0154] In some embodiments of the present invention, the terminal may sort the risk assessment values and retain test cases with higher risk assessment values as test cases to be recommended.
[0155] It can be understood that in some embodiments of the present invention, the terminal can perform risk assessment through the second execution parameter information of the test function point in the second candidate test case set to determine the test cases to be recommended, further reduce the complexity of screening, and improve the applicability of the test cases.
[0156] In some embodiments of the present invention, Figure 11 This is an optional process diagram of the test case recommendation method provided by the embodiment of the present invention. Figure 8 , the calculation methods of the first risk value, the second risk value and the third risk value are as follows:
[0157] S501. Determine a proportion coefficient based on the proportion of the test function point in the overall business process, the maximum proportion of the test function point in the overall business process, and the minimum proportion of the test function point in the overall business process.
[0158] In some embodiments of the present invention, the terminal can calculate the proportion coefficient through the proportion of the test function point in the overall business process in the test case, the maximum proportion of the test function point in the overall business process and the minimum proportion of the test function point in the overall business process.
[0159] S502. Determine a first risk value based on a weight coefficient and a probability value of execution of a negative use case of the test function point; wherein the test function point is a business function point that has not been executed in the business process.
[0160] In some embodiments of the present invention, the terminal may calculate the first risk value by using the calculated weight coefficient and the probability value of the occurrence of the execution of the negative use case of the test function point.
[0161] For example, when performing risk assessment on a test case, the first risk value may be obtained by the following formula (3).
[0162]
[0163] Where G(x) represents the first risk value of the test case; M represents the set of untested function points in the business process; x represents a test case in the second candidate test case set; Ta j Represents the probability value of the test function point being executed by the negative use case; L j Represents the proportion of test function points in the overall business process; L min Represents the maximum proportion of the test function points in the overall business process; L max Represents the minimum proportion of test function points in the overall business process, S j Represents the weight coefficient of the test function point.
[0164] S503. Determine a second risk value based on the weight coefficient and the probability value of the execution of the positive use case of the test function point; wherein the test function point is a business function point executed in the business process.
[0165] In some embodiments of the present invention, the terminal may calculate the second risk value by using the calculated weight coefficient and the probability value of the occurrence of the execution of the test energy point positive use case.
[0166] For example, when performing risk assessment on a test case, the second risk value may be obtained by the following formula (4).
[0167]
[0168] Where C(x) represents the second risk value of the test case; K represents the set of test function points executed in the business process; x represents a test case in the second candidate test case set; Da i Represents the probability value of the test function point being executed by the positive use case; L i Represents the proportion of test function points in the overall business process; L min Represents the maximum proportion of the test function points in the overall business process; L max Represents the minimum proportion of test function points in the overall business process, S i Represents the weight coefficient of the test function point.
[0169] S504: Determine a third risk value based on the probability value of the execution of the positive use case of the test function point.
[0170] In some embodiments of the present invention, the terminal may calculate the third risk value by testing the probability value of the execution of the positive use case of the function point.
[0171] For example, when performing risk assessment on a test case, the third risk value may be obtained by the following formula (5).
[0172]
[0173] Among them, H(x) represents the third risk value of the test case; x represents a test case in the candidate case set; Da i The test function point represents the probability value of the positive use case being executed.
[0174] It can be understood that in some embodiments of the present invention, the terminal can obtain a risk value, a second risk value and a third risk value through calculation, which can provide a basis for subsequent calculation of the risk assessment value of the test case, facilitate subsequent test case screening, and reduce the complexity of screening.
[0175] In some embodiments of the present invention, Figure 12 This is an optional process diagram of the test case recommendation method provided by the embodiment of the present invention. Figure 9 , before step S1011, it also includes S1013-S1015. As follows:
[0176] S1013. Determine information of multiple candidate business function points based on the test function.
[0177] In some other embodiments of the present invention, the terminal can select multiple business function point information in the business process according to the requirements of the test function, and use the selected business function point information as the candidate business function point information. The business function point information includes information about the business function point itself and information between business function points.
[0178] S1014. For multiple candidate business function point information, use a tool to automatically identify relevant information of each candidate business function point; wherein the candidate business function point information includes: function point description, input conditions, output results and expected results.
[0179] In some embodiments of the present invention, the tool is a test case recommendation tool that automatically identifies information related to a business function point.
[0180] In some embodiments of the present invention, the terminal may use a tool to automatically identify relevant information of each to-be-selected service function point based on information of multiple to-be-selected service function points.
[0181] S1015: Screen the relevant information of each to-be-selected business function point to obtain information of at least two business function points.
[0182] In some embodiments of the present invention, the terminal may parse the relevant information of each candidate business function point, and the tester may manually screen the business function points, including operations such as merging and removing, to obtain at least two business function points and business function information.
[0183] It is understood that in some embodiments of the present invention, a terminal can use a test function to determine multiple pieces of information about candidate business function points; for each of the multiple pieces of information about candidate business function points, a tool can automatically identify relevant information about each candidate business function point; and the relevant information about each candidate business function point can be filtered to obtain information about at least two business function points. This process obtains information about at least two business function points, providing conditions for generating test cases while also ensuring the applicability of the test cases.
[0184] In some embodiments of the present invention, Figure 13 This is an optional process diagram of the test case recommendation method provided by the embodiment of the present invention. Figure 10 , after step S1014, it also includes S1016-S1017. As follows:
[0185] S1016: Receive a request to modify information of a selected business function point.
[0186] In some embodiments of the present invention, when the information of the service function point to be selected changes, the terminal receives a request to modify the information of the service function point to be selected.
[0187] S1017: In response to the request to modify the information of the service function point to be selected, update the information of the service function point to be selected.
[0188] In some embodiments of the present invention, the terminal may receive a request to modify the information of the selected business function point, and the tester may modify the information of the selected business function point and import the modified information into the tool to automatically update the business function point information.
[0189] It should be noted that, in some embodiments of the present invention, updating the information of the candidate service function point includes: updating information of one candidate service function point or updating information of multiple candidate service function points, which is not limited in the embodiments of the present invention.
[0190] It can be understood that in some embodiments of the present invention, the terminal can update the information of the selected business function point by receiving a request to modify the information of the selected business function point, which can timely avoid the generation of erroneous test cases due to erroneous business point function information, thereby improving the applicability of the test cases.
[0191] The following describes an exemplary application of an embodiment of the present invention in a practical application scenario.
[0192] An optional process diagram of a test case recommendation method provided by an embodiment of the present invention Figure 10 One, such as Figure 14 shown.
[0193] For example, taking a test case required for a test function as an example, the following steps are mainly included:
[0194] S601: Obtain information of at least two business function points corresponding to a test function.
[0195] In some embodiments of the present invention, the terminal preliminarily extracts a plurality of service function points to be selected through a test function, and summarizes information of each of the service function points to be selected.
[0196] In some embodiments of the present invention, the terminal imports the aggregated information of each candidate service function point into a test case recommendation tool to automatically identify relevant information of the candidate service function point.
[0197] For example, Figure 15 The present invention is a model diagram of a test case recommendation tool with an optional test case recommendation method. Figure 15 The orthogonalization-driven evaluation process includes input, orthogonalization-driven evaluation process, and output. The orthogonalization-driven evaluation process consists of a directed topology graph module, an orthogonalization screening module, and a risk assessment module. The directed topology graph module constructs a directed topology graph using business function point information; the orthogonalization screening module uses the degree weight function value to screen test cases; and the risk assessment module uses the risk assessment value to screen and recommend test cases.
[0198] In some embodiments of the present invention, the terminal screens the relevant information of each to-be-selected service function point to obtain information of at least two service function points.
[0199] S602: Construct a directed topology graph based on information of at least two business function points corresponding to the test function, thereby obtaining at least one piece of path information.
[0200] In some embodiments of the present invention, the terminal can construct a directed topology graph according to at least two business function point information and the business process execution sequence; according to the directed topology graph, traverse to obtain at least one path information from the business process starting point to the business process end point.
[0201] S603: Construct a binary pipeline model according to the first execution parameter information of the test function point in each piece of path information in the at least one piece of path information.
[0202] In some embodiments of the present invention, the first execution parameter information of the test function point n is: {Yn, Nn, (Dan, Tan), Ln}, where Yn represents the situation of the positive use case of the function point, Nn represents the situation of the negative use case of the function point, Dan represents the probability value of the positive use case being executed, Tan represents the probability value of the negative use case being executed, and Dan+Tan=1, Ln represents the proportion of this function point in the overall business process, where 0 <Ln≤100。
[0203] For example, Figure 2 It is an optional binary pipeline model for test case recommendation method. Figure 2 The function points in the _{\text{function point}} represent test function points. The binary pipeline model includes n function points: function point 1, function point 2, function point 3, function point 4, function point 5, and so on. Each function point has two execution modes: normal execution and abnormal execution. FF represents normal execution of the test function point, and FR represents abnormal execution of the test function point.
[0204] S604: Based on the binary pipeline model, process each piece of path information to generate a first candidate test case set corresponding to each piece of path information.
[0205] In some embodiments of the present invention, after processing each path information through a binary pipeline model, the terminal generates a first candidate test case set under each path information. The data model of this set is a set of test cases consisting of test scenarios that select positive or negative as the test function point after each test function point is executed. At the same time, a weight function is added to represent the weight scenario in which this combination occurs: {(set of test scenarios), weight function value}.
[0206] For example, Figure 8 It is an optional binary pipeline model for generating test case diagrams of a test case recommendation method. Figure 8The function points in the middle represent test function points. The specific test case generation process is as follows: path information is input into the binary pipeline model. Based on the execution order of the function points in the path information, the binary pipeline model starts executing the function points one by one. If a function point executes normally, the output is Y; if a function point executes abnormally, the output is N. After all function points have executed, the output is the execution status of all function points, consisting of Y and N. The output execution status is the test case. For example, if all n function points execute normally, the output test case is: {Y1, Y2, Y3, Y4, Y5, ... Yn}; if function points 1 to function point n-1 execute normally, and function point n executes abnormally, the output test case is: {Y1, Y2, Y3, Y4, Y5, ... Nn}; if all n function points execute abnormally, the output test case is: {N1, N2, N3, N4, N5, ... Nn}. Furthermore, the binary pipeline model can calculate the corresponding weight function value of the test case based on the first execution information of the function points. For example, the weight function value of the test case {Y1, Y2, Y3, Y4, Y5, ... Yn} is Data1. The test case and its corresponding weight function value together constitute an element in the first candidate test case set, for example, {{Y1, Y2, Y3, Y4, Y5, ... Yn}, Data1}, which is not limited in this embodiment of the present invention.
[0207] S605: Screen the first candidate test case set by using the weight function values corresponding to the test cases to determine the second candidate test case set corresponding to each piece of path information.
[0208] In some embodiments of the present invention, the terminal uses an improved orthogonalization driven algorithm to sort test cases using weight function values. The larger the weight function, the greater the attention of the test case. The test cases corresponding to the largest M weight function values are selected from the sorting results and determined as the second candidate test case set corresponding to each path information.
[0209] S606: Perform risk assessment based on the second execution parameter information of the test function points in the second candidate test case set to determine test cases to be recommended.
[0210] In some embodiments of the present invention, the terminal may use the risk assessment model to evaluate the second execution parameter information of the test function points in the second candidate test case set, obtain a hidden fault value, a use case vulnerability value, and a use case consequence value (equivalent to the first risk value, the second risk value, and the third risk value), sum the hidden fault value, the use case vulnerability value, and the use case consequence value to obtain a risk assessment value; sort the risk assessment values, select the test cases corresponding to the largest Y risk assessment values, and determine them as the test cases to be recommended. The second execution parameter information is the parameter information in the first execution parameter information corresponding to the test function points in the second candidate test case set.
[0211] For example, Figure 16 It is a risk assessment model flow chart with an optional test case recommendation method. Figure 16 In the process, the candidate test cases are input into the risk assessment model, and the hidden fault value, use case vulnerability value, and use case consequence value are calculated respectively to obtain the risk assessment value; according to the obtained risk assessment value, the test cases to be recommended are determined.
[0212] As you can understand, the terminal constructs a directed topology of business functions by analyzing them, extracting positive and negative test scenarios for each function. By building a custom binary pipeline model, it outputs a set of test candidates covering all functions. It also adds a weighting function to measure the importance of test cases, prioritizing higher-weighted functions when screening test cases. It also incorporates a risk model assessment process to evaluate the improved orthogonalization results, estimating test cases based on hidden faults, use case vulnerabilities, and use case consequences. This aggregated risk assessment results are used to recommend use cases with higher assessment values. This entire process enables the early detection of errors and defects with high risk indices, improving testing efficiency while also achieving automated test case recommendation.
[0213] Based on the test case recommendation method of the above embodiment, the embodiment of the present invention also provides a test case recommendation device, such as Figure 17 As shown, Figure 17 A schematic diagram of the structure of a test case recommendation device provided by an embodiment of the present invention Figure 1 The device includes: a determining unit 1701, a constructing unit 1702 and a generating unit 1703; wherein,
[0214] The determining unit 1701 is configured to determine at least one piece of path information based on at least two pieces of business function point information corresponding to the test function;
[0215] The construction unit 1702 is configured to determine first execution parameter information of a test function point in each piece of path information in the at least one piece of path information, thereby constructing a binary pipeline model; wherein the test function point is part of the business function point;
[0216] The generating unit 1703 is configured to process each piece of path information based on the binary pipeline model to generate a first candidate test case set corresponding to each piece of path information; wherein the first candidate test case set includes test cases and weight function values corresponding to the test cases;
[0217] The determining unit 1701 is further configured to screen the first candidate test case set by using the weight function values corresponding to the test cases to determine a second candidate test case set corresponding to each piece of path information;
[0218] The determining unit 1701 is further configured to perform risk assessment based on the second execution parameter information of the test function points in the second candidate test case set to determine the test cases to be recommended.
[0219] In some embodiments of the present invention, the test case recommendation device further includes an acquisition unit 1704; wherein,
[0220] The acquiring unit 1704 is configured to acquire information of the at least two business function points corresponding to the test function;
[0221] The acquiring unit 1704 is further configured to construct a directed topology graph based on the information of the at least two service function points, thereby obtaining the at least one path information of the directed topology graph.
[0222] In some embodiments of the present invention, the construction unit 1702 is further configured to construct the directed topology graph based on the information of the at least two business function points and in accordance with the execution order of their business processes;
[0223] The acquisition unit 1704 is further configured to traverse the directed topology graph to obtain the at least one path information from the business process start point to the business process end point.
[0224] In some embodiments of the present invention, the generating unit 1703 is further configured to execute the test function points in each piece of path information using the binary pipeline model, and generate N groups of test cases corresponding to each piece of path information passing through N types of pipelines and a weight function value corresponding to each group of test cases; wherein the N types of pipelines correspond to N combinations of different execution directions; and N is a positive integer greater than or equal to 1.
[0225] The determining unit 1701 is further configured to determine the N groups of test cases and the weight function value corresponding to each group of test cases as the first candidate test case set corresponding to each piece of path information.
[0226] In some embodiments of the present invention, the acquisition unit 1704 is further configured to perform N combinations of normal execution and abnormal execution on different test function points in each piece of path information using the N pipelines of the binary pipeline model, and determine at least one of a test case corresponding to a positive use case and a test case corresponding to a negative use case for each pipeline, thereby obtaining N groups of test cases corresponding to the N pipelines.
[0227] The determining unit 1701 is further configured to determine a total function value of all test function points in each path information by using at least one of a probability value of a positive case occurrence and a probability value of a negative case occurrence for each test function point corresponding to each group of test cases in the binary pipeline model;
[0228] The determination unit 1701 is also used to determine the weight function value corresponding to each test function point based on the proportion of each test function point in the overall business process and the total function value of all test function points, thereby determining the weight function value corresponding to each group of test cases.
[0229] In some embodiments of the present invention, the obtaining unit 1704 is further configured to sort the weight function values corresponding to each group of test cases in the first candidate test case set to obtain a sorting result;
[0230] The determining unit 1701 is further configured to determine, based on the sorting result, the test cases corresponding to the largest M weight function values as the second candidate test case set corresponding to each piece of path information, where M is a positive integer greater than or equal to 1.
[0231] In some embodiments of the present invention, the obtaining unit 1704 is further configured to obtain, based on the second execution parameter information of the test function points in the second candidate test case set, a risk assessment model and a risk assessment value of the test cases in the second candidate test case set;
[0232] The determining unit 1701 is further configured to sort the risk assessment values and determine the test cases corresponding to the largest Y risk assessment values as the test cases to be recommended, where Y is a positive integer greater than or equal to 1.
[0233] In some embodiments of the present invention, the obtaining unit 1704 is further configured to obtain a first risk value, a second risk value, and a third risk value through the risk assessment model based on the second execution parameter information of the test function point in the second candidate test case set;
[0234] The determining unit 1701 is further configured to determine a risk assessment value of the test case according to the first risk value, the second risk value, and the third risk value.
[0235] In some embodiments of the present invention, the determining unit 1701 is further configured to determine a weight coefficient based on the weight of the test function point in the overall business process, the maximum weight of the test function point in the overall business process, and the minimum weight of the test function point in the overall business process.
[0236] The determining unit 1701 is further configured to determine the first risk value based on the weight coefficient and a probability value of execution of a negative use case of the test function point; wherein the test function point is a business function point that has not been executed in the business process;
[0237] The determining unit 1701 is further configured to determine the second risk value based on the weight coefficient and the probability value of the occurrence of the execution of the positive use case of the test function point; wherein the test function point is a business function point executed in the business process;
[0238] The determining unit 1701 is further configured to determine the third risk value based on a probability value of the occurrence of an execution of the positive use case of the test function point.
[0239] In some embodiments of the present invention, the determining unit 1701 is further configured to determine information of a plurality of candidate service function points according to the test function;
[0240] In some embodiments of the present invention, the test case recommendation apparatus further includes an identification unit 1705, configured to automatically identify relevant information of each of the plurality of candidate business function point information using a tool, wherein the candidate business function point information includes: function point description, input conditions, output results, and expected results;
[0241] The acquiring unit 1704 is further configured to filter the relevant information of each to-be-selected business function point to obtain the information of at least two business function points.
[0242] In some embodiments of the present invention, the test case recommendation apparatus further includes a receiving unit 1706 and an updating unit 1707, wherein:
[0243] The receiving unit 1706 is configured to receive a request to modify information of a selected service function point;
[0244] The updating unit 1707 is configured to update the information of the service function point to be selected in response to the request to modify the information of the service function point to be selected.
[0245] Based on the test case recommendation method of the above embodiment, the embodiment of the present invention also provides a test case recommendation device, such as Figure 18 As shown, Figure 18A schematic diagram of the structure of a test case recommendation device provided by an embodiment of the present invention Figure 2 The device includes: a processor 1801 and a memory 1802; the memory 1801 stores one or more programs executable by the processor, and when one or more programs are executed, the processor 1802 executes any one of the test case recommendation methods in the above-mentioned embodiments.
[0246] Based on the test case recommendation method of the above embodiment, an embodiment of the present invention also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors. When the program is executed by the processor, the test case recommendation method of the embodiment of the present disclosure is implemented.
[0247] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) containing computer-usable program code.
[0248] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0249] These computer program instructions may 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, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0250] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0251] The above description is only a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention.
Claims
1. A test case recommendation method, characterized in that: The method comprises: Determine at least one piece of path information based on at least two business function point information corresponding to the test function; Determining first execution parameter information of a test function point in each piece of path information in the at least one piece of path information, thereby constructing a binary pipeline model; wherein the test function point is part of the business function point; Based on the binary pipeline model, each piece of path information is processed to generate a first candidate test case set corresponding to each piece of path information; wherein the first candidate test case set includes test cases and weight function values corresponding to the test cases; Filtering the first set of candidate test cases by using the weight function values corresponding to the test cases to determine a second set of candidate test cases corresponding to each piece of path information; performing a risk assessment based on the second execution parameter information of the test function points in the second candidate test case set to determine a test case to be recommended; The step of processing each piece of path information based on the binary pipeline model to generate a first candidate test case set corresponding to each piece of path information includes: Executing the test function points in each path information using the binary pipeline model to generate N groups of test cases corresponding to each path information passing through N types of pipelines and a weight function value corresponding to each group of test cases; wherein the N types of pipelines correspond to N combinations of different execution directions; and N is a positive integer greater than or equal to 1; Determine the N groups of test cases and the weight function value corresponding to each group of test cases as the first candidate test case set corresponding to each piece of path information; The method of executing the test function points in each piece of path information by using the binary pipeline model to generate N groups of test cases corresponding to each piece of path information passing through N types of pipelines and a weight function value corresponding to each group of test cases includes: Using the N pipelines of the binary pipeline model, perform N combinations of normal execution and abnormal execution on different test function points in each path information, and determine at least one of a test case corresponding to a positive use case and a test case corresponding to a negative use case for each pipeline, thereby obtaining N groups of test cases corresponding to the N pipelines; Determine the total function value of all test function points in each path information by using at least one of a probability value of a positive case occurrence and a probability value of a negative case occurrence for each test function point corresponding to each group of test cases in the binary pipeline model; Based on the proportion of each test function point in the overall business process and the total function value of all test function points, the weighted function value corresponding to each test function point is determined, thereby determining the weighted function value corresponding to each group of test cases.
2. The method according to claim 1, characterized in that The determining of at least one piece of path information based on at least two business function point information corresponding to the test function includes: Obtain information of at least two business function points corresponding to the test function; Based on the information of the at least two service function points, a directed topology graph is constructed, thereby obtaining the at least one path information of the directed topology graph.
3. The method according to claim 2, characterized in that The constructing a directed topology graph based on the at least two service function point information, thereby obtaining the at least one path information of the directed topology graph, includes: Based on the information of the at least two business function points, constructing the directed topology graph through the execution order of their business processes; Based on the directed topology graph, the at least one path information from the business process starting point to the business process end point is traversed and obtained.
4. The method according to claim 1, wherein The first execution parameter information of the test function point includes: the situation of the positive use case, the situation of the negative use case, the probability value of the positive use case being executed, the probability value of the negative use case being executed and the proportion in the overall business process.
5. The method according to claim 1, characterized in that The step of screening the first candidate test case set by using the weight function values corresponding to the test cases to determine the second candidate test case set corresponding to each piece of path information includes: Sorting the weight function values corresponding to each group of test cases in the first candidate test case set to obtain a sorting result; Based on the sorting result, the test cases corresponding to the largest M weight function values are determined as the second candidate test case set corresponding to each piece of path information, where M is a positive integer greater than or equal to 1.
6. The method according to claim 1, characterized in that The performing risk assessment based on the second execution parameter information of the test function points in the second candidate test case set to determine the test cases to be recommended includes: Based on second execution parameter information of the test function points in the second candidate test case set, obtaining risk assessment values of the test cases in the second candidate test case set using a risk assessment model; the second execution parameter information is parameter information corresponding to the test function points in the second candidate test case set in the first execution parameter information; The risk assessment values are sorted, and the test cases corresponding to the largest Y risk assessment values are determined as the test cases to be recommended, where Y is a positive integer greater than or equal to 1.
7. The method according to claim 6, characterized in that The step of obtaining risk assessment values of test cases in the second candidate test case set based on the second execution parameter information of the test function point through a risk assessment model includes: Based on the second execution parameter information of the test function point in the second candidate test case set, obtaining a first risk value, a second risk value, and a third risk value through the risk assessment model; A risk assessment value of the test case is determined according to the first risk value, the second risk value, and the third risk value.
8. The method according to claim 7, characterized in that The step of obtaining the first risk value, the second risk value, and the third risk value based on the second execution parameter information of the test function point in the second candidate test case set by using the risk assessment model includes: Determine a weight coefficient based on the weight of the test function point in the overall business process, the maximum weight of the test function point in the overall business process, and the minimum weight of the test function point in the overall business process; Determining the first risk value based on the weight coefficient and the probability value of the execution of the negative use case of the test function point; wherein the test function point is a business function point that has not been executed in the business process; Determining the second risk value based on the weight coefficient and the probability value of the execution of the positive use case of the test function point; wherein the test function point is a business function point executed in the business process; The third risk value is determined based on the probability value of the execution of the positive use case of the test function point.
9. The method according to claim 2, characterized in that Before obtaining information of at least two business function points corresponding to the test function, the method further includes: Determine information on multiple candidate business function points based on the test function; For the plurality of candidate business function point information, using a tool to automatically identify relevant information of each candidate business function point; wherein the candidate business function point information includes: function point description, input conditions, output results and expected results; The relevant information of each of the to-be-selected service function points is screened to obtain the information of the at least two service function points.
10. The method according to claim 9, characterized in that After automatically identifying relevant information of each of the plurality of candidate service function points using a tool, the method further includes: Receive a request to modify information of a selected business function point; In response to the request to modify the information of the service function point to be selected, the information of the service function point to be selected is updated.
11. A test case recommendation device, characterized in that: include: Determine the unit, construct the unit, generate the unit, and acquire the unit; The determining unit is configured to determine at least one piece of path information based on at least two pieces of business function point information corresponding to the test function; The construction unit is configured to determine first execution parameter information of a test function point in each piece of path information in the at least one piece of path information, thereby constructing a binary pipeline model; wherein the test function point is part of the business function point; The generating unit is configured to process each piece of path information based on the binary pipeline model to generate a first candidate test case set corresponding to each piece of path information; wherein the first candidate test case set includes test cases and weight function values corresponding to the test cases; The determining unit is further configured to screen the first candidate test case set by using the weight function values corresponding to the test cases to determine a second candidate test case set corresponding to each piece of path information; The determining unit is further configured to perform a risk assessment based on the second execution parameter information of the test function points in the second candidate test case set to determine the test cases to be recommended; The generating unit is further configured to execute the test function points in each piece of path information using the binary pipeline model, and generate N groups of test cases corresponding to each piece of path information passing through N types of pipelines and a weight function value corresponding to each group of test cases; wherein the N types of pipelines correspond to N combinations of different execution directions; and N is a positive integer greater than or equal to 1; The determining unit is further configured to determine the N groups of test cases and the weight function value corresponding to each group of test cases as the first candidate test case set corresponding to each piece of path information; The acquisition unit is configured to perform N combinations of normal execution and abnormal execution on different test function points in each piece of path information using the N pipelines of the binary pipeline model, and determine at least one of a test case corresponding to a positive use case and a test case corresponding to a negative use case for each pipeline, thereby obtaining N groups of test cases corresponding to the N pipelines; The determining unit is further configured to determine a total function value of all test function points in each path information by using at least one of a probability value of a positive case occurrence and a probability value of a negative case occurrence and execution for each test function point corresponding to each group of test cases in the binary pipeline model; The determination unit is also used to determine the weight function value corresponding to each test function point based on the proportion of each test function point in the overall business process and the total function value of all test function points, thereby determining the weight function value corresponding to each group of test cases.
12. A test case recommendation device, characterized in that: include: A memory for storing executable data instructions; A processor, configured to implement the method according to any one of claims 1 to 10 when executing the executable instructions stored in the memory.
13. A computer-readable storage medium, characterized in that Executable instructions are stored, which are used to cause a processor to execute the method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Test case set generation method and device, equipment and storage medium
CN113220599A
Test case screening method, equipment, storage medium and device
CN113312261A