A test case determination method, device, equipment and storage medium
The ant colony algorithm processes the prior probability and resource information of test cases, optimizes the selection of regression test cases, solves the problems of low efficiency and incomplete coverage in the existing technology, and achieves more efficient regression testing.
Patent Information
- Application Number
- CN202110177526.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-07
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2041-02-07
AI Technical Summary
The selection of regression test cases in existing software testing is inefficient and the various dimension factors of the test cases cannot be fully considered, resulting in the test coverage not being comprehensive enough to meet the market demand for rapid iteration.
The ant colony algorithm is used to process the prior probability and resource information of the test cases, determine the execution probability of the target test cases, optimize the selection process of the test cases through the ant colony algorithm, combine the prior information and resource influence, and control the execution scope and order of the test cases. .
It improves the efficiency and targetedness of regression testing, ensures that test cases can better cover the code modification range, reduce manual selection time and cost, and meet the test needs of rapid iteration.
Smart Images

Figure CN114911689B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a test case determination method, device, system and computer-readable storage medium. Background Art
[0002] Software testing is used to determine whether the developer's development or modification of the code introduces new errors or causes errors in other codes. With the rapid changes in market demand, software testing usually needs to be completed in a relatively short period of time with better test results. For example, regression testing is usually quickly iterated in the later stage of the overall testing cycle of the product. Therefore, it is very important to execute more representative test cases in a short period of time during regression testing. In related technologies, when selecting test cases, the focus is usually on how to maximize the coverage rate of test statements in the test suite. In actual regression testing, testers prefer to select test cases that can cover most test scenarios and improve the execution efficiency of test cases as much as possible. Therefore, the focus of the above test case selection scheme is on how to cover the overall test scope as quickly as possible, and it cannot meet the needs of targeted testing in actual efficient regression testing. Summary of the invention
[0003] In view of this, the present application provides a test case determination method, a test case determination apparatus, a test case determination device, and a computer-readable storage medium.
[0004] The test case determination method provided in the present application realizes the intelligent determination of the target test case, and in the process of determining the target test case, fully considers the prior probability information of any test case and the impact of any test case on the test resources when it is actually executed. In the process of determining the target test case by the above method, by limiting the prior information interval and the resource quantity interval, the execution scope and test sequence of the test case in the automated regression testing process can be controlled, so as to meet the correlation test requirements in the regression test. That is to say, the above target test case is more targeted in the actual regression testing process, thereby improving the efficiency of the regression testing.
[0005] The technical solution provided by this application is implemented as follows:
[0006] A method for determining a test case, the method comprising:
[0007] Determine the jth resource information and the jth prior information; wherein the jth prior information represents the prior probability that the jth test case in the test case set is executed at the next moment of the current moment of the test process; the jth resource information represents the amount of test resources consumed by executing the jth test case during the test process; the jth test case represents a test case that is not executed at the current moment of the test process; j is an integer greater than or equal to 1;
[0008] Processing the jth prior information and the jth resource information by an ant colony algorithm to determine jth probability information; wherein the jth probability information represents the probability of the jth test case being executed at the next moment after the current moment;
[0009] Based on the j-th probability information, a target test case is determined.
[0010] In some implementations, the processing the j-th prior information and the j-th resource information by using an ant colony algorithm to determine the j-th probability information includes:
[0011] Determine the jth association information; wherein the jth association information represents the similarity between the ith test case and the jth test case; the ith test case represents the test case executed by the test process at the current moment; i is an integer greater than or equal to 1;
[0012] The j-th prior information, the j-th association information and the j-th resource information are processed by an ant colony algorithm to determine the j-th probability information.
[0013] In some implementations, the processing of the j-th prior information, the j-th association information, and the j-th resource information by an ant colony algorithm to determine the j-th probability information includes:
[0014] Based on the jth prior information, the jth association information and the jth resource information, determine the jth data; wherein the jth data represents the weight of the jth test case at the current moment of the test process in the ant colony algorithm;
[0015] Based on the test case set weight and the jth data, the jth probability information is determined; wherein the test case set weight represents the sum of the weights of each test case in the test case set during the test process in the ant colony algorithm.
[0016] In some implementations, determining the jth data based on the jth prior information, the jth association relationship, and the jth resource information includes:
[0017] Get initial resource information;
[0018] Based on the initial resource information and the jth resource information, determine the jth resource measurement information; wherein the jth resource measurement information represents the relative quantity information of the test resources consumed by executing the jth test case;
[0019] The jth data is determined based on the jth prior information, the jth association information and the jth resource measurement information.
[0020] In some implementations, determining the jth data based on the jth prior information, the jth association information, and the jth resource metric information includes:
[0021] Determine the jth pheromone information; wherein the jth pheromone information includes the jth pheromone concentration information corresponding to the switch from the i-th test case to the j-th test case at the current moment of the test process;
[0022] The jth data is determined based on the jth prior information, the jth association information, the jth resource measurement information, and the jth pheromone information.
[0023] In some embodiments, determining the jth pheromone information comprises:
[0024] Obtaining the j-th pheromone concentration information and pheromone concentration threshold;
[0025] In a case where the j-th pheromone concentration information is less than or equal to the pheromone concentration threshold, setting the j-th pheromone concentration information as the pheromone concentration threshold;
[0026] When the j-th pheromone concentration information is greater than the pheromone concentration threshold, obtaining a pheromone volatility coefficient; and updating the j-th pheromone concentration information based on the pheromone volatility coefficient and the j-th pheromone concentration information;
[0027] Based on the j-th pheromone concentration information, the j-th pheromone information is determined.
[0028] In some implementations, determining the jth resource metric information based on the initial resource information and the jth resource information includes:
[0029] Based on the initial resource information and the jth resource information, determine the jth remaining resource information; wherein the jth remaining resource information represents the remaining resource information after executing the jth test case;
[0030] The jth resource measurement information is determined based on the jth remaining resource information and the sum of the remaining resource information of executing each test case in the test case set.
[0031] The present application also provides a test case determination device, the device comprising: a determination module and a processing module, wherein:
[0032] The determination module is used to determine the jth resource information and the jth prior information; wherein the jth prior information represents the prior probability that the jth test case in the test case set is executed at the next moment of the current moment of the test process; the jth resource information represents the number of test resources consumed by executing the jth test case during the test process; the jth test case represents a test case that has not been executed at the current moment of the test process; j is an integer greater than or equal to 1;
[0033] The processing module is used to process the j-th prior information and the j-th resource information by using an ant colony algorithm to determine the j-th probability information; wherein the j-th probability information represents the probability that the j-th test case will be executed at the next moment after the current moment;
[0034] The determination module is further used to determine a target test case based on the j-th probability information.
[0035] The present application also provides a test case determination device, the device comprising: a processor, a memory, and a communication bus; wherein:
[0036] The communication bus is used to realize the communication connection between the processor and the memory; the processor is used to execute the computer program stored in the memory to implement the test case determination method as described in any one of claims 1-8.
[0037] The present application also provides a computer-readable storage medium, which can be executed by a processor to implement any of the test case determination methods described above.
[0038] From the above, it can be seen that the test case determination method provided by the present application, after determining the jth prior information of the jth test case and the jth resource information of the number of test resources required to execute the jth test case, processes the jth prior information and the jth resource information through an ant colony algorithm to determine the jth probability information, and determines the test case to be executed at the next moment of the current moment of the test process through the jth probability information.
[0039] Therefore, the test case determination method provided by the present application not only realizes the intelligent determination of the target test case, but also, in the process of determining the target test case, on the premise of drawing on the superiority of the ant colony algorithm, fully considers the prior probability information of any test case and the impact of any test case on the test resources during actual execution. By limiting the prior information interval and the resource quantity interval, the execution scope and test sequence of the test case in the automated regression testing process can be controlled, so that the determined target test case can be more in line with the actual regression testing and correlation testing requirements, thereby meeting the targeted testing of the scope of impact related to code modification in the regression test, and improving the efficiency of the regression test. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 A flowchart of a first test case determination method provided in an embodiment of the present application;
[0041] Figure 2 A flowchart of a second test case determination method provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of the implementation flow of the third test case determination method provided in the embodiment of the present application;
[0043] Figure 4 A schematic diagram of the structure of a test case determination device provided in an embodiment of the present application;
[0044] Figure 5 A schematic diagram of the structure of a test case determination device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0046] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0047] The present application relates to the field of information technology, and in particular to a test case determination method, a test case determination apparatus, a test case determination device, and a computer-readable storage medium.
[0048] In the field of software testing, regression testing is used to test the code after the developer has modified it to determine whether the developer's modification of the code has introduced new errors or caused errors in other codes. Regression testing is usually iterated quickly in the later stage of the overall testing cycle of the product. Therefore, it is very important to execute more representative test cases in a short time of regression testing.
[0049] In the related art, the selection of regression test cases is mostly based on the tester's test experience, and there are few solutions that use intelligent algorithms to identify test cases. The efficiency of the method of selecting test cases based on the tester's test experience is obviously low, and such a selection method is also prone to test case selection bias.
[0050] In the related art, some researchers have proposed to apply the ant colony algorithm to the selection of test cases for regression testing. However, in the above test case selection process, only the impact of the test case priority is considered, and the focus is on how to maximize the coverage rate of test statements in the test suite. This selection method is obviously not comprehensive enough for the evaluation of test cases. Therefore, the test case selection method based on the ant colony algorithm in the related art is one-sided and cannot fully and objectively reflect the impact of factors in various dimensions of the test case.
[0051] On the other hand, in actual regression testing, testers prefer to select a number of test cases with higher priority that can cover most test scenarios and improve the execution efficiency of test cases as much as possible. Therefore, the method of applying the ant colony algorithm to maximize the coverage rate of test statements in the test suite in test case selection cannot meet the above regression testing requirements.
[0052] Based on the above problems, the embodiment of the present application provides a test case determination method, which can process the prior probability of any test case in the test case set and the resource quantity information consumed by executing any test case during the test process through the ant colony algorithm, so as to determine the probability information of any test case being executed at the next moment of the current moment, and then determine the target test case based on the above probability information. That is to say, the process of processing the prior probability of any test case and the number of resources consumed during execution through the ant colony algorithm, while drawing on the superiority of the ant colony algorithm, also includes obtaining the prior information of each test case and the number of resources consumed when any test case is executed, and the number of resources consumed when any test case is executed can reflect the situation of the test case during actual execution. Therefore, by limiting the prior information interval and the resource quantity interval, the execution range and test order of the test case in the automated regression test process can be controlled, so that the target test case finally determined can more accurately fit the test requirements corresponding to the code modification range, thereby overcoming the technical problem of simply pursuing the test case coverage in the related technology and failing to highlight the test focus.
[0053] It should be noted that the test case determination method provided in the embodiment of the present application can be implemented by a processor in a test case determination device, and the above-mentioned processor can be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor.
[0054] Figure 1 The flowchart of the first test case determination method provided in the embodiment of the present application is as follows. Figure 1 As shown, the test case determination method may include the following steps:
[0055] Step 101: Determine j-th resource information and j-th prior information.
[0056] Among them, the jth prior information represents the prior probability of the jth test case in the test case set being executed at the next moment of the current moment of the test process; the jth resource information represents the amount of test resources consumed by executing the jth test case during the test process; the jth test case represents the test case that has not been executed at the current moment of the test process; j is an integer greater than or equal to 1.
[0057] In one implementation, the test process may be a test process that is currently being executed but has not yet started to be executed.
[0058] In one implementation, the current time may represent a specified time in the test process.
[0059] In one implementation, the current moment may represent any moment in the test process.
[0060] In one implementation, the jth test case may be any test case in the test case set except the test case currently being executed during the test process.
[0061] In one implementation, the jth test case may be a test case associated with the test case currently being executed. Exemplarily, the jth test case may be any test case in a neighbor test case set of the test case currently being executed.
[0062] In one implementation, the test resource may represent the time consumed in executing the jth test case.
[0063] In one implementation, the test resources may represent the software or hardware resources consumed by executing the jth test case. The software resources may represent at least one of the following: the number and priority of processes required to execute the jth test case, the number and priority of threads opened, and the amount of memory space applied for; the hardware resources may represent at least one of the following: the proportion of CPU occupied, the number of ports of computer equipment occupied, the number of communication lines, etc., the type and number of instruments occupied, etc.
[0064] In one implementation, the test resources may represent the amount of energy of the tester consumed in executing the jth test case. The energy of the tester may include the time consumed by the tester in setting up the test environment for executing the jth test case, the intellectual factors consumed by the tester in executing the jth test case, etc.
[0065] In one implementation, the jth prior information may be the attribute information of the jth test case itself. The attribute information may not carry the subjective judgment information of the tester, so that the jth prior probability can more objectively reflect the characteristics of the jth test case itself.
[0066] In one implementation, the prior information corresponding to different test cases may be different.
[0067] In one implementation, determining the jth resource information and the jth prior information may be performed simultaneously. In the embodiment of the present application, the order of determining the jth resource information and the jth prior information is not limited.
[0068] Step 102: Process the j-th prior information and the j-th resource information by using an ant colony algorithm to determine the j-th probability information.
[0069] Among them, the j-th probability information represents the probability of the j-th test case being executed at the next moment after the current moment.
[0070] In one implementation, the j-th probability information may be actual probability information of the j-th test case being executed at the next moment after the current moment.
[0071] In one implementation, probability information corresponding to any two test cases in the test case set, such as the mth probability information and the pth probability information, may be the same, where m and p are both integers greater than or equal to 0 but not equal to i.
[0072] By way of example, the following text will use the classic Traveling Salesman Problem (TSP) as a background to briefly explain the principle of the ant colony algorithm.
[0073] The TSP problem can be described as follows: a salesman has to go to several cities to sell goods. The salesman starts from one city and needs to pass through all cities before returning to the starting point. In the process of the salesman traversing all cities, the route can be optimized to make the total journey as short as possible. Exemplarily, the information about all cities and whether there are connected paths between each city can be represented by a weighted undirected connected graph G(V, E). Among them, V represents the set of cities, and E represents the set of paths between two cities. In the city network, any city will have its corresponding adjacent city. The distance between cities can be represented by the Euclidean distance. Exemplarily, the distance d between city a and city b is ab It can be calculated by formula (1):
[0074]
[0075] The coordinates of city x are (x a ,y a ), the y coordinate of the city is (x b ,y b ).
[0076] The ant colony algorithm uses the control grouping of ants to find paths between cities and optimize the existing path information. Ants will try to establish all paths from the source city to the destination city and select the best path from them. In the process of selecting the best path, ants will release pheromones along the way. The concentration of pheromones determines how new ants move from the source city to the destination city again. In the traditional ant colony algorithm, the probability of ant k moving from the current city node a to another city node b can be calculated by formula (2):
[0077]
[0078] In formula (2), represents the probability that ant k moves from city a to city b within time t, t is a positive number, k, a and b are all positive integers; allowed k ={0,1,...,n-1}-tabu krepresents the set of next cities that ant k can choose; n is the number of cities that ant k can choose, and n is an integer greater than 2; tabu k refers to the taboo table of ant k, which is used to indicate the cities that ant k has passed through. k It will change in real time as the ants move; ab (t) is used to represent the pheromone concentration accumulated by ants on the path from city a to city b; ε ab (t) represents the heuristic factor of the ant algorithm, which reflects the expectation of ant k to move from city a to city b; α and β are two constant variables related to the algorithm, where α represents the relative importance of pheromone and β represents the relative importance of the heuristic factor.
[0079] In formula (2), ε ab (t) can be calculated by formula (3):
[0080]
[0081] In formula (3), d ab is the Euclidean distance between city a and city b. The pheromone concentration ψ ab (t) will be updated according to formula (4) after each search period:
[0082] ψ ab (t+1)=(1-ρ)×ψ ab (t)+Δψ ab (t) (4)
[0083] In formula (4), ρ is the volatility coefficient of pheromone, and its value range is ρ∈(0,1). The larger the value of ρ, the faster the pheromone evaporates; 1-ρ is the residual factor of pheromone; ψ ab (t) is the pheromone increment on the path between city a and city b, Δψ ab (t) is the sum of the pheromones released by n ants along the path from city a to city b. Δψ ab (t) can be calculated by formula (5):
[0084]
[0085] In formula (5), represents the pheromone released by the kth ant on the path between city a and city b. In the traditional ant colony algorithm, if ant k chooses to move along the path between city a and city b, the pheromone concentration Δψ ab Usually calculated by formula (6):
[0086]
[0087] In formula (6), L k represents the length of the path experienced by ant k in this city traversal; A is a positive constant. The ant colony algorithm will repeat the iteration until the specified number of ants have gone through the city traversal iteration process.
[0088] From the above, we can see that in the traditional ant colony algorithm, the variables involved in the operation are: pheromone concentration and algorithm heuristic factor. When applying the ant colony algorithm to the scenario of test case selection, it is impossible to comprehensively and objectively examine the characteristics of any test case by relying only on the parameters of the two dimensions of pheromone concentration and algorithm heuristic factor.
[0089] In the embodiment of the present application, the j-th prior information represents the attribute characteristics of the j-th test case itself, and the j-th resource information represents the amount of test resources required for the j-th test case to be consumed during actual execution. Therefore, the j-th prior information and the j-th resource information are processed by the ant colony algorithm. In the process of ants selecting test cases, the attribute characteristics of the j-th test case itself and the resource requirement information during actual execution are added, thereby making the ants' selection of test cases more objective.
[0090] In one implementation, the j-th probability information may be determined by any of the following methods:
[0091] Through the ant colony algorithm, the j-th prior information and the j-th resource information are processed according to the pheromone concentration and the algorithm heuristic factor to determine the j-th probability information.
[0092] The j-th prior information and the j-th resource information are combined and processed to obtain the j-th ant colony algorithm factor; the j-th ant colony algorithm factor is processed by the ant colony algorithm according to the pheromone concentration and the algorithm heuristic factor, so as to determine the j-th probability information.
[0093] Step 103: Determine the target test case based on the j-th probability information.
[0094] In one implementation, the number of target test cases may be at least one.
[0095] In one implementation, the target test case may be determined in the following manner:
[0096] Sort each j-th probability information calculated, and determine the target test case according to the sorting result.
[0097] In one implementation, the j-th probability information corresponding to the target test case may be a maximum value or a minimum value in the j-th probability information set (j is not equal to i).
[0098] In one implementation, the j-th probability information corresponding to the target test case may be at least one piece of probability information within a specified interval in the j-th probability information set (j is not equal to i).
[0099] From the above, it can be seen that the test case determination method provided in the embodiment of the present application, after determining the jth prior information of the jth test case and the jth resource information of the number of test resources required to execute the jth test case, processes the jth prior information and the jth resource information through the ant colony algorithm to determine the jth probability information, thereby realizing a multi-scale mathematical description of the jth probability information; then, the test case to be executed at the next moment of the current moment of the test process is determined through the jth probability information.
[0100] Therefore, the test case determination method provided in the embodiment of the present application, in the process of target test case determination, while drawing on the superiority of the ant colony algorithm, realizes the intelligent selection of test cases, reduces the time and labor cost of manual selection of test cases, and improves the efficiency of software testing; it also fully considers the prior probability information of any test case and the impact of any test case on test resources during actual execution. By limiting the prior information interval and the resource quantity interval, it is possible to control the execution scope and test sequence of the test cases in the automated regression testing process, so that the determined target test cases can better meet the actual regression testing requirements.
[0101] Based on the foregoing embodiments, the embodiments of the present application also provide a second test case determination method. Figure 2 The flowchart of the second test case determination method provided in the embodiment of the present application is as follows. Figure 2 As shown, the test case determination method may include the following process:
[0102] Step 201: Determine j-th resource information and j-th prior information.
[0103] Among them, the jth prior information represents the prior probability of the jth test case in the test case set being executed at the next moment after the current moment of the test process; the jth resource information represents the amount of test resources consumed by executing the jth test case during the test process; the jth test case represents the test case that has not been executed at the current moment of the test process; j is an integer greater than or equal to 1.
[0104] Exemplarily, determining the j-th prior information in step 201 may be implemented through steps A1 and A2:
[0105] Step A1: Obtain information of the jth test point.
[0106] The j-th test point information indicates the information of the test points covered by the j-th test case.
[0107] In one implementation, the test points may include function points and / or performance points involved in the test case.
[0108] In one implementation, the j-th test point information may include function points and test methods thereof, and / or performance points and test methods thereof involved in the j-th test case.
[0109] In one implementation, the j-th test point information may include importance and quantity information of function points and / or performance points covered by the j-th test case.
[0110] In one implementation, the j-th test point information may be attribute information of the j-th test case itself.
[0111] Exemplarily, the j-th test point information can be determined by formula (7):
[0112] p j (t) = aN j (7)
[0113] In formula (7), p j (t) represents the priority of the jth test case at time t, i.e., the jth test point information; N j Represents the test point information covered by the jth test case; a is a constant.
[0114] Step A2: Determine jth prior information based on the ratio of the jth test point information to the test point information of the test case set.
[0115] The test point information of the test case set refers to the sum of the information of the test points covered by each test case in the test case set.
[0116] In one implementation, the test point information of the test case set includes the test point information of the i-th test case being executed at the current moment of the test process.
[0117] In one implementation, information about test points covered by at least two test cases in the test case set may be the same.
[0118] In one implementation, the jth prior information can be determined by formula (8):
[0119]
[0120] In formula (8), μ ij (t) represents the probability that the jth test case is selected for execution relative to the ith test case at time t, that is, the jth prior information; C(i) is the set of all neighbor candidate test cases of the ith test case at time t.
[0121] Through the above steps, the j-th prior information determined by the embodiment of the present application is only related to the test point information covered by the test case, and does not include the subjective factors of the tester. Therefore, the prior information can more objectively reflect the priority information of the j-th test case in the test case set.
[0122] Step 202: Determine the jth associated information.
[0123] Among them, the jth association information represents the similarity between the ith test case and the jth test case; the ith test case represents the test case executed by the test process at the current moment; and i is an integer greater than or equal to 1.
[0124] In the embodiment of the present application, the order of determining the jth resource information, the jth prior information, and the jth associated information in step 201 and step 202 is not limited.
[0125] In one implementation, the jth association relationship may represent the similarity between the test information included in the i-th test case of the test process and the test information included in the j-th test case.
[0126] In one implementation, the jth association relationship may be the similarity between a test case associated with the ith test case and a test case associated with the jth test case.
[0127] Exemplarily, step 202 can be implemented by steps B1 to B3:
[0128] Step B1, obtaining information of the j-th test point and information of the i-th test point.
[0129] The j-th test point information indicates the information of the test point covered by the j-th test case; the ith test point information indicates the information of the test point covered by the ith test case.
[0130] Exemplarily, the method for acquiring the i-th test point information is similar to the method for acquiring the j-th test point information described in the aforementioned embodiment, and will not be described in detail here.
[0131] Step B2: Obtain union information of the i-th test point information and the j-th test point information, and intersection information between the i-th test point information and the j-th test point information.
[0132] In one implementation, the union information of the i-th test point information and the j-th test point information may include a set of all function points and / or performance points included in the i-th test point information and the j-th test point information.
[0133] In one implementation, the intersection information between the i-th test point information and the j-th test point information may include a set of function points and / or performance points common to the i-th test point information and the j-th test point information.
[0134] Step B3: Determine the jth association relationship based on the difference between the union information and the intersection information.
[0135] For example, the jth association relationship can be determined by formula (9):
[0136] h ij =λ(N i ∪N j -N i ∩N j ) (9)
[0137] In formula (9), h ij represents the similarity between the test case executed at the current moment, i.e., the i-th test case, and the j-th test case in the neighbor candidate test case, i.e., the j-th association relationship; λ is an adjustment factor, which is a constant in the embodiment of the present application; N i Indicates the test point information covered by the i-th test case; N j Represents the test point information covered by the jth test case.
[0138] Through the above steps, the j-th prior information determined by the embodiment of the present application is only related to the test point information covered by the test case, and does not include the subjective factors of the tester. Therefore, the prior information can more objectively reflect the priority information of the test case in the test case set.
[0139] Step 203: Process the j-th prior information, the j-th associated information and the j-th resource information through an ant colony algorithm to determine the j-th probability information.
[0140] In one implementation, the j-th probability information may be determined in the following manner:
[0141] The jth prior information, the jth association information and the jth resource information are processed through the pheromone concentration information and the algorithm heuristic factor in the ant colony algorithm to determine the jth probability information.
[0142] Exemplarily, step 203 may be implemented by steps C1 and C2:
[0143] Step C1, determining the jth data based on the jth prior information, the jth associated information and the jth resource information.
[0144] Among them, the j-th data represents the weight of the j-th test case at the current moment of the test process in the ant colony algorithm.
[0145] In one implementation, the jth data is obtained by performing operations on the jth prior information, the jth associated information, and the jth resource information according to a specified mathematical combination operation.
[0146] In one implementation, in the process of processing the jth prior information, the jth associated information and the jth resource information, weight information can be set for at least one of the jth prior information, the jth associated information and the jth resource information according to the needs of actual test case selection.
[0147] Exemplarily, step C1 may be implemented through steps D1-D3:
[0148] Step D1, obtaining initial resource information.
[0149] In one implementation, the initial resource information may indicate the quantity information of the test resources when the j-th test case is not executed; the initial resource information may include at least one type of resource information.
[0150] In one implementation, the initial resource information corresponding to each test case in the test case set may be different.
[0151] In one implementation, the same initial resource information may be allocated to each test case in the test case set according to the test requirements.
[0152] In one implementation, the initial resource information may represent the maximum initial energy value possessed by the tester before executing the jth test case.
[0153] Step D2: Determine resource measurement information based on the initial resource information and the j-th resource information.
[0154] The j-th resource measurement information indicates the relative quantity information of the test resources consumed in executing the j-th test case.
[0155] In one implementation, the jth resource measurement information may represent measurement information of the amount of test resources consumed by executing the jth test case relative to the amount of test resources consumed by executing other test cases in the test case set.
[0156] In one implementation, the jth resource measurement information may represent measurement information of the amount of test resources consumed in executing the jth test case relative to the amount of test resources consumed in executing a specified portion of the test case set.
[0157] Exemplarily, step D2 may be implemented by steps E1 and E2:
[0158] Step E1: Determine the jth remaining resource information based on the initial resource information and the jth resource information.
[0159] The j-th remaining resource information indicates the remaining resource information after executing the j-th test case.
[0160] In one implementation, the j-th remaining resource information may be a difference between the initial resource information and the j-th resource information.
[0161] Step E2: Determine the jth resource measurement information based on the jth remaining resource information and the remaining resource information of executing each test case in the test case set.
[0162] In one implementation, the jth resource measurement information may be determined based on a ratio of the jth remaining resource information to the sum of the remaining resource information of each test case executed in the test case set.
[0163] Exemplarily, the j-th resource metric information may be determined by calculation using formula (10):
[0164]
[0165] In formula (10), η ij (t) represents the jth resource measurement information; E Max Indicates the initial resource information before executing the test case; j (t) represents the j-th resource information; b is a constant.
[0166] From the above, we can know that the j-th resource measurement information reflects the number of test resources consumed by executing the j-th test case, relative to the number of test resources consumed by executing each test case in the test case set. Therefore, in the actual test case selection process, by adjusting the weight information of the j-th resource measurement information, the test case that consumes less test resources can have a higher probability of being executed.
[0167] Step D3: Determine the jth data based on the jth prior information, the jth association information and the jth resource measurement information.
[0168] In one implementation, the jth data may be determined by combining the jth prior information, the jth association information, and the jth resource metric information with the help of pheromone concentration parameters and / or algorithm heuristic factors in the ant colony algorithm.
[0169] Exemplarily, step D3 may be implemented by steps E1 and E2:
[0170] Step E1, determining the jth pheromone information.
[0171] The jth pheromone information includes the jth pheromone concentration corresponding to the switch from the i-th test case to the j-th test case at the current moment of the test process.
[0172] In one embodiment, the jth pheromone information will change at any time as the test process is executed. Therefore, during the test process, when the test case needs to be switched, the jth pheromone information needs to be determined. The purpose of updating the pheromone information is to increase the concentration of pheromones on the better test case switching path and reduce the concentration of pheromones on the worse test case switching path, thereby guiding the ants to search for test cases in the direction of a better path.
[0173] In one embodiment, the j-th pheromone information includes the pheromone concentration corresponding to the switch from the ith test case to the j-th test case, and also includes the pheromone concentration increment generated by the historical test case switching process.
[0174] In one embodiment, since the number of test cases in the test case set is large and the switching paths between the test cases are not unique, each pheromone information can be determined by the identification information of the pheromone information. Accordingly, the j-th pheromone information in the embodiment of the present application includes the j-th pheromone concentration information and may also include the identification information of the j-th pheromone information.
[0175] For example, the j-th pheromone concentration information of the j-th pheromone information can be determined by formula (11):
[0176] ψ ij (t+1)=(1-ρ1)×ψ ij (t)+Δψ ij (t) (11)
[0177] In formula (11), ψ ij (t+1) represents the pheromone concentration information updated after each search period; ρ1 represents the volatility coefficient of pheromone, which is a constant; Δψ ij (t) represents the pheromone increment on the path between the i-th test case and the j-th test case, Δψ ij (t) is the sum of pheromones released by n ants.
[0178] In formula (11), Δψ ij (t) can be calculated by formula (12):
[0179]
[0180] In formula (12), represents the pheromone concentration released by ant k.
[0181] However, different from the related art, in the present embodiment, the pheromone concentration in formula (12) is It needs to be calculated through formula (13):
[0182]
[0183] In formula (13), the pheromone concentration is determined by the difference between the union and intersection of the test points covered by the i-th test case and the j-th test case. c is the adjustment factor, which is a constant.
[0184] That is to say, in the embodiment of the present application, It has nothing to do with the actual path of the ants, but is related to the test point information covered by the test case itself. It is less affected by the algorithm's own ideas and the number of iterations, and can more objectively reflect the actual characteristics of the test case.
[0185] Exemplarily, step E1 may be determined by steps F1 to F3:
[0186] Step F1, obtaining the jth pheromone concentration information and the pheromone concentration threshold.
[0187] In one implementation, the pheromone concentration threshold may be determined after the test process is determined; illustratively, a different pheromone concentration threshold may be set for any test case in the test case set.
[0188] Step F2, when the j-th pheromone concentration information is less than or equal to the pheromone concentration threshold, set the j-th pheromone concentration information as the pheromone concentration threshold; when the j-th pheromone concentration information is greater than the pheromone concentration threshold, obtain the pheromone volatility coefficient; based on the pheromone volatility coefficient and the j-th pheromone concentration information, update the j-th pheromone concentration information.
[0189] Exemplarily, the operation in step F2 can be described by formula (14):
[0190]
[0191] In formula (14), ψ default is the pheromone concentration threshold, which indicates the lower limit of the pheromone concentration and is usually a positive number; ρ1 indicates the volatility coefficient of the pheromone and is a constant.
[0192] It can be seen from formula (14) that when determining the j-th pheromone concentration information in the embodiment of the present application, the value of the pheromone concentration information will not drop to 0 or a negative value, thereby reducing the probability of the ant colony algorithm falling into a local optimum, thereby increasing the probability of any adjacent test case of the i-th test case being selected as the target test case.
[0193] Step F3: Determine the jth pheromone information based on the jth pheromone concentration information.
[0194] Exemplarily, after the j-th pheromone concentration information is determined, the j-th pheromone information may be updated based on the j-th pheromone concentration information, thereby obtaining updated j-th pheromone information.
[0195] Step E2: Determine the jth data based on the jth prior information, the jth association information, the jth resource measurement information and the jth pheromone information.
[0196] In one implementation, the jth data may be determined by processing the jth prior information, the jth association information, the jth resource measurement information, and the jth pheromone information according to the jth pheromone information and / or the algorithm heuristic factor.
[0197] For example, the jth data can be determined by formula (15):
[0198] Q ij =[ψ ij (t)] α ×[μ ij (t)] β ×[η ij (t)] γ ×[ε ij (t)] δ (15)
[0199] In formula (15), Q ij is the jth data; ψ ij (t) is the jth pheromone information; η ij (t) is the jth resource measurement information; ε ij (t) is the spatial parameter corresponding to the test case set.
[0200] In formula (15), α, β, γ, and δ are constant variables related to the ant algorithm; α represents the relative importance of pheromone, and β, γ, and δ represent the relative importance of heuristic factors.
[0201] For example, if there is no next test case to choose from for the i-th test case, ant k will return to the previous test case of this test case and add the test case i to the taboo list of ant k. k middle.
[0202] In formula (15), ε ij (t) can be calculated by formula (16):
[0203]
[0204] In formula (16), h ij is the jth association relationship calculated by formula (9); It is the sum of the associations between the i-th test case in the test case set and its neighbor test case sets.
[0205] It can be seen from formula (16) that in the embodiment of the present application, the Euclidean distance in the traditional ant algorithm is no longer used to weigh the spatial parameters, but the correlation between test cases is used to express the spatial parameters. Therefore, in the actual testing process, the distance between the more dissimilar test cases will be closer, so that at the next moment of the current moment, the test case that is not similar to the i-th test case can also have a higher probability of being selected for execution. Through the above operation, the number of selections of similar test cases can be reduced, thereby reducing unnecessary repeated execution of test cases, thereby improving the efficiency of software testing.
[0206] Step C2: Determine the jth probability information based on the test case set weight and the jth data.
[0207] The test case set weight represents the sum of the weights of each test case in the test case set during the test process in the ant colony algorithm.
[0208] In one implementation, the j-th probability information may be determined by the ratio of the j-th data to the weight of the test case set.
[0209] For example, the j-th probability information can be determined by formula (17):
[0210]
[0211] In formula (17), is the j-th probability information; allowed k ={0,1,...,n-1}-tabu k represents the set of next test cases that ant k can choose, that is, the set of neighbor test cases of the i-th test case; tabu k refers to the taboo table of ant k, which is used to indicate the test cases that ant k has selected. k It will change in real time as the ants move.
[0212] Step 204: Determine the target test case based on the jth probability information
[0213] For example, Figure 3 The following is a schematic diagram of the implementation process of the third test case determination method provided in the embodiment of the present application. Figure 3As shown, the test case determination method provided in the embodiment of the present application may include the following steps:
[0214] Step 301, start.
[0215] Exemplarily, in step 301, a test case set and test target data may be determined.
[0216] Step 302: Initialize the ant colony and parameters.
[0217] Exemplarily, in step 302, the number of ants in an ant colony in the ant colony algorithm and the initial values of various parameter variables required to be used by the ant colony algorithm may be initialized.
[0218] Step 303: Select a group of ants.
[0219] Illustratively, in step 303 , the number of a group of ants may be determined in step 302 .
[0220] Step 304: Increase the number of iterations by 1.
[0221] Exemplarily, in step 304, the number of iterations is used to control the end condition of the ant colony algorithm.
[0222] Step 305: Select an ant.
[0223] Exemplarily, the ant selected in step 305 may be any one of the group of ants placed in step 303, and exemplarily, may be ant k.
[0224] Step 306: Select the next test case based on the probability.
[0225] Exemplarily, the selection of the next test case is a random selection process of ant k, or it can be selected by ant k based on the pheromone concentration.
[0226] Exemplarily, the selection of the next test case by ant k may be an operation performed under the condition that the jth prior information, the jth associated information, the jth resource information and the initial resource information are determined in the aforementioned embodiment.
[0227] Step 307: Modify the taboo table.
[0228] For example, in step 307, the taboo table changes in real time as ant k moves in the test case set. If ant k has no next test case to choose after the i-th test case, it will choose to return to the i-th test case and add the i-th test case to the taboo table. The taboo table is the taboo table in the above embodiment. k .
[0229] Step 308: Update the pheromone concentration on the test case selection path.
[0230] For example, in step 308, the pheromone concentration may be updated according to equations (4)-(5) in the aforementioned embodiment in combination with equations (11)-(12).
[0231] Step 309: Check whether all ants have undergone one traversal.
[0232] Exemplarily, the ant set object determined above may be a group of ants placed in step 303; one traversal may be that any ant performs a test case selection process in the test case set.
[0233] If not, return to step 305-step 308; if yes, execute step 310.
[0234] Step 310: Whether the end condition is met.
[0235] Exemplarily, the end condition may be at least one of whether the number of iterations reaches a specified iteration threshold, or all ants have gone through a test case selection process.
[0236] Step 311: Output the optimal test case set path.
[0237] Exemplarily, the optimal test case set path may be the j-th probability information described in the aforementioned embodiment.
[0238] Through the above steps, with the help of the superiority of the ant colony algorithm itself, the test case selection process can be made more comprehensive and objective by adding the resource information consumed by executing any test case, updating the association between test cases, the prior information of any test case, and optimizing the pheromone concentration update strategy.
[0239] From the above, it can be seen that the test case determination method provided in the embodiment of the present application determines the jth resource information and the jth prior information required to execute the jth test case, and then determines the jth association relationship based on the similarity between the i-th test case executed at the current moment and the j-th test case, and then processes the j-th prior information, the j-th resource information and the j-th association relationship through ant colony calculation, so as to determine the j-th probability information, and then determines the target test case based on the j-th probability information.
[0240] Therefore, the test case determination method provided in the embodiment of the present application not only realizes the intelligent determination of the target test case, but also, in the process of determining the jth probability information, fully considers the resource information consumed by executing any test case, updates the association relationship between the test cases, and the impact of the prior information of any test case on the jth probability information. By limiting the prior information interval and the resource information interval, the execution scope and test sequence of the test case in the automated regression testing process can be controlled, so that the jth probability information can be closer to the actual test case execution scenario, and then the target test case can meet the actual testing needs.
[0241] Based on the above embodiments, the present application embodiment provides a test case determination device 4, Figure 4 This is a schematic diagram of the structure of a test case determination device 4 provided in an embodiment of the present application. Figure 4 As shown, the test case determination device 4 may include: a determination module 401 and a processing module 402, wherein:
[0242] The determination module 401 is used to determine the jth resource information and the jth prior information; wherein the jth prior information represents the prior probability that the jth test case in the test case set is executed at the next moment of the current moment of the test process; the jth resource information represents the amount of test resources consumed by executing the jth test case during the test process; the jth test case represents the test case that has not been executed at the current moment of the test process; j is an integer greater than or equal to 1;
[0243] The processing module 402 is used to process the j-th prior information and the j-th resource information by using an ant colony algorithm to determine the j-th probability information; wherein the j-th probability information represents the probability of the j-th test case being executed at the next moment of the current moment;
[0244] The determination module 401 is further configured to determine a target test case based on the j-th probability information.
[0245] In some implementations, the determination module 401 is used to determine the jth association information; wherein the jth association information represents the similarity between the ith test case and the jth test case; the ith test case represents the test case executed by the test process at the current moment; i is an integer greater than or equal to 1;
[0246] The processing module 402 is used to process the j-th prior information, the j-th association information and the j-th resource information through an ant colony algorithm to determine the j-th probability information.
[0247] In some implementations, the determination module 401 is used to determine jth data based on jth prior information, jth association information, and jth resource information; wherein the jth data represents the weight of the jth test case at the current moment of the test process in the ant colony algorithm;
[0248] The determination module 401 is further used to determine the jth probability information based on the test case set weight and the jth data; wherein the test case set weight represents the sum of the weights of each test case in the test case set during the test process in the ant colony algorithm.
[0249] In some implementations, the determination module 401 is used to obtain initial resource information; based on the initial resource information and the j-th resource information, determine the j-th resource measurement information; wherein the j-th resource measurement information represents the relative quantity information of the test resources consumed by executing the j-th test case;
[0250] The determination module 401 is further configured to determine the jth data based on the jth prior information, the jth association information and the jth resource measurement information.
[0251] In some embodiments, the determination module 401 is used to determine the jth pheromone information; wherein the jth pheromone information includes the jth pheromone concentration information corresponding to the switch from the ith test case to the jth test case at the current moment of the test process;
[0252] The determination module 401 is further configured to determine the jth data based on the jth prior information, the jth association information, the jth resource measurement information and the jth pheromone information.
[0253] In some embodiments, the determination module 401 is used to obtain the j-th pheromone concentration information and the pheromone concentration threshold; when the j-th pheromone concentration information is less than or equal to the pheromone concentration threshold, set the j-th pheromone concentration information as the pheromone concentration threshold; when the j-th pheromone concentration information is greater than the pheromone concentration threshold, obtain the pheromone volatilization parameter; based on the pheromone volatilization parameter and the j-th pheromone concentration information, update the j-th pheromone concentration information;
[0254] The determination module 401 is further configured to determine the jth pheromone information based on the jth pheromone concentration information.
[0255] In some embodiments, the determination module 401 is used to determine the jth remaining resource information based on the initial resource information and the jth resource information; determine the jth resource measurement information based on the jth remaining resource information and the sum of the remaining resource information of executing each test case in the test case set; wherein the jth remaining resource information represents the resource information remaining after executing the jth test case.
[0256] It should be noted that, in actual applications, the processing module 401 and the determination module 402 can be implemented using a processor in an electronic device, and the above-mentioned processor can be at least one of ASIC, DSP, DSPD, PLD, FPGA, CPU, controller, microcontroller, and microprocessor.
[0257] From the above, it can be seen that the test case determination device 4 provided in the embodiment of the present application, when determining the jth prior information of the jth test case and the jth resource information of the number of test resources required to execute the jth test case, processes the jth prior information and the jth resource information through the ant colony algorithm, so as to determine the jth probability information, and determines the test case to be executed at the next moment of the current moment of the test process through the jth probability information.
[0258] Therefore, the test case determination device 4 provided in the embodiment of the present application not only realizes the intelligent determination of the target test case, but also, in the process of determining the target test case, on the premise of drawing on the superiority of the ant colony algorithm, fully considers the prior probability information of any test case and the impact of any test case on the test resources during actual execution. By limiting the prior information interval and the resource quantity interval, the execution scope and test sequence of the test case in the automated regression test process can be controlled, so that the determined target test case can better meet the actual regression test requirements.
[0259] Based on the foregoing embodiments, the present application also provides a test case determination device 5. Figure 5 This is a schematic diagram of the structure of the test case determination device 5 of the system of the embodiment of the present application. Figure 5 As shown, the test case determination device 5 includes: a processor 501, a memory 502 and a communication bus; wherein:
[0260] The communication bus is used to realize the communication connection between the processor 501 and the memory 502; the processor 501 is used to execute the computer program stored in the memory 502 to realize the test case determination method as in any of the previous embodiments.
[0261] The processor 501 may be at least one of an application specific integrated circuit ASIC, a DSP, a DSPD, a PLD, an FPGA, a CPU, a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device used to implement the functions of the processor may also be other electronic devices, which are not specifically limited in the embodiment of the present invention.
[0262] The memory 502 may be a volatile memory, such as a RAM; or a non-volatile memory, such as a ROM, a flash memory, a hard disk (HDD) or a solid-state drive (SSD); or a combination of the above types of memories, and provide instructions and data to the processor.
[0263] Based on the foregoing embodiments, the embodiments of the present application further provide a computer-readable storage medium, which can be executed by a processor to implement any of the foregoing test case determination methods.
[0264] The description of each embodiment above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. For the sake of brevity, this article will not go into details. The methods disclosed in the various method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments. The features disclosed in the various product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments. The features disclosed in the various method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments or device embodiments.
[0265] It should be noted that the above-mentioned computer-readable storage medium 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 (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM) and other memories; it can also be various electronic devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0266] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0267] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0268] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus necessary general hardware nodes, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0269] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0270] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0271] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0272] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A test case determination method, characterized in that: The method comprises: Determine the jth resource information and the jth prior information; wherein the jth prior information represents the prior probability that the jth test case in the test case set is executed at the next moment of the current moment of the test process; the jth resource information represents the amount of test resources consumed by executing the jth test case during the test process; the jth test case represents a test case that is not executed at the current moment of the test process; j is an integer greater than or equal to 1; Processing the jth prior information and the jth resource information by an ant colony algorithm to determine jth probability information; wherein the jth probability information represents the probability of the jth test case being executed at the next moment after the current moment; Based on the j-th probability information, determining a target test case; Wherein, determining the j-th probability information includes: Based on the test case set weight and the jth data, the jth probability information is determined; wherein the test case set weight represents the sum of the weights of each test case in the test case set during the test process in the ant colony algorithm; the jth data represents the weight of the jth test case at the current moment of the test process in the ant colony algorithm; the jth probability information pass calculated; allowed k represents the set of next test cases that ant k can choose; α, β, γ, δ are constant variables related to the ant algorithm; ψ ij (t) is the jth pheromone information, including the jth pheromone concentration information corresponding to the switch from the i-th test case to the j-th test case at the current moment of the test process; η ij (t) is the j-th resource measurement information, indicating the relative quantity information of the test resources consumed by executing the j-th test case; μ ij (t) is the j-th prior information; ε ij (t) is the spatial parameter corresponding to the test case set; ε ij (t) is the ratio of the jth association information to the sum of the association information of the ith test case in the test case set and the neighbor test case set of the ith test case; the jth association information represents the similarity between the ith test case and the jth test case; the ith test case represents the test case executed by the test process at the current moment; i is an integer greater than or equal to 1; the jth data is [ψ ij (t)] α ×[μ ij (t)] β ×[η ij (t)] γ ×[ε ij (t)] δ .
2. The method according to claim 1, characterized in that The step of processing the j-th prior information and the j-th resource information by using an ant colony algorithm to determine the j-th probability information includes: Determine the jth associated information; The j-th prior information, the j-th association information and the j-th resource information are processed by an ant colony algorithm to determine the j-th probability information.
3. The method according to claim 1, characterized in that The method further comprises: Based on the jth prior information, the jth association information and the jth resource information, the jth data is determined.
4. The method according to claim 3, characterized in that The determining the jth data based on the jth prior information, the jth association information and the jth resource information includes: Get initial resource information; Determining j-th resource metric information based on the initial resource information and the j-th resource information; The jth data is determined based on the jth prior information, the jth association information and the jth resource measurement information.
5. The method according to claim 4, characterized in that The determining the jth data based on the jth prior information, the jth association information, and the jth resource measurement information includes: Determine the jth pheromone information; The jth data is determined based on the jth prior information, the jth association information, the jth resource measurement information, and the jth pheromone information.
6. The method according to claim 5, characterized in that The step of determining the j-th pheromone information comprises: Obtaining the j-th pheromone concentration information and pheromone concentration threshold; In a case where the j-th pheromone concentration information is less than or equal to the pheromone concentration threshold, setting the j-th pheromone concentration information as the pheromone concentration threshold; When the j-th pheromone concentration information is greater than the pheromone concentration threshold, obtaining a pheromone volatility coefficient; and updating the j-th pheromone concentration information based on the pheromone volatility coefficient and the j-th pheromone concentration information; Based on the j-th pheromone concentration information, the j-th pheromone information is determined.
7. The method according to claim 4, characterized in that The determining the jth resource metric information based on the initial resource information and the jth resource information includes: Based on the initial resource information and the jth resource information, determine the jth remaining resource information; wherein the jth remaining resource information represents the remaining resource information after executing the jth test case; The jth resource measurement information is determined based on the jth remaining resource information and the sum of the remaining resource information of executing each test case in the test case set.
8. A test case determination device, characterized in that: The device comprises: a determination module and a processing module, wherein: The determination module is used to determine the jth resource information and the jth prior information; wherein the jth prior information represents the prior probability that the jth test case in the test case set is executed at the next moment of the current moment of the test process; the jth resource information represents the number of test resources consumed by executing the jth test case during the test process; the jth test case represents a test case that has not been executed at the current moment of the test process; j is an integer greater than or equal to 1; The processing module is used to process the j-th prior information and the j-th resource information by using an ant colony algorithm to determine the j-th probability information; wherein the j-th probability information represents the probability that the j-th test case will be executed at the next moment after the current moment; The processing module is specifically used to determine the jth probability information based on the test case set weight and the jth data; wherein the test case set weight represents the sum of the weights of each test case in the test case set during the test process in the ant colony algorithm; the jth data represents the weight of the jth test case at the current moment of the test process in the ant colony algorithm; the jth probability information pass calculated; allowed k represents the set of next test cases that ant k can choose; α, β, γ, δ are constant variables related to the ant algorithm; ψ ij (t) is the jth pheromone information, including the jth pheromone concentration information corresponding to the switch from the i-th test case to the j-th test case at the current moment of the test process; η ij (t) is the j-th resource measurement information, indicating the relative quantity information of the test resources consumed by executing the j-th test case; μ ij (t) is the j-th prior information; ε ij (t) is the spatial parameter corresponding to the test case set; ε ij (t) is the ratio of the jth association information to the sum of the association information of the ith test case in the test case set and the neighbor test case set of the ith test case; the jth association information represents the similarity between the ith test case and the jth test case; the ith test case represents the test case executed by the test process at the current moment; i is an integer greater than or equal to 1; the jth data is [ψ ij (t)] α ×[μ ij (t)] β ×[η ij (t)] γ ×[ε ij (t)] δ ; The determination module is further used to determine a target test case based on the j-th probability information.
9. A test case determination device, characterized in that: The device comprises: a processor, a memory and a communication bus; wherein: The communication bus is used to realize the communication connection between the processor and the memory; the processor is used to execute the computer program stored in the memory to implement the test case determination method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The readable storage medium can be executed by a processor to implement the test case determination method as described in any one of claims 1-7.
