Case selection method and device, electronic equipment and storage medium
The target use case set is determined through genetic algorithms, and the problem of relying on manual and lack of scientificity in process use case selection in the prior art is solved, and the use case set is high coverage and completeness.
Patent Information
- Application Number
- CN202411554115.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-03-11
AI Technical Summary
In the prior art, the selection of process use cases mainly relies on manual labor, and there are defects in relying on human quality, and it is prone to incomplete or omissions of use cases, which lacks scientificity.
Through a genetic algorithm-based method, the target use case set is determined using the marking information and execution time cost of the candidate use case set to ensure the coverage and completeness of the selected use case set.
It improves the coverage and completeness of the use case set, reduces the dependence on manual selection, and enhances the scientificity and automation of the selection process.
Smart Images

Figure CN119597641A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer applications, and in particular to a use case selection method, device, electronic device and storage medium. Background Art
[0002] As the iteration of application system versions is accelerating, in order to ensure the stable operation of system functions, testers usually select all or part of the process use cases from the maintained benchmark process use case set for testing after the content modification test of each iterative version is completed, to ensure the normal operation of the overall business process of the system after the modification.
[0003] In related technologies, process use cases are usually selected manually. However, there are two pain points in manual selection: first, the selection personnel are required to be familiar with the system and the content of the modification of the version under test, which is too dependent on human quality; second, manual selection may still result in incomplete and missing process use cases, which lacks scientificity. Summary of the invention
[0004] The present disclosure provides a use case selection method, device, electronic device and storage medium to solve the problems in the related technology, thereby achieving a reasonable selection of process use cases.
[0005] A first aspect embodiment of the present disclosure proposes a use case selection method, the method comprising: determining a first processing population based on labeling information of a first use case in a candidate use case set; determining a second processing population based on labeling information of a first individual in the first processing population, wherein the first individual is composed of a genetic code of the first use case; determining a first target individual, a second target individual, and an iterative target population based on a first execution time cost and labeling information of a second individual in the second processing population; determining a target use case set based on the first target individual, the second target individual, and the iterative target population.
[0006] In some embodiments of the present disclosure, determining the first processing population based on the marking information of the first use case in the candidate use case set includes: determining the genetic coding of the first use case based on the use case business tag and the iteration requirement tag in the marking information; generating a preprocessing population based on the genetic coding; determining the coverage evaluation index of the third individual based on the use case business tag and the iteration requirement tag of the third individual in the preprocessing population, the third individual being composed of the genetic coding of the first use case; and determining the first processing population from the preprocessing population based on the coverage evaluation index of the third individual.
[0007] In some embodiments of the present disclosure, determining the second processing population based on the marking information of the first individual in the first processing population includes: determining whether the use case business tag of the first individual covers the iteration requirement tag based on the use case business tag and the iteration requirement tag in the marking information; and eliminating the first individual whose use case business tag cannot cover the iteration requirement tag from the first processing population to obtain the second processing population.
[0008] In some embodiments of the present disclosure, determining the first target individual, the second target individual, and the iterative target population based on the first execution time cost and marking information of the second individual in the second processing population includes: determining the fitness parameter of the second individual based on the first execution time cost; determining the first target individual from the second individual based on the fitness parameter; and determining the second target individual and the iterative target population based on the second processing population using a genetic algorithm.
[0009] In some embodiments of the present disclosure, based on the second processing population, using a genetic algorithm, determining the second iterative individual and the iterative target population includes: determining the cumulative selection probability of the fourth individual in the second processing population based on the fitness parameter; determining the third processing population based on the cumulative selection probability; determining the fourth processing population based on the third processing population using preset crossover parameters and preset mutation parameters; iterating the fourth processing population based on the marking information of the fifth individual in the fourth processing population and the second execution time cost; when the number of iterations reaches a preset upper limit, and / or the iteration result meets a preset condition, stopping the iteration to obtain the second target individual and the iterative target population.
[0010] In some embodiments of the present disclosure, determining a target use case set based on a first target individual, a second target individual, and an iterative target population includes: determining importance parameters and historical problem parameters of the first target individual, the second target individual, and a third target individual in the iterative target population; determining fusion evaluation parameters of the first target individual, the second target individual, and the third target individual based on the importance parameters and the historical problem parameters; determining a fourth target individual from the first target individual, the second target individual, and the third target individual based on the fusion evaluation parameters; and performing genetic decoding on the fourth target individual to obtain a target use case set.
[0011] In some embodiments of the present disclosure, the method also includes: obtaining test requirement information of the scenario to be tested; based on the marking information and test requirement information of the target use case set, determining whether the target use case set can cover the test requirements of the scenario to be tested, so as to adjust the target use case set. The second aspect of the present disclosure proposes a use case selection device, which includes: a first determination unit, used to determine a first processing population based on the marking information of the first use case in the candidate use case set; a second determination unit, used to determine a second processing population based on the marking information of the first individual in the first processing population, wherein the first individual is composed of the genetic code of the first use case; a third determination unit, used to determine a first target individual, a second target individual, and an iterative target population based on the first execution time cost and marking information of the second individual in the second processing population; a fourth determination unit, used to determine a target use case set based on the first target individual, the second target individual, and the iterative target population.
[0012] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in the first aspect embodiment of the present disclosure.
[0013] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure.
[0014] In summary, according to a use case selection method proposed in the present disclosure, the method includes: determining a first processing population based on the labeling information of the first use case in the candidate use case set; determining a second processing population based on the labeling information of the first individual in the first processing population, wherein the first individual is composed of the genetic code of the first use case; determining a first target individual, a second target individual, and an iterative target population based on the first execution time cost and labeling information of the second individual in the second processing population; determining a target use case set based on the first target individual, the second target individual, and the iterative target population. The method disclosed in the present disclosure determines the first target individual and the second target individual, thereby avoiding the loss of excellent individuals in the iteration process, and then determines the target use case set through the first target individual, the second target individual, and the iterative target population, thereby improving the coverage and completeness of the target use case set.
[0015] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0017] Figure 1 An example diagram of a genetic algorithm provided by an embodiment of the present disclosure;
[0018] Figure 2 A flowchart of a use case selection method provided in an embodiment of the present disclosure;
[0019] Figure 3 A flowchart of another use case selection method provided in an embodiment of the present disclosure;
[0020] Figure 4 A flowchart of another use case selection method provided in an embodiment of the present disclosure;
[0021] Figure 5 A flowchart of another use case selection method provided in an embodiment of the present disclosure;
[0022] Figure 6 An example diagram of cumulative probability determination provided by an embodiment of the present disclosure;
[0023] Figure 7 An example diagram of a crossover operation provided by an embodiment of the present disclosure;
[0024] Figure 8 An example diagram of a variation operation provided by an embodiment of the present disclosure;
[0025] Fig. 9 A flowchart of another use case selection method provided in an embodiment of the present disclosure;
[0026] Fig.10 A flowchart of another use case selection method provided in an embodiment of the present disclosure;
[0027] Fig.11 A schematic diagram of the structure of a use case selection device provided in an embodiment of the present disclosure;
[0028] Fig.12 A schematic diagram of the structure of a communication device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0029] Embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0030] As the iteration of application system versions is accelerating, in order to ensure the stable operation of system functions, testers usually select all or part of the process use cases from the maintained benchmark process use case set for testing after the content modification test of each iterative version is completed, to ensure the normal operation of the overall business process of the system after the modification.
[0031] In related technologies, process use cases are usually selected manually. However, there are two pain points in manual selection: first, the selection personnel are required to be familiar with the system and the content of the modification of the version under test, which is too dependent on human quality; second, manual selection may still result in incomplete and missing process use cases, which lacks scientificity.
[0032] Before introducing the detailed scheme of the present disclosure, the genetic algorithm involved in the scheme of the present disclosure is first introduced. Figure 1 As shown:
[0033] Genetic algorithm is a heuristic search algorithm based on the principle of natural selection and natural genetic mechanism. The algorithm simulates the natural mechanism of biological genetic evolution in nature (selection, crossover and mutation operations), continuously passes on good genetic genes (optimal goals) to offspring, thereby increasing the probability of offspring producing the optimal solution.
[0034] The implementation steps are as follows:
[0035] 1. Determine the feasible solution domain and encoding method according to the specific problem, and represent each feasible solution in the feasible solution domain in the form of a numerical string or a character string.
[0036] 2. Construct a fitness function to measure each feasible solution, where the fitness function is a non-negative function.
[0037] 3. Determine the genetic population by setting the population size, selection, crossover and mutation methods, as well as the probability of crossover and mutation, and determine whether the genetic population meets the requirements by setting the judgment termination condition, where the judgment termination condition can be a certain threshold or a specified number of generations of evolution.
[0038] The present disclosure is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0039] Figure 2 A flowchart of a use case selection method provided by an embodiment of the present disclosure. Figure 2 As shown, steps 201-204 are included.
[0040] Step 201: determine a first processing population based on label information of a first use case in a candidate use case set.
[0041] In some embodiments, the first use case may be any candidate use case in the candidate use case set.
[0042] In some embodiments, the marking information of the first use case may include a use case business tag and an iteration requirement tag, wherein the use case business tag is used to indicate the use case business that can be tested for each first use case, and the iteration requirement tag is used to indicate the use case business involved in each round of iteration when obtaining the target use case set.
[0043] In some optional embodiments, the first use case may be genetically encoded in a "0-1" encoding manner, and then multiple pre-processed populations may be generated based on the genetic encoding of the first use case, and then the first processing population may be determined from the multiple pre-processed populations based on the coverage evaluation index of the third individual in the multiple pre-processed populations. For details, please refer to Figure 2 The embodiments shown will not be described in detail here.
[0044] It should be understood that the first processing population, that is, the population composed of the first use cases, may not undergo the above-mentioned preprocessing, but directly select the first use cases from the candidate use case set based on the marking information of the first use cases, and genetically encode the selected first use cases to obtain the first processing population.
[0045] Step 202, determining a second processing population based on the label information of the first individual in the first processing population.
[0046] In some embodiments, the first individual is a character string formed by the genetic code of the first use case. In other words, the first individual can be used to indicate multiple first use cases.
[0047] In some embodiments, based on the use case business tag and iteration requirement tag in the tag information, it can be determined whether the use case business tag of the first individual covers the iteration requirement tag; then the first individual whose use case business tag cannot cover the iteration requirement tag is eliminated from the first processing population to obtain the second processing population.
[0048] In other words, based on the use case business tag and iteration requirement tag in the tag information, it can be determined whether the first individual in the first processing population can meet the requirements of this iteration. If there is a first individual that cannot meet the iteration requirements, the first individual is removed from the first processing population, so that the first processing population after removal is determined as the second processing population.
[0049] Step 203: Determine a first target individual, a second target individual, and an iterative target population based on the first execution time cost and the marking information of the second individual in the second processing population.
[0050] In some embodiments, the second individual can be any individual in the second treatment population. In particular, the second individual in the second treatment population can be the same as the first individual in the first treatment population.
[0051] In some embodiments, the first execution time cost is used to indicate the time required to execute all use cases of a second individual. Specifically, the longer the time spent, the greater the first execution time cost.
[0052] In some embodiments, a first target individual may be determined from the second individuals based on the first execution time cost, wherein the first target individual is the individual with the smallest first execution time cost among the second individuals.
[0053] In other words, the first target individual is the best individual among the second individuals.
[0054] In some embodiments, a preset genetic algorithm can be used to iteratively process the second processing population to obtain multiple second target individuals and iterative target populations, where the second target individual is the individual with the smallest execution time cost in the population in each round of iteration, and the target iterative population is the population obtained when the iteration is stopped.
[0055] Step 204: determine a target use case set based on the first target individual, the second target individual, and the iterative target population.
[0056] In some embodiments, the importance parameters and historical problem parameters of the first target individual, the second target individual, and the third target individual in the iterative target population can be determined; and then the fusion evaluation parameters of the first target individual, the second target individual, and the iterative target population can be determined, so as to determine the target use case set from the first target individual, the second target individual, and the iterative target population based on the fusion evaluation parameters.
[0057] For details, please refer to Figure 3 The embodiments shown will not be described in detail here.
[0058] In summary, according to the use case selection method proposed in the present disclosure, the method includes: obtaining first data and second data; preprocessing the first data and second data to obtain a first sample set and a second sample set; based on the first sample set and the second sample set, using a clustering algorithm to generate a first cluster and a second cluster; based on the first cluster and the second cluster, using an overlap algorithm to determine whether a 4G base station and a 5G base station are co-located. This method can determine whether a 4G base station and a 5G base station are co-located by obtaining the first data and the second data without measuring the longitude and latitude of the base station, and has a wide range of applications; by preprocessing the first data and the second data, the amount of data used for the solution is reduced, and the error caused by abnormal data is reduced; by using an overlap algorithm to determine whether a 4G base station and a 5G base station are co-located, the scope of application of the solution and the accuracy of the use case selection results are improved.
[0059] Figure 3 A flowchart of a use case selection method proposed in the present disclosure is further shown. Figure 2The embodiment shown further explains step 201. Figure 3 The following steps are included.
[0060] Step 301: Determine the genetic code of the first use case based on the use case business tag and the iteration requirement tag in the tag information.
[0061] In some embodiments, whether the first use case meets the requirements of this iteration can be determined based on the use case business tag and the iteration requirement tag, and then the genetic encoding of the first use case can be determined based on whether the first use case meets the requirements of this iteration.
[0062] For example, when the first use case meets the requirements of this iteration, the gene code of the first use case can be determined to be "1", and when the first use case does not meet the requirements of this iteration, the gene code of the first use case can be determined to be "0".
[0063] Step 302, generating a preprocessed population based on the gene encoding.
[0064] In some embodiments, a plurality of third individuals are generated based on the genetic coding of the first use case, and a preprocessed population is generated from the plurality of third individuals.
[0065] For example, taking the example that the genetic codes of every ten first use cases constitute a third individual, the third individual is, for example: 1100100111, wherein 1 represents that the first use case needs to be executed, and 0 represents that the first use case does not need to be executed.
[0066] For example, taking the case where the first use case in the candidate use case set can generate 1000 third individuals with a length of 10, 10 preprocessing populations can be randomly generated based on these 1000 third individuals, where each preprocessing population contains 100 third individuals.
[0067] Step 303: Determine the coverage evaluation index of the third individual based on the use case business label and iteration requirement label of the third individual in the preprocessed population.
[0068] In some embodiments, since randomly generating an initial population may result in a slow search speed, it is necessary to determine the coverage evaluation index of the third individual in each pre-processed population, so as to select a pre-processed population with better coverage properties as the first processed population.
[0069] In some embodiments, the coverage evaluation index of the third individual may be determined by the following formula:
[0070]
[0071] Among them, Ci represents the use case business label of the i-th third individual in the preprocessing population, V represents the iteration requirement label of the i-th third individual in the preprocessing population, and CF represents the coverage evaluation index of the i-th third individual in the preprocessing population.
[0072] Step 304, based on the coverage evaluation index of the third individual, determine the first processing population from the pre-processing population.
[0073] In some embodiments, the first processed population may be determined from the pre-processed population according to a preset indicator.
[0074] For example, the pre-processed population with the largest number of third individuals whose coverage evaluation index is greater than 0.5 can be selected as the first processing population, which makes the selected first processing population have better coverage properties, thereby improving the use case search speed.
[0075] In summary, the use case selection method proposed in the present disclosure includes: determining the genetic code of the first use case based on the use case business tag and the iteration requirement tag in the tag information; generating a preprocessing population based on the genetic code; determining the coverage evaluation index of the third individual based on the use case business tag and the iteration requirement tag of the third individual in the preprocessing population, the third individual being composed of the genetic code of the first use case; and determining the first processing population from the preprocessing population based on the coverage evaluation index of the third individual. The method of the present disclosure can improve the speed of determining the target use case set by determining the coverage evaluation index of the third individual, thereby selecting the preprocessing population with better coverage of the third individual as the first processing population.
[0076] Figure 4 A flowchart of a use case selection method proposed in the present disclosure is further shown. Figure 2 The embodiment shown further explains step 203. Figure 4 The following steps are included.
[0077] Step 401, determining a fitness parameter of a second individual based on a first execution time cost.
[0078] In some embodiments, the fitness parameter of the second individual may be determined by the following formula:
[0079]
[0080] Among them, xij represents the jth first case in the i-th second body in the second processing population, represents the first execution time cost corresponding to the second individual of the ith order, F(x i ) represents the fitness parameter of the i-th second individual.
[0081] Step 402: Determine a first target individual from the second individual based on the fitness parameter.
[0082] In some embodiments, the individual in the second individual that can cover the iteration requirements and has the shortest execution time can be determined as the first target individual based on the fitness parameter.
[0083] Specifically, the individual with the highest fitness parameter in the second individual can be determined as the first target individual to avoid the loss of excellent individuals during the iteration process, thereby causing the selected target use case set to be not the optimal use case set.
[0084] Step 403: Based on the second processing population, a second target individual and an iterative target population are determined using a genetic algorithm.
[0085] In some embodiments, a genetic algorithm may be used to iteratively process the second processing population to determine a second target individual and an iterative target population.
[0086] Among them, the second target individual is the individual with the largest fitness parameter in the population in each round of iteration, and the iterative target population is the population obtained when the iteration is stopped.
[0087] In an optional embodiment, the cumulative selection probability of the fourth individual in the second processing population can be determined based on the fitness parameter; the third processing population can be determined based on the cumulative selection probability; the fourth processing population can be determined based on the third processing population using preset crossover parameters and preset mutation parameters; the fourth processing population is iterated based on the marking information of the fifth individual in the fourth processing population and the second execution time cost; when the number of iterations reaches a preset upper limit and / or the iteration result meets a preset condition, the iteration is stopped to obtain the second target individual and the iterative target population.
[0088] In summary, the use case selection method proposed in the present disclosure includes: determining the fitness parameter of the second individual based on the first execution time cost; determining the first target individual from the second individual based on the fitness parameter; and determining the second target individual and the iterative target population based on the second processing population using a genetic algorithm. The method disclosed in the present disclosure determines the first target individual and the second target individual by determining the fitness parameter, thereby avoiding the loss of individuals with better coverage and lower execution time cost during the iteration process.
[0089] Figure 5 A flowchart of a use case selection method proposed in the present disclosure is further shown. Figure 4 The embodiment shown further explains step 403. Figure 5 The following steps are included.
[0090] Step 501, based on the fitness parameter, determine the cumulative selection probability of the fourth individual in the second processing population.
[0091] In some embodiments, the individual selection probability of the fourth individual may be determined first by fitness, and then the cumulative selection probability of the fourth individual may be determined according to the individual selection probability, wherein the fourth individual is any individual in the second processing population.
[0092] In some embodiments, the individual selection probability can be determined by the following parameters:
[0093]
[0094] Among them, P(x i ) represents the individual selection probability of the fourth individual of the ith i ) represents the fitness parameter of the i-th fourth individual.
[0095] Furthermore, the above cumulative selection probability can be determined by the following formula:
[0096]
[0097] Among them, represents the cumulative selection probability of the i-th fourth individual.
[0098] Example diagram, such as Figure 6 As shown, if there are 4 fourth individuals in the population, and the probability of each individual being selected to enter the next generation is 0.15, 0.45, 0.25, and 0.15 respectively, then the cumulative probability of the 4 fourth individuals is 0.15, 0.6, 0.85, and 1 respectively.
[0099] Step 502: Determine a third processing population based on the cumulative selection probability.
[0100] In some embodiments, a roulette mechanism may be used to select the fourth individual according to the cumulative selection probability, and the population formed by the selected fourth individual is determined as the third processing population.
[0101] Specifically, when performing the selection operation, a random number r is generated between [0,1], and the fourth individual in the cumulative probability interval where r is located is selected. It can be seen that the fourth individual with a larger fitness parameter value has a greater probability of being selected, thereby ensuring that more excellent individuals are selected for iteration as much as possible.
[0102] Step 503: Based on the third processing population, a fourth processing population is determined using a preset crossover parameter and a preset mutation parameter.
[0103] In some embodiments, the fourth processed population is the third processed population after crossover and mutation operations.
[0104] In some embodiments, the crossover operation refers to exchanging some genes of two paired individuals in a certain manner, thereby forming two new individuals.
[0105] The preset crossover parameters may include: a preset crossover position parameter and a crossover probability parameter of the fourth individual.
[0106] Taking the preset crossover position as the first 7 positions of the fourth individual and the crossover probability as 0.6 as an example, the crossover process is as follows Figure 7 shown.
[0107] Furthermore, if the probability is too large, it is easy to destroy the existing favorable model, increase randomness, and easily miss the best individual; if the probability is too small, the population cannot be updated effectively. Therefore, the crossover probability is preferably between 0.6 and 0.9.
[0108] In some embodiments, the mutation operation refers to replacing the gene values at certain loci in the individual coding string with other alleles at the loci to form a new individual.
[0109] The preset mutation parameters may include: preset mutation position parameters and mutation probability parameters of the fourth individual.
[0110] For example, a mutation process such as Figure 8 shown.
[0111] Furthermore, if the probability of mutation is too small, the diversity of the population will decrease too quickly, which may lead to the rapid loss of effective genes and make them difficult to repair; if the probability of mutation is too large, although the diversity of the population can be guaranteed, the probability of excellence being destroyed will also increase. Therefore, the probability of mutation is preferably between 0.01-0.05.
[0112] Step 504 , iterating the fourth processing population based on the label information of the fifth individual in the fourth processing population and the second execution time cost.
[0113] In some embodiments, the fifth individual can be any individual in the fourth treatment population.
[0114] In some embodiments, since the iteration requirements in different rounds may be different, the fifth individual in the fourth processing population that cannot meet the iteration requirements may be removed from the fourth processing population according to the tag information of the fifth individual;
[0115] Then, according to the second execution time cost of the fifth individual in the fourth processing population after being eliminated, the second target individual is determined. For details, please refer to step 401 and step 402, which will not be repeated here.
[0116] Furthermore, selection, crossover and mutation are performed on the fourth processing population after the second target individual is determined, so as to implement iteration of the fourth processing population. For details, please refer to step 501 to step 503, which will not be described again.
[0117] Step 505: When the number of iterations reaches a preset upper limit and / or the iteration result satisfies a preset condition, the iteration is stopped to obtain a second target individual and an iteration target population.
[0118] In some embodiments, the preset condition is, for example, that the fitness value of the population does not change for L consecutive generations, wherein the value of L is, for example, 50, 60, etc., which is not limited in the present disclosure.
[0119] In summary, the use case selection method proposed in the present disclosure includes: determining the cumulative selection probability of the fourth individual in the second processing population based on the fitness parameter; determining the third processing population based on the cumulative selection probability; determining the fourth processing population based on the third processing population using preset crossover parameters and preset mutation parameters; iterating the fourth processing population based on the tag information of the fifth individual in the fourth processing population and the second execution time cost; when the number of iterations reaches a preset upper limit, and / or the iteration result meets a preset condition, stopping the iteration to obtain the second target individual and the iterative target population. The method disclosed in the present disclosure implements iteration of the second processing population by selecting, crossovering, and mutating the second processing population, so as to obtain excellent individuals in each round of iteration and the target population when the iteration stops.
[0120] Fig. 9 A flowchart of a use case selection method proposed in the present disclosure is further shown. Figure 2 The illustrated embodiment further explains step 204, and the method further includes the following steps.
[0121] Step 901, determining the importance parameters and historical problem parameters of the first target individual, the second target individual, and the third target individual in the iterative target population.
[0122] In some embodiments, the importance parameters may be determined according to the importance of the functions corresponding to the first target individual, the second target individual, and the third target individual.
[0123] In some embodiments, historical problem parameters of the first target individual, the second target individual, and the third target individual may be determined based on the number of problems found in historical tests, etc.
[0124] In some embodiments, the importance parameter may be determined by the following formula:
[0125]
[0126] Among them, M represents the priority of the function corresponding to the individual in the system, C j Represents the jth use case in an individual.
[0127] In some embodiments, W(xi) is the historical problem score. Each test case is scored according to the number of problems found. 0 problems are scored as 0 points, 1-5 problems are scored as 3 points, 5-10 problems are scored as 7 points, and more than 10 problems are scored as 10 points. The historical problem parameter can be determined by the following formula:
[0128]
[0129] Among them, B represents the number of problems found.
[0130] Step 902: Determine fusion evaluation parameters of the first target individual, the second target individual, and the third target individual based on the importance parameter and the historical problem parameter.
[0131] In some embodiments, the fusion evaluation parameter may be determined by weighted summing the importance parameter and the historical problem parameter, but is not limited thereto. The fusion evaluation parameter may also be determined by combining the importance parameter and the historical problem parameter with the fitness parameter, as follows:
[0132] NF(x i )=F(x i )×40%+EF(x i )×60%
[0133] EF(x i )=P(x i )+W(x i )
[0134] Among them, F(x i ) represents the fitness parameter of the individual, NF(x i ) represents the fusion evaluation parameter.
[0135] Step 903: Determine a fourth target individual from the first target individual, the second target individual, and the third target individual based on the fusion evaluation parameter.
[0136] In one embodiment, the individual with the highest fusion evaluation parameter value among the first target individual, the second target individual, and the third target individual may be determined as the fourth target individual.
[0137] Step 904, performing genetic decoding on the fourth target individual to obtain a target use case set.
[0138] For example, taking the fourth target individual as 11001001111010101010 as an example, it means that the 11 process use cases No. 1, 2, 5, 8, 9, 10, 11, 13, 15, 17, and 19 are the selected target use cases.
[0139] In summary, the use case selection method proposed in the present disclosure includes: determining the importance parameters and historical problem parameters of the first target individual, the second target individual, and the third target individual in the iterative target population; determining the fusion evaluation parameters of the first target individual, the second target individual, and the third target individual based on the importance parameters and historical problem parameters; determining the fourth target individual from the first target individual, the second target individual, and the third target individual based on the fusion evaluation parameters; and performing genetic decoding on the fourth target individual to obtain the target use case set. The method disclosed in the present disclosure determines the fusion evaluation parameters by utilizing the importance parameters and historical problem parameters of the first target individual, the second target individual, and the third target individual in the iterative target population, thereby evaluating the first target individual, the second target individual, and the third target individual from a certain perspective, thereby further improving the rationality of obtaining the target use case set.
[0140] Fig.10 A flowchart of a use case selection method proposed in the present disclosure is further shown. Figure 2 The embodiment shown may further include the following steps after step 204 .
[0141] Step 1001, obtaining test requirement information of the scenario to be tested.
[0142] In some embodiments, after the target use case set is determined, the target use case set may also be verified by obtaining test requirement information of a scenario to be tested for testing the target use case set.
[0143] Step 1002: Based on the marking information and test requirement information of the target use case set, determine whether the target use case set can cover the test requirements of the scenario to be tested, so as to adjust the target use case set.
[0144] In one embodiment, the use case business tag of the tag information of the target use case set can be compared with the test requirement information to determine whether the target use case set can cover the test requirements of the scenario to be tested. When the target use case set cannot cover the test requirements of the scenario to be tested, the target use case set is supplemented based on the uncovered requirements.
[0145] In summary, the use case selection method proposed in the present disclosure includes: obtaining the test requirement information of the scenario to be tested; based on the marking information and the test requirement information of the target use case set, determining whether the target use case set can cover the test requirements of the scenario to be tested, so as to adjust the target use case set. The method disclosed in the present disclosure compares the marking information with the test requirement information to determine whether the target use case set can cover the test requirements of the scenario to be tested, and then adjusts the target use case set, thereby further improving the rationality of selecting the target use case set.
[0146] Therefore, this solution has the following beneficial effects:
[0147] 1. The method disclosed in the present invention can improve the speed of determining the target use case set by determining the coverage evaluation index of the third individual and selecting the pre-processing population with better coverage of the third individual as the first processing population.
[0148] 2. The method disclosed in the present invention determines the first target individual and the second target individual by determining the fitness parameter, thereby avoiding the loss of individuals with better coverage and lower execution time cost during the iteration process.
[0149] 3. The method disclosed in the present invention avoids the loss of excellent individuals during the iteration process by determining the first target individual and the second target individual, and then determines the target use case set through the first target individual, the second target individual and the iterative target population, thereby improving the coverage and completeness of the target use case set.
[0150] 4. The method disclosed in the present invention determines the fusion evaluation parameters by utilizing the importance parameters and historical problem parameters of the first target individual, the second target individual and the third target individual in the iterative target population, thereby evaluating the first target individual, the second target individual and the third target individual from different perspectives, thereby further improving the rationality of obtaining the target use case set.
[0151] Fig.11 FIG. 1 is a schematic diagram of a structure of a use case selection device 1100 provided in an embodiment of the present disclosure. Fig.11 As shown, the use case selection device includes:
[0152] A first determining unit 1110, configured to determine a first processing population based on label information of a first use case in a candidate use case set;
[0153] A second determining unit 1120 is used to determine a second processing population based on the label information of a first individual in the first processing population, wherein the first individual is composed of a genetic code of the first use case;
[0154] The third determining unit 1130 determines the first target individual, the second target individual, and the iterative target population based on the first execution time cost and the marking information of the second individual in the second processing population;
[0155] The fourth determining unit 1140 is configured to determine a target use case set based on the first target individual, the second target individual, and the iterative target population.
[0156] In some embodiments of the present disclosure, the first determination unit 1110 is further used to determine the genetic coding of the first use case based on the use case business tag and the iteration requirement tag in the tag information; generate a preprocessing population based on the genetic coding; determine the coverage evaluation index of the third individual based on the use case business tag and the iteration requirement tag of the third individual in the preprocessing population, the third individual being composed of the genetic coding of the first use case; and determine the first processing population from the preprocessing population based on the coverage evaluation index of the third individual.
[0157] In some embodiments of the present disclosure, the second determination unit 1120 further determines whether the use case business tag of the first individual covers the iteration requirement tag based on the use case business tag and the iteration requirement tag in the tag information; and removes the first individual whose use case business tag cannot cover the iteration requirement tag from the first processing population to obtain the second processing population.
[0158] In some embodiments of the present disclosure, the third determination unit 1130 is also used to determine the fitness parameter of the second individual based on the first execution time cost; determine the first target individual from the second individual based on the fitness parameter; and determine the second target individual and the iterative target population based on the second processing population using a genetic algorithm.
[0159] In some embodiments of the present disclosure, the third determination unit 1130 is also used to determine the cumulative selection probability of the fourth individual in the second processing population based on the fitness parameter; determine the third processing population based on the cumulative selection probability; determine the fourth processing population based on the third processing population using preset crossover parameters and preset mutation parameters; iterate the fourth processing population based on the marking information of the fifth individual in the fourth processing population and the second execution time cost; when the number of iterations reaches a preset upper limit, and / or the iteration result meets a preset condition, stop the iteration to obtain the second target individual and the iterative target population.
[0160] In some embodiments of the present disclosure, the fourth determination unit 1140 is also used to determine the importance parameters and historical problem parameters of the first target individual, the second target individual, and the third target individual in the iterative target population; determine the fusion evaluation parameters of the first target individual, the second target individual, and the third target individual based on the importance parameters and the historical problem parameters; determine the fourth target individual from the first target individual, the second target individual, and the third target individual based on the fusion evaluation parameters; and perform genetic decoding on the fourth target individual to obtain a target use case set.
[0161] In some embodiments of the present disclosure, the fourth determination unit 1140 is further used to obtain test requirement information of the scenario to be tested; based on the marking information and test requirement information of the target use case set, determine whether the target use case set can cover the test requirements of the scenario to be tested, so as to adjust the target use case set.
[0162] In summary, the use case selection device proposed in the present disclosure includes: a first determination unit, which is used to determine the first processing population based on the labeling information of the first use case in the candidate use case set; a second determination unit, which is used to determine the second processing population based on the labeling information of the first individual in the first processing population, wherein the first individual is composed of the genetic code of the first use case; a third determination unit, which is used to determine the first target individual, the second target individual, and the iterative target population based on the first execution time cost and labeling information of the second individual in the second processing population; and a fourth determination unit, which is used to determine the target use case set based on the first target individual, the second target individual, and the iterative target population. The device of the present disclosure avoids the loss of excellent individuals in the iteration process by determining the first target individual and the second target individual, and then determines the target use case set through the first target individual, the second target individual, and the iterative target population, thereby improving the coverage and completeness of the target use case set.
[0163] It should be noted that: the use case selection device provided in the above embodiment only uses the division of the above-mentioned program modules as an example when performing use case selection. In actual applications, the above-mentioned processing can be assigned to different program modules as needed, that is, the internal structure of the use case selection device is divided into different program modules to complete all or part of the processing described above.
[0164] Since the device provided in the embodiment of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation of the method is also applicable to the device provided in the embodiment and will not be described in detail in this embodiment.
[0165] In the embodiments provided in the present application, the methods and devices provided in the embodiments of the present application are introduced. In order to implement the functions in the methods provided in the embodiments of the present application, the electronic device may include a hardware structure and a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. A function of the functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.
[0166] Fig.12 A schematic diagram of the hardware structure of the communication device provided in the embodiment of the present disclosure is shown in FIG. Fig.12 As shown, the communication device 1200 includes at least one processor 1202; and a memory 1201 communicatively connected to the at least one processor 1202; wherein the memory 1201 stores instructions executable by the at least one processor 1202, and the instructions are executed by the at least one processor 1202 to implement the steps of the use case selection method described in the embodiment of the present disclosure; or, the instructions are executed by the at least one processor 1202 to implement the steps of the use case selection method described in the embodiment of the present disclosure.
[0167] It is understood that the communication device also includes a communication interface 1203. The various components in the communication device are coupled together through a bus system 1204. It is understood that the bus system 1204 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1204 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig.12 Various buses are labeled as bus system 1204.
[0168] It can be understood that the memory 1201 can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDR AM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory 1201 described in the embodiments of the present invention is intended to include but is not limited to these and any other suitable types of memories.
[0169] The method disclosed in the above embodiment of the present disclosure may be applied to the processor 1202, or implemented by the processor 1202. The processor 1202 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method may be completed by an integrated logic circuit of hardware in the processor 1202 or an instruction in the form of software.
[0170] The above-mentioned processor 1202 can be a general-purpose processor, a DSP, or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor 1202 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiments of the present invention, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 1201. The processor 1202 reads the information in the memory 1201 and completes the steps of the aforementioned method in combination with its hardware.
[0171] In an exemplary embodiment, the communication device may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), FPGA, general purpose processor, controller, MCU, microprocessor, or other electronic components to execute the aforementioned method.
[0172] The embodiment of the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to implement the steps of the use case selection method described in the embodiment of the present invention when the computer instructions are executed.
[0173] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0174] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0175] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0176] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0177] It should be understood that the various parts of the embodiments of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0178] A person skilled in the art may understand that all or part of the steps in the above-mentioned embodiment method may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0179] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0180] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A use case selection method, characterized in that: The method comprises: Determine a first processing population based on label information of a first use case in the candidate use case set; Determining a second processing population based on label information of a first individual in the first processing population, wherein the first individual is composed of genetic coding of the first use case; Determine a first target individual, a second target individual, and an iterative target population based on a first execution time cost of a second individual in the second processing population and the marking information; A target use case set is determined based on the first target individual, the second target individual, and the iterative target population.
2. The method according to claim 1, characterized in that The determining of the first processing population based on the marking information of the first use case in the candidate use case set includes: Determining the genetic code of the first use case based on the use case business tag and the iteration requirement tag in the tag information; Based on the genetic code, generating a pre-processed population; Determining a coverage evaluation index of a third individual based on a use case business tag and an iteration requirement tag of the third individual in the preprocessed population, wherein the third individual is composed of a genetic code of the first use case; Based on the coverage evaluation index of the third individual, a first treatment population is determined from the pre-treatment population.
3. The method according to claim 1, characterized in that The determining of the second processing population based on the label information of the first individual in the first processing population comprises: Based on the use case business tag and the iteration requirement tag in the tag information, determining whether the use case business tag of the first individual covers the iteration requirement tag; The first entity whose use case business tag cannot cover the iteration requirement tag is eliminated from the first processing population to obtain a second processing population.
4. The method according to claim 1, characterized in that: The determining of the first target individual, the second target individual, and the iterative target population based on the first execution time cost of the second individual in the second processing population and the marking information comprises: Determining a fitness parameter of the second individual based on the first execution time cost; Based on the fitness parameter, determining a first target individual from the second individuals; Based on the second processing population, the second target individual and the iterative target population are determined using a genetic algorithm.
5. The method according to claim 4, characterized in that The determining the second iterative individuals and the iterative target population based on the second processing population by using a genetic algorithm comprises: determining a cumulative selection probability of a fourth individual in the second treatment population based on the fitness parameter; determining a third treatment population based on the cumulative selection probability; Based on the third processing population, a fourth processing population is determined using a preset crossover parameter and a preset mutation parameter; Iterating the fourth processing population based on the label information of the fifth individual in the fourth processing population and the second execution time cost; When the number of iterations reaches a preset upper limit, and / or the iteration result satisfies a preset condition, the iteration is stopped to obtain the second target individual and the iteration target population.
6. The method according to claim 1, characterized in that The determining of a target use case set based on the first target individual, the second target individual, and the iterative target population includes: Determine the importance parameters and historical problem parameters of the first target individual, the second target individual, and a third target individual in the iterative target population; Determining fusion evaluation parameters of the first target individual, the second target individual, and the third target individual based on the importance parameter and the historical problem parameter; Based on the fusion evaluation parameter, determining a fourth target individual from the first target individual, the second target individual and the third target individual; The fourth target individual is genetically decoded to obtain a target use case set.
7. The method according to claim 1, characterized in that The method further comprises: Obtain the test requirement information of the scenario to be tested; Based on the marking information of the target use case set and the test requirement information, it is determined whether the target use case set can cover the test requirement of the scenario to be tested, so as to adjust the target use case set.
8. A use case selection device, characterized in that: The device comprises: A first determining unit, configured to determine a first processing population based on label information of a first use case in the candidate use case set; A second determination unit, configured to determine a second processing population based on label information of a first individual in the first processing population, wherein the first individual is composed of a genetic code of the first use case; A third determining unit, configured to determine a first target individual, a second target individual, and an iterative target population based on a first execution time cost of a second individual in the second processing population and the marking information; The fourth determining unit is used to determine a target use case set based on the first target individual, the second target individual and the iterative target population.
9. An electronic device, characterized in that: include: at least one processor; And a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.