Code regression testing method, device, computer equipment, and storage medium

By obtaining the missing test case set and verifying it based on the latest error set, the problem of low regression testing efficiency during the code update process is solved, and efficient error version code tracking and accurate verification results are achieved.

CN117421200BActive Publication Date: 2024-09-06GLENFLY TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210809878.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-11
Publication Date
2024-09-06
Estimated Expiration
2042-07-11

AI Technical Summary

Technical Problem

During the code update process, regression testing is inefficient and requires a lot of time to determine the error code corresponding to each test case.

Method used

By obtaining the missing test case set, the current missing test case to be verified is determined, and the verification is performed based on the latest error set, and the error version code is updated until the error version code corresponding to all test cases is obtained.

Benefits of technology

It improves the efficiency of code regression testing, ensures the accuracy and real-time performance of verification, avoids unnecessary repeated verification, and reduces time costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117421200B
    Figure CN117421200B
Patent Text Reader

Abstract

The present application relates to a code regression testing method, apparatus, computer equipment, storage medium and computer program product. The method comprises: obtaining a set of missing test cases. Determining the current missing test case to be verified in the missing test case set, and obtaining the current latest error set. Verifying the error version code in the current latest error set based on the current missing test case, and determining the current error version code corresponding to the current missing test case according to the verification result. The next missing test case to be verified among multiple test cases is used as the current missing test case corresponding to the next verification, and the step of obtaining the current latest error set is returned to continue execution until the error version codes corresponding to all the missing test cases are obtained. Based on the error version codes corresponding to the multiple missing test cases, the code regression test result is determined. In this way, the efficiency of code regression testing is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a code regression testing method, apparatus, computer equipment, storage medium and computer program product. Background Art

[0002] With the development of computer technology, in order to meet people's needs, it is necessary to continuously upgrade products composed of codes to improve product performance. That is, the code is updated multiple times to achieve product upgrades.

[0003] After the code is updated, all updated codes are generally tested by regression testing to identify the updated codes with errors. In regression testing, all updated codes are often required to be verified by each test case to track down the updated codes with errors corresponding to each test case from multiple updated codes.

[0004] However, in the process of code update, a huge number of update versions are often involved. Therefore, in the process of regression testing, if you want to determine the wrong update code corresponding to each test case, it takes a lot of time, and there is a problem of low efficiency in code regression testing. Summary of the invention

[0005] Based on this, it is necessary to provide a code regression testing method, apparatus, computer equipment, computer-readable storage medium and computer program product to address the above technical issues.

[0006] In a first aspect, the present application provides a code regression testing method. The method comprises:

[0007] Obtaining a missing test case set, wherein the missing test case set is a test case set determined to be missing after testing original test cases based on different versions of codes;

[0008] Determine the current lost test case to be verified in the lost test case set, and obtain the current latest error set, wherein the current latest error set contains the verified error version code;

[0009] Verifying the error version code in the current latest error set based on the current lost test case, and determining the current error version code corresponding to the current lost test case according to the verification result; the current error version code is used to update the error set;

[0010] The next lost test case to be verified in the lost test case set is used as the current lost test case corresponding to the next verification, and the step of obtaining the current latest error set is returned to continue execution until the error version codes corresponding to all the lost test cases are obtained;

[0011] The code regression test result is determined based on the erroneous version codes corresponding to the multiple missing test cases.

[0012] In a second aspect, the present application also provides a code regression testing device. The device comprises:

[0013] An acquisition module, used for acquiring a set of missing test cases, wherein the set of missing test cases is a set of test cases determined to be missing after testing original test cases based on different versions of codes;

[0014] A first determination module is used to determine the current lost test case to be verified in the lost test case set, and obtain the current latest error set, wherein the current latest error set contains the verified error version code;

[0015] A verification module, used to verify the error version code in the current latest error set based on the current lost test case, and determine the current error version code corresponding to the current lost test case according to the verification result; the current error version code is used to update the error set;

[0016] An execution module, used to use the next lost test case to be verified in the lost test case set as the current lost test case corresponding to the next verification, and return to the step of obtaining the current latest error set to continue execution until the error version codes corresponding to all the lost test cases are obtained;

[0017] The second determination module is used to determine the code regression test result based on the error version codes respectively corresponding to the multiple missing test cases.

[0018] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0019] Obtaining a missing test case set, wherein the missing test case set is a test case set determined to be missing after testing original test cases based on different versions of codes;

[0020] Determine the current lost test case to be verified in the lost test case set, and obtain the current latest error set, wherein the current latest error set contains the verified error version code;

[0021] Verifying the error version code in the current latest error set based on the current lost test case, and determining the current error version code corresponding to the current lost test case according to the verification result; the current error version code is used to update the error set;

[0022] The next lost test case to be verified in the lost test case set is used as the current lost test case corresponding to the next verification, and the step of obtaining the current latest error set is returned to continue execution until the error version codes corresponding to all the lost test cases are obtained;

[0023] The code regression test result is determined based on the erroneous version codes corresponding to the multiple missing test cases.

[0024] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0025] Obtaining a missing test case set, wherein the missing test case set is a test case set determined to be missing after testing original test cases based on different versions of codes;

[0026] Determine the current lost test case to be verified in the lost test case set, and obtain the current latest error set, wherein the current latest error set contains the verified error version code;

[0027] Verifying the error version code in the current latest error set based on the current lost test case, and determining the current error version code corresponding to the current lost test case according to the verification result; the current error version code is used to update the error set;

[0028] The next lost test case to be verified in the lost test case set is used as the current lost test case corresponding to the next verification, and the step of obtaining the current latest error set is returned to continue execution until the error version codes corresponding to all the lost test cases are obtained;

[0029] The code regression test result is determined based on the erroneous version codes corresponding to the multiple missing test cases.

[0030] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:

[0031] Obtaining a missing test case set, wherein the missing test case set is a test case set determined to be missing after testing original test cases based on different versions of codes;

[0032] Determine the current lost test case to be verified in the lost test case set, and obtain the current latest error set, wherein the current latest error set contains the verified error version code;

[0033] Verifying the error version code in the current latest error set based on the current lost test case, and determining the current error version code corresponding to the current lost test case according to the verification result; the current error version code is used to update the error set;

[0034] The next lost test case to be verified in the lost test case set is used as the current lost test case corresponding to the next verification, and the step of obtaining the current latest error set is returned to continue execution until the error version codes corresponding to all the lost test cases are obtained;

[0035] The code regression test result is determined based on the erroneous version codes corresponding to the multiple missing test cases.

[0036] The above-mentioned code regression testing method, device, computer equipment, storage medium and computer program product obtain a set of missing test cases, which is a set of test cases determined to be lost after testing the original test cases based on different versions of code. Determine the current missing test case to be verified in the missing test case set, and obtain the current latest error set, which contains the verified error version code, so that the error set used for each verification is the current latest error set, ensuring the real-time nature of each verification, thereby ensuring the effectiveness and real-time nature of the regression testing process. Based on the current missing test case, the error version code in the current latest error set is verified, and the current error version code corresponding to the current missing test case is determined according to the verification result; the current error version code is used to update the error set. In this way, by verifying the current latest error set through the current missing test case, it is possible to ensure that the current missing test case is accurately verified within the effective verification range, thereby not only ensuring the accuracy of the verification, but also avoiding directly traversing all version codes, greatly saving time costs. The next missing test case to be verified among the multiple test cases is used as the current missing test case corresponding to the next verification, and the step of obtaining the current latest error set is returned to continue execution until the error version codes corresponding to all the missing test cases are obtained, thereby being able to efficiently track the error version codes corresponding to each missing test case. Based on the error version codes corresponding to the multiple missing test cases, the code regression test results are determined. In this way, on the basis of ensuring the accuracy of the regression test, unnecessary repeated verification is reduced, and the time cost is reduced, that is, the efficiency of the code regression test is greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] Figure 1 An application environment diagram of a code regression testing method in an embodiment;

[0038] Figure 2 A schematic diagram of a code regression testing method in one embodiment;

[0039] Figure 3 A flowchart of steps for determining a missing test case in one embodiment;

[0040] Figure 4 A flowchart of a step of determining a current error version code in an embodiment;

[0041] Figure 5 A schematic diagram of a flow chart of a code regression testing method in another embodiment;

[0042] Figure 6A flowchart of a step of determining a current error version code in another embodiment;

[0043] Figure 7 A flowchart of a step of determining a current error version code in another embodiment;

[0044] Figure 8 A flowchart of a step of determining a current error version code in another embodiment;

[0045] Fig. 9 A flowchart of a step of determining a current error version code in another embodiment;

[0046] Fig.10 A flowchart of a step of determining a current error version code in another embodiment;

[0047] Fig.11 A schematic diagram of a flow chart of a code regression testing method in another embodiment;

[0048] Fig.12 is a structural block diagram of a code regression testing device in an embodiment;

[0049] Fig.13 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. 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.

[0051] The code regression testing method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The terminal 102 and the server 104 can be used alone to execute the code regression testing method, or they can be used together to execute the code regression testing method. Taking the server 104 executing the code regression testing method alone as an example, the server 104 obtains a set of missing test cases, which is a set of test cases that are lost after testing the original test cases based on different versions of the code. The server 104 determines the current missing test case to be verified in the missing test case set, and obtains the current latest error set, which contains the verified error version code. The server 104 verifies the error version code in the current latest error set based on the current missing test case, and determines the current error version code corresponding to the current missing test case according to the verification result; the current error version code is used to update the error set. The server 104 uses the next lost test case to be verified in the lost test case set as the current lost test case corresponding to the next verification, and returns to the step of obtaining the current latest error set to continue execution until the error version codes corresponding to all lost test cases are obtained. The server 104 determines the code regression test result based on the error version codes corresponding to multiple lost test cases. Among them, the terminal 102 can be but is not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented with an independent server or a server cluster consisting of multiple servers.

[0052] In one embodiment, Figure 2 As shown, a code regression testing method is provided, and the method is applied to a computer device as an example for explanation. The computer device may be Figure 1 The code regression test method comprises the following steps:

[0053] Step S202, obtaining a set of missing test cases, where the set of missing test cases is a set of test cases determined to be missing after testing original test cases based on different versions of codes.

[0054] The original test case is used to perform a test task on a specific software product. The content of the test may be the test target, test environment, input data, test steps, expected results, test scripts, etc. The original test case is stored in the original test case set, for example, the original test case set Test: {T0, T1, T2…Tm}, Tm represents the mth original test case, and the original test case set records all original test cases.

[0055] Specifically, the computer device tests each original test case in the original test case based on different versions of the version code to determine the missing test case set. The computer device obtains the missing test case set. The missing test case set is a set of test cases determined to be lost after testing the original test cases based on different versions of the code.

[0056] Step S204, determining the current missing test case to be verified in the missing test case set, and obtaining the current latest error set, where the current latest error set contains the verified error version code.

[0057] Among them, the current missing test case is the missing test case that needs to be verified. The current latest error set is the set of error version codes corresponding to the current missing test case to be verified. The error version code is the version code that causes the missing test case to be lost. The version code is the code obtained after the target code is updated for the nth time.

[0058] Specifically, the computer device determines the current lost test case to be verified based on the case sequence number of the lost test case in the lost test case set, and based on the last error version code determined by the last verification, updates the last error set to determine the current latest error set, wherein the current latest error set includes the verified error version code.

[0059] For example, the computer device determines the current lost test case to be verified based on the last case serial number of the last lost test case corresponding to the last verification and the serial number of the lost test case in the lost test case set. The computer device determines whether the last error version code exists in the last error set corresponding to the last verification based on the last error version code determined in the last verification. If it exists, the last error set is not updated, and the last error set is directly used as the current latest error set. If it does not exist, the last error version code is added to the last error set to obtain the current latest error set.

[0060] The last error version code is the error version code corresponding to the last lost test case.

[0061] Step S206, verifying the error version code in the current latest error set based on the current lost test case, and determining the current error version code corresponding to the current lost test case according to the verification result; the current error version code is used to update the error set.

[0062] The verification result is used to characterize the verification status of the version code by the current missing test case, and the verification result includes verification passed and verification failed.

[0063] Specifically, the computer device verifies the error version code in the current latest error set through the current missing test case to obtain a verification result. The computer device determines the current error version code corresponding to the current missing test case according to the verification result.

[0064] Step S208, taking the next lost test case to be verified in the lost test case set as the current lost test case corresponding to the next verification, and returning to the step of obtaining the current latest error set to continue execution until the error version codes corresponding to all the lost test cases are obtained.

[0065] Specifically, the computer device determines the next lost test case to be verified in the lost test case set based on the case sequence number of the lost test case in the lost test case set. The computer device uses the next lost test case to be verified as the current lost test case corresponding to the next verification, and returns to the step of obtaining the current latest error set to continue execution until the error version codes corresponding to all the lost test cases are obtained.

[0066] Step S210: determining a code regression test result based on the error version codes respectively corresponding to the multiple missing test cases.

[0067] Specifically, the computer device obtains the error version code corresponding to each lost test case, and determines the code regression test result according to the error version code corresponding to each lost test case, wherein the error version code corresponding to each lost test case indicates that the lost test case is lost due to the error version code.

[0068] In the above code regression testing method, by obtaining a set of missing test cases, the missing test case set is a set of test cases determined to be missing after testing the original test cases based on different versions of code. Determine the current missing test case to be verified in the missing test case set, and obtain the current latest error set, which contains the verified error version code, so that the error set used for each verification is the current latest error set, ensuring the real-time nature of each verification, thereby ensuring the effectiveness and real-time nature of the regression testing process. Based on the current missing test case, the error version code in the current latest error set is verified, and the current error version code corresponding to the current missing test case is determined according to the verification result; the current error version code is used to update the error set. In this way, by verifying the current latest error set through the current missing test case, it is possible to ensure that the current missing test case is accurately verified within the effective verification range, thereby not only ensuring the accuracy of the verification, but also avoiding directly traversing all version codes, greatly saving time costs. The next missing test case to be verified among the multiple test cases is used as the current missing test case corresponding to the next verification, and the step of obtaining the current latest error set is returned to continue execution until the error version codes corresponding to all the missing test cases are obtained, thereby being able to efficiently track the error version codes corresponding to each missing test case. Based on the error version codes corresponding to the multiple missing test cases, the code regression test results are determined. In this way, on the basis of ensuring the accuracy of the regression test, unnecessary repeated verification is reduced, and the time cost is reduced, that is, the efficiency of the code regression test is greatly improved.

[0069] In one embodiment, obtaining the missing test case set includes: obtaining the latest version code and the next latest version code. Testing each original test case respectively with the latest version code to obtain a first test result corresponding to the latest version code. Testing each original test case respectively with the next latest version code to obtain a second test result corresponding to the next latest version code. Determine the missing test case set lost in the original test case based on the first test result and the second test result.

[0070] Specifically, the computer device obtains a version number set containing different versions of version codes, and determines the latest version number and the next-newest version number based on the version number set. Among them, each version number in the version number set corresponds one-to-one to the version code in the version set. The computer device obtains the latest version code based on the latest version number, and determines the next-newest version code based on the next-newest version number. The computer device tests each original test case separately through the latest version code to obtain a first test result corresponding to the latest version code. The computer device tests each original test case separately through the next-newest version code to obtain a second test result corresponding to the next-newest version code. The computer device determines the set of lost test cases lost in the original test case based on the first test result and the second test result. Among them, each original test case corresponds to a first test result and a second test result.

[0071] For example, Figure 3 As shown, the computer device obtains a version number set CL:{C0,C1,C2,…,Cn}, and records all version numbers from old to new, wherein the larger the value of n is, the newer the version number is. Based on the version number set, the version number Cn corresponding to the latest version code and the version number Cn-1 corresponding to the next latest version code are determined, and the next latest version code is the code of the previous version of the latest version code. The computer device obtains the original test case set Test:{T0,T1,T2…Tm}, and records all test cases. The computer device traverses the latest version code one by one in the original test case set for each original test case, and obtains a plurality of first test results corresponding to the latest version code, and traverses the next latest version code one by one in the original test case set for each original test case, and obtains a plurality of second test results corresponding to the next latest version code. For each original test case, based on the first test result and the second test result corresponding to the corresponding original test case, it is determined whether the corresponding original test case is a lost test case.

[0072] In this embodiment, all original test cases are traversed through the latest version of the code to obtain multiple first test results, and all original test cases are traversed through the next-latest version of the code to obtain multiple second test results. In this way, the test results of each original test case in the latest version of the code and the next-latest version of the code can be obtained, so that all lost test cases can be quickly screened out.

[0073] In one embodiment, the lost test case set lost in the original test case is determined according to the first test result and the second test result, including: determining the original test case whose first test result is failed and whose second test result is passed as a lost test case. The lost test case set is determined based on multiple lost test cases.

[0074] Specifically, the computer device determines the original test cases whose first test results fail and whose second test results pass as lost test cases from the first test results and the second test results respectively corresponding to the original test cases. The computer device constructs an initial set of lost test cases, and determines the set of lost test cases based on the multiple lost test cases.

[0075] For example, the computer device obtains the first test result and the second test result corresponding to each original test case, and based on the case sequence number of the original test case, it traverses the first test result and the second test result of each original test case in turn, and takes the original test case whose first test result is a failure and whose second test result is a pass as a lost test case. The computer device constructs an initial lost test case set, stores all lost test cases in the initial lost test case set, and obtains a lost test case set TF: {TF0, TF1, TF2…TF k}, where TF k is the missing test case with case number k.

[0076] In this embodiment, through the first test results and the second test results corresponding to each original test case, the original test case with the first test result of failure and the second test result of passing is directly used as the lost test case. Thus, the lost test case can be quickly and accurately determined without traversing all version codes, which greatly simplifies the process of determining the lost test case and greatly improves the efficiency of determining the lost test case.

[0077] In one embodiment, Figure 4 As shown, the error version code in the current latest error set is verified based on the current lost test case, and the current error version code corresponding to the current lost test case is determined according to the verification result, including:

[0078] Step S402: Determine the last error version code corresponding to the last lost test case from the current latest error set, and determine the version number of the last error version code.

[0079] Specifically, the computer device determines the last error version code corresponding to the last lost test case from the current latest error set storing the verified error version code, and determines the version number of the last error version code.

[0080] Step S404: based on the version number of the previous error version code, determine an adjacent error version code adjacent to the previous error version code.

[0081] Specifically, the computer device determines two adjacent version numbers corresponding to the version number of the previous error version code based on the version number of the previous error version code, and uses the error version code corresponding to the smallest adjacent version number as the adjacent error version code adjacent to the previous error version code.

[0082] For example, if the version number is represented by CF, the version number of the previous error version code is CF x , that is, the xth version number, then the adjacent version numbers are CF x-1 and CF x+1 , that is, the x-1th version number and the x+1th version number, then the adjacent version numbers CF x-1 The corresponding error version code is used as an adjacent error version code adjacent to the previous error version code.

[0083] Step S406: verify the last erroneous version code through the current lost test case to obtain a first verification result corresponding to the last erroneous version code.

[0084] Specifically, the computer device obtains the current lost test case, verifies the previous error version code through the current lost test case, and obtains a first verification result corresponding to the first error version code.

[0085] Step S408: verify the adjacent error version code through the current loss test case to obtain a first adjacent verification result corresponding to the adjacent error version code.

[0086] Specifically, the computer device obtains the current lost test case, verifies the adjacent error version code through the current lost test case, and obtains a first verification result corresponding to the adjacent error version code.

[0087] Step S410: If the first verification result is a failure and the first adjacent verification result is a pass, it is determined that the current error version code corresponding to the current lost test case is the previous error version code.

[0088] Specifically, the computer device determines whether the first verification result passes based on the first verification result, and determines whether the first adjacent verification result passes based on the first verification result. If the first verification result is not passed and the first adjacent verification result is passed, it is determined that the current error version code corresponding to the current lost test case is the previous error version code.

[0089] It should be noted that if the first verification result is not passed and the first adjacent verification result is passed, it means that the current lost test case is lost due to the previous error version code. At the same time, it is confirmed that the current lost test case and the previous lost test case are two related lost test cases, wherein the error version code of the previous lost test case is the previous error version code.

[0090] In this embodiment, based on the last error version code corresponding to the last lost test case, the adjacent error version code adjacent to the last error version code is determined. The last error version code is verified through the current lost test case to obtain a first verification result, and the adjacent error version code is verified to obtain a second verification result. In this way, based on the first verification result and the second verification result, it can directly and accurately reflect whether the last error version code causes the current lost test verification, that is, a rough judgment verification of the current lost test is achieved. If the first verification result is not passed, and the first adjacent verification result is passed, it can be directly determined that the current error version code of the current lost test is the last error version code, which greatly improves the efficiency of regression testing.

[0091] In one embodiment, Figure 5As shown, the computer device determines the latest version number from the version number set, and determines the next latest version number based on the latest version number. The computer device tests all original test cases with the latest version code of the latest version number to obtain each first test result. The computer device tests all original test cases with the next latest version code of the next latest version number to obtain each second test result. The computer device uses the original test case that fails the first test result and passes the second test result as a lost test case (i.e., in the figure: a test case that needs to be tracked). For the case sequence number of the lost test case, the initial lost test case is determined, and the computer device traverses all version codes of the initial lost test case in turn to obtain the error version code corresponding to the initial lost test case, and puts the error version code corresponding to the initial lost test case into the error set (i.e., in the figure: a single tracking and version number is obtained and put into the error version set), and the number of elements in the error set is 1 at this time. The next lost test case is used as the current lost test case, and the previous error version code is determined from the error set, and the adjacent error version code is determined. The computer device verifies the previous error version code and the adjacent error version code through the current lost test case, and obtains the first verification result and the first adjacent verification result respectively. If the first verification result is not passed and the first adjacent verification result is passed, it is determined that the verification is passed, that is, the current error version code of the current lost test case is the previous error version code, and the next lost test case is determined, and the next lost test case is returned to the step of continuing to execute as the current lost test case (i.e., in the corresponding figure: the first judgment verification is passed, if it is passed, it returns to the next one to be verified in the current error version). If it does not pass, the computer device verifies in a certain order based on each verified error version code in the error set. If the verification passes, it returns to the step of continuing to execute as the next lost test case as the current lost test case (i.e., in the corresponding figure: the second judgment verification is passed, if it is passed, it returns to the next one to be verified in the current error version). If the verification fails, all original test cases are verified through the current lost test case to obtain the current error version code corresponding to the current lost test case, and put it into the error set (i.e., in the corresponding figure: return to a single trace and obtain the error version number and put it into the error version set).

[0092] In this embodiment, the current lost test case to be verified in the lost test case set is determined, and the current latest error set is obtained. Based on the current lost test case, the previous error version code in the error set is verified in advance. If the verification is successful, it can be directly and accurately determined that the previous error version code caused the loss of the current lost test case, and the next lost test case is verified as the current lost test case. If the verification fails, the secondary verification is continued in a certain order in the current latest error set. If it can be determined that the secondary verification is successful in the current latest error set, that is, the current error version code corresponding to the current lost test case can be determined, and then the next lost test case is verified as the current lost test case. In this way, it is avoided to traverse all version codes when the preliminary verification fails, thereby greatly improving the efficiency of regression testing. In addition, if the error version code corresponding to the current lost test case cannot be determined in the error set, that is, the secondary verification fails, all version codes are traversed at last to determine the current error version code of the current lost test case. In this way, on the basis of ensuring the accuracy of regression testing, unnecessary repeated verification is also reduced, and time cost is reduced, that is, the efficiency of code regression testing is greatly improved.

[0093] In one embodiment, Figure 6 As shown, the method also includes:

[0094] Step S602: If both the first verification result and the first adjacent verification result fail, the version number of the previous error version code is used as the node label, and based on the current latest error set, it is determined whether there is an error version code with a version number smaller than the node label.

[0095] Specifically, if both the first verification result and the first adjacent verification result are failed, the computer device uses the version number of the last error version as the node label. Based on the current latest error set, the computer device determines the version number of each verified error version code, and based on each version number, determines whether there is an error version code with a version number smaller than the node label.

[0096] It should be noted that if the first verification result and the first adjacent verification result both fail, it can be directly determined that an error version code newer than the previous error version also causes the loss of the current lost test case, that is, the error version code newer than the previous error version is not the target error version code that initially caused the loss of the current lost test case.

[0097] Step S604, if it exists, then use the error version code whose version number is less than the node label as the first code, and pass the current missing test case, and verify based on the first code to obtain a second verification result, and determine the current error version code corresponding to the current missing test case based on the second verification result.

[0098] Specifically, if it exists, the computer device uses the error version code with a version number less than the node number as the first code. Based on the order of the version numbers of at least one first code, a first target error version code is determined from the version number of at least one first code, and then the first target error version code is verified through the current missing test case to obtain a second verification result. The computer device determines the current error version code corresponding to the current missing test case based on the second verification result.

[0099] Step S606: If it does not exist, then based on the current missing test case, verify the multiple version codes in the version set respectively to obtain third verification results corresponding to each version code respectively, and determine the current error version code corresponding to the current missing test case based on the third verification results corresponding to each version code respectively.

[0100] Specifically, if it does not exist, then based on the version set, a version set containing multiple version codes is obtained. Based on the current missing test case, the computer device verifies the multiple version codes in the version set respectively, and obtains third verification results corresponding to each version code. Based on the third verification results corresponding to each version code, the computer device determines the current error version code corresponding to the current missing test case, and adds the current error version code to the current latest error set to obtain an updated current latest error set. Among them, the updated current latest error set is used as the current latest error set corresponding to the next missing test case to be verified.

[0101] In this embodiment, if both the first verification result and the first adjacent verification result fail, the version number of the previous error version code is used as the node number, and it is determined whether there is an error version code with a version number less than the node number, thereby dividing the current latest error set to avoid verifying all error version codes in the current latest error set. If it exists, the error version code less than the node number is used as the first code, and the current missing test case is passed, and verification is performed based on the first code to determine the current error version code, thereby being able to quickly and accurately determine the current error version code, thereby improving the efficiency of the regression test results. If it does not exist, it means that the current error version code corresponding to the current missing test case does not exist in the current latest error set, and all version codes in the version set are directly traversed to ensure that the current error version code is found, thereby ensuring the correctness of the regression test results.

[0102] In one embodiment, Figure 7 As shown, the current lost test case is passed, and verification is performed based on the first code to obtain a second verification result, and the current error version code corresponding to the current lost test case is determined based on the second verification result, including:

[0103] Step S702: The error version code with the largest version number in the first code is used as the first target error version code.

[0104] Specifically, the computer device sorts the version numbers of at least one first code from large to small, and uses the error version code with the largest version number in the first code as the first target error version code, wherein the error version code with the largest version number is determined to be newer.

[0105] Step S704: Based on the first target error version code, determine a first adjacent target error version code corresponding to the first target error version code.

[0106] Specifically, the computer device uses the previous version code of the first target error version code as the first adjacent target error version code based on the first target error version code, wherein the version number of the first adjacent target error version code is adjacent to the version number of the first target error version code, and the version number of the first adjacent target error version code is smaller than the version number of the first target error version code.

[0107] Step S706: verify the first target error version code through the current missing test case to obtain a second verification result corresponding to the first target error version code.

[0108] Specifically, the computer device obtains the current missing test case, and verifies the first target error version code through the current missing test case to obtain a second verification result corresponding to the first target error version code.

[0109] Step S708: verify the first adjacent target error version code through the current loss test case to obtain a second adjacent verification result corresponding to the first adjacent target error version code.

[0110] Specifically, the computer device obtains a current lost test case, verifies the first adjacent target error version code through the current lost test case, and obtains a second adjacent verification result corresponding to the first adjacent target error version code.

[0111] Step S710: If the second verification result is a failure and the second adjacent verification result is a pass, then determine that the current error version code corresponding to the current lost test case is the first target error version code.

[0112] Specifically, the computer device determines whether the second verification result passes based on the second verification result, and determines whether the second adjacent verification result passes based on the second adjacent verification result. If the second verification result is not passed and the second adjacent verification result is passed, the current error version code corresponding to the current lost test case is determined to be the first target error version code.

[0113] It should be noted that if the second verification result is failure and the second adjacent verification result is passing, it means that the current lost test case is lost due to the first target erroneous version code.

[0114] In this embodiment, the error version code with the largest version number in the first code is used as the first target error version code to determine the latest error version code in the first code, so that the error version code associated with the current missing test case can be directly determined from the current latest error set, thereby ensuring the accuracy and effectiveness of the verification. The first adjacent target error version code is determined based on the first target error version code. In this way, based on the first target error version code and the first adjacent target error version code, a secondary verification is implemented in the current latest error set. The first target error version code is verified through the current missing test case to obtain a second verification result, and the first adjacent error version code is verified through the current missing test case to obtain a second adjacent verification result. In this way, based on the second verification result and the second adjacent verification result, it is possible to avoid directly traversing and verifying all version codes, greatly simplifying the steps of regression testing, and ensuring the effectiveness and accuracy of regression testing results.

[0115] In one embodiment, the method also includes: if both the second verification result and the second adjacent verification result fail, then updating the node label based on the version number of the first target error version code, and returning to the step of determining whether there is an error version code with a version number less than the node label based on the current latest error set to continue execution.

[0116] Specifically, if both the second verification result and the second adjacent verification result fail, the computer device determines that the version number of the error version code corresponding to the current lost test case is smaller than the version number of the first target error version code, and the computer device updates the version number of the first target error version code to the node number, and returns to the step of determining whether there is an error version code with a version number smaller than the node number based on the current latest error set to continue execution.

[0117] In this embodiment, if both the second verification result and the second adjacent verification result fail, it can be quickly determined that the version number of the error version code of the current missing test case is smaller than the version number of the first target error version code. Thus, the version number of the first target error version code can be directly updated to the node number, and the step of judging whether there is an error version code with a version number smaller than the node number based on the current latest error set is returned to continue execution. Thus, based on the current latest error set, secondary verification is continued, effectively avoiding traversal of all version codes in the version set, and greatly improving the efficiency of regression testing.

[0118] In one embodiment, the method also includes: if the second verification result and the second adjacent verification result are both passed, then based on the current test case, multiple version codes in the version set are verified separately to obtain fourth verification results corresponding to each version code, and the current error version code corresponding to the current lost test case is determined based on the fourth verification result.

[0119] Specifically, if both the second verification result and the second adjacent verification result fail, the computer device determines that the error version code corresponding to the current lost test case does not exist in the current latest error set, and then the computer device verifies the multiple version codes in the version set based on the current test case, and obtains fourth verification results corresponding to each version code. The computer device determines the current error version code corresponding to the current lost test case based on the fourth verification result.

[0120] It should be noted that, during the verification process of each version code, it is necessary to combine the version code and the previous version code adjacent to the version to jointly determine whether the version code is the current error version code corresponding to the current missing test case.

[0121] In this embodiment, if both the second verification result and the second adjacent verification result pass, it indicates that there is no error version code corresponding to the current missing test case in the current latest error set, then all version codes in the version set are directly traversed to ensure that the current error version code is found, thereby ensuring the correctness of the regression test results.

[0122] In one embodiment, Figure 8 As shown, the method also includes:

[0123] Step S802, if the first verification result and the first adjacent verification result are both passed, the version number of the previous error version code is used as the node label, and based on the current latest error set, it is determined whether there is an error version code with a version number greater than the node label.

[0124] Specifically, if the first verification result and the first adjacent verification result are both passed, the computer device uses the version number of the previous error version code as the node label. The computer device determines the version number of each verified error version code based on the current latest error set, and based on each version number, determines whether there is an error version code with a version number greater than the node label.

[0125] It should be noted that if both the first verification result and the second verification result pass, it can be directly determined that an error version code older than the previous error version will not cause the loss of the currently lost test case, that is, the loss of the currently lost test case has nothing to do with an error version code older than the previous error version.

[0126] Step S804, if it exists, then use the error version code whose version number is greater than the node label as the second code, and pass the current lost test case, and verify based on the second code to obtain the fifth verification result, and determine the current error version code corresponding to the current lost test case based on the fifth verification result.

[0127] Specifically, if it exists, the computer device uses the error version code with a version number greater than the node number as the second code. Based on the order of the version numbers of at least one second code, the second target error version code is determined from the version number of at least one second code, and then the second target error version code is verified through the current missing test case to obtain a fifth verification result. The computer device determines the current error version code corresponding to the current missing test case based on the fifth verification result.

[0128] Step S806: If it does not exist, then based on the current missing test case, multiple version codes in the version set are verified respectively to obtain sixth verification results corresponding to each version code.

[0129] Specifically, if it does not exist, the computer device obtains a version set including multiple version codes based on the version set. The computer device verifies multiple version codes in the version set based on the current missing test case to obtain sixth verification results corresponding to each version code.

[0130] Step S808: Determine the current error version code corresponding to the current missing test case based on the sixth verification results corresponding to each version code.

[0131] Specifically, the computer device determines the current error version code corresponding to the current missing test case based on the sixth verification results corresponding to each version code, and adds the current error version code to the current latest error set to obtain an updated current latest error set. The updated current latest error set is used as the current latest error set corresponding to the next missing test case to be verified.

[0132] In this embodiment, if the first verification result and the first adjacent verification result are both passed, the version number of the previous error version code is used as the node number, and it is determined whether there is an error version code with a version number greater than the node number, thereby dividing the current latest error set to avoid verifying all error version codes in the current latest error set. If it exists, the error version code greater than the node number is used as the second code, and the current missing test case is passed, and verification is performed based on the second code to determine the current error version code, thereby being able to quickly and accurately determine the current error version code, thereby improving the efficiency of the regression test results. If it does not exist, it means that the current error version code corresponding to the current missing test case does not exist in the current latest error set, and all version codes in the version set are directly traversed to ensure that the current error version code is found, thereby ensuring the correctness of the regression test results.

[0133] In one embodiment, Fig. 9 As shown, the current lost test case is passed, and verification is performed based on the second code to obtain a fifth verification result, and the current error version code corresponding to the current lost test case is determined based on the fifth verification result, including:

[0134] Step S902: The error version code with the largest version number in the second code is used as the second target error version code.

[0135] Specifically, the computer device sorts the version numbers of at least one second code from large to small, and uses the error version code with the largest version number in the second code as the second target error version code, wherein the error version code with the largest version number is determined to be newer.

[0136] Step S904: Based on the second target error version code, determine a second adjacent target error version code corresponding to the second target error version code.

[0137] Specifically, the computer device uses the previous version code of the second target error version code as the second adjacent target error version code based on the second target error version code, wherein the version number of the second adjacent target error version code is adjacent to the version number of the second target error version code, and the version number of the second adjacent target error version code is smaller than the version number of the second target error version code.

[0138] Step S906: verify the second target error version code through the current lost test case to obtain a fifth verification result corresponding to the second target error version code.

[0139] Specifically, the computer device obtains the current lost test case, and verifies the second target error version code through the current lost test case to obtain a fifth verification result corresponding to the second target error version code.

[0140] Step S908: verify the second adjacent target error version code through the current loss test case to obtain a fifth adjacent verification result corresponding to the second adjacent target error version code.

[0141] Specifically, the computer device obtains a current lost test case, verifies the second adjacent target error version code through the current lost test case, and obtains a fifth adjacent verification result corresponding to the second adjacent error version code.

[0142] Step S910: If the fifth verification result is a failure and the fifth adjacent verification result is a pass, then determine that the current error version code corresponding to the current lost test case is the second target error version code.

[0143] Specifically, the computer device determines whether the fifth verification result passes based on the fifth verification result, and determines whether the fifth adjacent verification result passes based on the fifth adjacent verification result. If the fifth verification result is not passed and the fifth adjacent verification result is passed, the current error version code corresponding to the current lost test case is determined to be the second target error version code.

[0144] It should be noted that if the fifth verification result is a failure, and the fifth verification result is a pass, it means that the current lost test case is lost due to the second target erroneous version code.

[0145] In this embodiment, the error version code with the largest version number in the second code is used as the second target error version code to determine the latest error version code in the second code, so that the error version code associated with the current lost test case can be directly determined from the current latest error set, thereby ensuring the accuracy and effectiveness of the verification. The second adjacent error version code is determined based on the second target error version code, so that a secondary verification is performed in the current latest error set based on the second target error version code and the second adjacent error version code. The second target error version code is verified through the current lost test case to obtain the fifth verification result, and the second adjacent error version code is verified through the current lost test to obtain the fifth adjacent verification result. In this way, based on the fifth verification result and the fifth adjacent verification result, it is possible to avoid directly traversing and verifying multiple version codes, greatly simplifying the steps of regression testing, and ensuring the effectiveness and accuracy of regression testing results.

[0146] In one embodiment, the method also includes: if the fifth verification result and the fifth adjacent verification result are both passed, the node label is updated based on the version number of the second target error version code, and the step of determining whether there is an error version code with a version number greater than the node label based on the current latest error set is returned to continue execution.

[0147] Specifically, if the fifth verification result and the fifth adjacent verification result are both passed, the computer device determines that the version number of the error version code corresponding to the current lost test case is greater than the version number of the second target error version code, the computer device updates the version number of the second target error version code to the node number, and returns to the step of determining whether there is an error version code with a version number less than the node number based on the current latest error set to continue execution.

[0148] In this embodiment, if the fifth verification result and the fifth adjacent verification result are both passed, it can be quickly determined that the version number of the error version code of the current missing test case is greater than the version number of the first target error version code, thereby directly updating the node label with the version number of the second target error version code, and returning to the step of judging whether there is an error version code with a version number greater than the node label based on the current latest error set to continue execution, thereby continuing to perform secondary verification based on the current latest error set, effectively avoiding traversal of all version codes in the version set, and greatly improving the efficiency of regression testing.

[0149] In one embodiment, the method also includes: if both the fifth verification result and the fifth adjacent verification result fail, then based on the current test case, verifying multiple version codes in the version set respectively, obtaining sixth verification results corresponding to each version code respectively, and determining the current error version code corresponding to the current lost test case based on the sixth verification result.

[0150] Specifically, if both the fifth verification result and the fifth adjacent verification result fail, the computer device determines that the error version code corresponding to the current lost test case does not exist in the current latest error set, and then the computer device verifies multiple version codes in the version set based on the current test case, and obtains a sixth verification result corresponding to each version code. The computer device determines the current error version code corresponding to the current lost test case based on the sixth verification result.

[0151] It should be noted that, during the verification process of each version code, it is necessary to combine the version code and the previous version code adjacent to the version to jointly determine whether the version code is the current error version code corresponding to the current missing test case.

[0152] In this embodiment, if both the fifth verification result and the fifth adjacent verification result fail, it indicates that there is no error version code corresponding to the current lost test case in the current latest error set, then all version codes in the version set are directly traversed to ensure that the current error version code is found, thereby ensuring the correctness of the regression test results.

[0153] In one embodiment, Fig.10 As shown, taking the lost test set TF:{TF0,TF1,TF2} as an example.

[0154] Step (a): Starting from the missing test case TF0, traverse all version codes in the version set through the missing test case TF0 for verification. If version code C i The verification result is not passed, and the version code is C i-1 If the verification result is passed, it is determined that the error version code of the missing test case TF0 is version code C i , recorded as the error version code C i . Change the error version code to C i Record the latest error set CF.

[0155] Step (b): For the missing test case TF1, first i Verification and error version code C i Adjacent version code C i-1 Verify if the error version code C iThe verification result is not passed, and the version code is C i-1 If the verification result is passed, the error version code C of the missing test case TF1 is determined. i , and continue to track the next missing test case TF2. i and version code C i-1 If the verification results are all passed or failed, the missing test case TF1 will be used to traverse all version codes in the version set for verification until version code C is found. j Failed, and version code C j-1 If it passes, it is determined that the wrong version code of the missing test case TF1 is version code C j , which is the error version code C j . Change the version code to C j The latest error set CF is recorded, that is, there are two error version codes.

[0156] Step (c): For the missing test case TF2, first use the missing test case TF2 to test the wrong version code C j and adjacent version code C j-1 Verify, if the error version code C j Failed, and version code C j-1 If it passes, the error version code of the missing test case TF2 is determined to be C j If the error version code is C j and version code C j-1 If all pass or all fail, the verification fails and the latest error set is verified. Specifically, there are two situations, as shown in Table 1:

[0157] Table 1 Verification status

[0158]

[0159] Among them, in Table 1, if it is verified that there is no error version code of the missing test case TF2 in the currently updated error set CF, then all version codes C in the version set are traversed through the missing test case TF2 n Verify until version code C is found x Failed, and version code C x-1 If it passes, it is determined that the error version code of the missing test case TF2 is version code C x , which is the error version code C x . Change the version code to C x Record the latest error set CF.

[0160] In this embodiment, the current lost test case to be verified in the lost test case set is determined, and the current latest error set is obtained. Based on the current lost test case, the previous error version code in the error set is verified in advance. If the verification is successful, it can be directly and accurately determined that the previous error version code caused the loss of the current lost test case, and the next lost test case is verified as the current lost test case. If the verification fails, the secondary verification is continued in a certain order in the current latest error set. If it can be determined that the secondary verification is successful in the current latest error set, that is, the current error version code corresponding to the current lost test case can be determined, and then the next lost test case is verified as the current lost test case. In this way, it is avoided to traverse all version codes when the preliminary verification fails, thereby greatly improving the efficiency of regression testing. In addition, if the error version code corresponding to the current lost test case cannot be determined in the error set, that is, the secondary verification fails, all version codes are traversed at last to determine the current error version code of the current lost test case. In this way, on the basis of ensuring the accuracy of regression testing, unnecessary repeated verification is also reduced, and time cost is reduced, that is, the efficiency of code regression testing is greatly improved.

[0161] In order to facilitate a clearer understanding of the technical solution of the present application, a more detailed embodiment is provided for explanation. Fig.11 As shown, we now need to determine that the current missing test case is TF k The wrong version code.

[0162] Step 1: If the last error version code corresponding to the last lost test case is CF x , if the current missing test case TF is passed k CF x Verify, that is, verify CF separately x , and CF x Adjacent version code CF x-1 If CF x The verification result is not passed, and CF x-1 If the verification result is passed, then CF is determined x If the verification is successful, the current missing test case TF is determined k The error version code is CF x .

[0163] Step 2: If CF x If the verification fails, CF x and CF x-1 The verification results are all passed.

[0164] Step 3: If CF x and CF x-1If the verification results are all failed, CF x As the node number, determine whether there is an error version code with a version number less than the node number from the current latest error set CF. If not, directly traverse all version codes in the version set to determine TF k The wrong version code and TF k The error version code of is added to the current latest error set to obtain the updated current latest error set. If it exists, the error version code with a version number less than the node number is used as the first code, that is, the first code in the corresponding figure is CF0 to CF y (Old to new). Put the latest CF in the first code y As the first target error version code. If CF y The verification result is not passed, and CF y-1 If the verification result is passed, then CF is determined y If the verification is successful, the current missing test case TF is determined k The error version code is CF y (That is, the corresponding figure confirms the wrong version). If CF y The verification result is passed, and CF y-1 If the verification result is passed, all version codes in the version set are directly traversed to determine the TF k The wrong version code and TF k The error version code is added to the current latest error set to obtain the updated current latest error set. y The verification result is not passed, and CF y-1 If the verification result is not passed, CF y Update to the node number, and return to the step of determining whether there is an error version code with a version number less than the node number from the current latest error set CF to continue execution. Among them, if the first target error version code tests the oldest CF0 in the first code, and CF0 still fails, directly traverse all version codes in the version set to determine TF k The wrong version code and TF k The error version code is added to the current latest error set to obtain an updated current latest error set.

[0165] Step 3: If CF x and CF x-1 If the verification results are all passed, then CF x As the node number, determine whether there is an error version code with a version number greater than the node number from the current latest error set CF. If not, directly traverse all version codes in the version set to determine TF k The wrong version code and TFk The error version code is added to the current latest error set to obtain an updated current latest error set.

[0166] If it exists, the error version code with a version number greater than the node number is used as the second code, that is, the second code in the corresponding figure is CF z To CF p (Old to new). The latest CF in the second code p As the second target error version code. If CF p The verification result is not passed, and CF p-1 If the verification result is passed, then CF is determined p If the verification is successful, the current missing test case TF is determined k The error version code is CF p If CF p The verification result is passed, and CF p-1 If the verification result is passed, all version codes in the version set are directly traversed to determine the TF k The wrong version code and TF k The error version code is added to the current latest error set to obtain the updated current latest error set. p The verification result is passed, and CF p-1 If the verification result is passed, CF p Update to the node number, and return to the step of determining whether there is an error version code with a version number greater than the node number in the current latest error set CF to continue execution. Among them, if the second target error version code tests the oldest CF in the second code z , and CF z If it still fails, directly traverse all version codes in the version collection to determine the TF k The wrong version code and TF k The error version code is added to the current latest error set to obtain an updated current latest error set.

[0167] In addition, in the above embodiment, if there are 13 missing test cases, the results of determining the wrong version code for each missing test case are as shown in Table 2 below:

[0168] Table 2 Test results of each missing test case

[0169]

[0170] In the above Table 2, it can be calculated that the time used to test all the missing test cases is 1.63 hours. In the prior art, for each missing test case, all version codes are traversed to determine the wrong version code of each missing test case, and the time spent is 5.83 hours. In addition, for each missing test case, the previous wrong version code of the previous lost test case is determined, and the current lost test case is tested based on the previous wrong version code. If the test is unsuccessful, all version codes are traversed. At this time, the time spent is 2.55 hours. Therefore, in the present application, regression testing is performed by constructing an error set. Obviously, the time cost is minimized and repeated testing is avoided, which greatly improves the efficiency of regression testing.

[0171] In this embodiment, the current lost test case to be verified in the lost test case set is determined, and the current latest error set is obtained. Based on the current lost test case, the previous error version code in the error set is verified in advance. If the verification is successful, it can be directly and accurately determined that the previous error version code caused the loss of the current lost test case, and the next lost test case is verified as the current lost test case. If the verification fails, the secondary verification is continued in a certain order in the current latest error set. If it can be determined that the secondary verification is successful in the current latest error set, that is, the current error version code corresponding to the current lost test case can be determined, and then the next lost test case is verified as the current lost test case. In this way, it is avoided to traverse all version codes when the preliminary verification fails, thereby greatly improving the efficiency of regression testing. In addition, if the error version code corresponding to the current lost test case cannot be determined in the error set, that is, the secondary verification fails, all version codes are traversed at last to determine the current error version code of the current lost test case. In this way, on the basis of ensuring the accuracy of regression testing, unnecessary repeated testing is reduced, test resources are saved, and the efficiency of code regression testing is greatly improved. In addition, for each currently missing test case, preliminary verification and secondary verification are performed based on the latest error set, which can determine the scope of the error version code to reduce misjudgment and improve the error accuracy. At the same time, it can also achieve rapid error correction, which promotes the research and development process.

[0172] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0173] Based on the same inventive concept, the embodiment of the present application also provides a code regression testing device for implementing the code regression testing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more code regression testing device embodiments provided below can refer to the limitations of the code regression testing method above, and will not be repeated here.

[0174] In one embodiment, Fig.12 As shown, a code regression testing device is provided, including: an acquisition module 1202, a first determination module 1204, a verification module 1206, an execution module 1208 and a second determination module 1210, wherein:

[0175] The acquisition module 1202 is used to acquire a set of missing test cases, where the set of missing test cases is a set of test cases determined to be missing after testing original test cases based on codes of different versions.

[0176] The first determining module 1204 is used to determine the current missing test case to be verified in the missing test case set, and obtain the current latest error set, where the current latest error set contains the verified error version code.

[0177] Verification module 1206 is used to verify the error version code in the current latest error set based on the current missing test case, and determine the current error version code corresponding to the current missing test case according to the verification result; the current error version code is used to update the error set.

[0178] Execution module 1208 is used to use the next lost test case to be verified in the lost test case set as the current lost test case corresponding to the next verification, and return to the step of obtaining the current latest error set to continue execution until the error version codes corresponding to all lost test cases are obtained.

[0179] The second determining module 1210 is used to determine the code regression test result based on the error version codes respectively corresponding to the multiple missing test cases.

[0180] In one embodiment, the acquisition module 1202 is used to acquire the latest version code and the next latest version code. Each original test case is tested respectively by the latest version code to obtain a first test result corresponding to the latest version code. Each original test case is tested respectively by the next latest version code to obtain a second test result corresponding to the next latest version code. According to the first test result and the second test result, a set of lost test cases lost in the original test case is determined.

[0181] In one embodiment, the acquisition module 1202 is configured to determine the original test case whose first test result is failure and whose second test result is passing as a lost test case. Based on the multiple lost test cases, a lost test case set is determined.

[0182] In one embodiment, the verification module 1206 is used to determine the last error version code corresponding to the last lost test case from the current latest error set, and determine the version number of the last error version code. Based on the version number of the last error version code, determine the adjacent error version code adjacent to the last error version code. The last error version code is verified by the current lost test case to obtain a first verification result corresponding to the last error version code. The adjacent error version code is verified by the current lost test case to obtain a first adjacent verification result corresponding to the adjacent error version code. If the first verification result is not passed and the first adjacent verification result is passed, it is determined that the current error version code corresponding to the current lost test case is the last error version code.

[0183] In one embodiment, the verification module 1206 is also used to use the version number of the previous error version code as the node number if both the first verification result and the first adjacent verification result fail, and determine whether there is an error version code with a version number less than the node number based on the current latest error set. If it exists, the error version code with a version number less than the node number is used as the first code, and passes the current lost test case, and is verified based on the first code to obtain a second verification result, and the current error version code corresponding to the current lost test case is determined based on the second verification result. If it does not exist, then based on the current lost test case, multiple version codes in the version set are verified respectively to obtain third verification results corresponding to each version code, and the current error version code corresponding to the current lost test case is determined based on the third verification results corresponding to each version code.

[0184] In one embodiment, the verification module 1206 is also used to use the error version code with the largest version number in the first code as the first target error version code. Based on the first target error version code, determine the first adjacent target error version code corresponding to the first target error version code. The first target error version code is verified by the current loss test case to obtain a second verification result corresponding to the first target error version code. The first adjacent target error version code is verified by the current loss test case to obtain a second adjacent verification result corresponding to the first adjacent target error version code. If the second verification result is not passed and the second adjacent verification result is passed, it is determined that the current error version code corresponding to the current loss test case is the first target error version code.

[0185] In one embodiment, the verification module 1206 is also used to update the node label based on the version number of the first target error version code if both the second verification result and the second adjacent verification result fail, and return to the step of determining whether there is an error version code with a version number smaller than the node label based on the current latest error set to continue execution.

[0186] In one embodiment, the verification module 1206 is also used to verify multiple version codes in the version set based on the current test case if both the second verification result and the second adjacent verification result are passed, to obtain fourth verification results corresponding to each version code, and determine the current error version code corresponding to the current lost test case based on the fourth verification result.

[0187] In one embodiment, the verification module 1206 is also used to use the version number of the previous error version code as the node number if both the first verification result and the first adjacent verification result are passed, and to determine whether there is an error version code with a version number greater than the node number based on the current latest error set. If it exists, the error version code with a version number greater than the node number is used as the second code, and passes the current lost test case, and is verified based on the second code to obtain a fifth verification result, and the current error version code corresponding to the current lost test case is determined based on the fifth verification result. If it does not exist, then based on the current lost test case, multiple version codes in the version set are verified respectively to obtain sixth verification results corresponding to each version code. Based on the sixth verification results corresponding to each version code, the current error version code corresponding to the current lost test case is determined.

[0188] In one embodiment, the verification module 1206 is also used to use the error version code with the largest version number in the second code as the second target error version code. Based on the second target error version code, determine the second adjacent target error version code corresponding to the second target error version code. The second target error version code is verified by the current loss test case to obtain a fifth verification result corresponding to the second target error version code. The second adjacent target error version code is verified by the current loss test case to obtain a fifth adjacent verification result corresponding to the second adjacent target error version code. If the fifth verification result is not passed and the fifth adjacent verification result is passed, it is determined that the current error version code corresponding to the current loss test case is the second target error version code.

[0189] In one embodiment, the verification module 1206 is also used to update the node label based on the version number of the second target error version code if both the fifth verification result and the fifth adjacent verification result are passed, and return to the step of determining whether there is an error version code with a version number greater than the node label based on the current latest error set to continue execution.

[0190] In one embodiment, the verification module 1206 is also used to verify multiple version codes in the version set based on the current test case if both the fifth verification result and the fifth adjacent verification result fail, to obtain a sixth verification result corresponding to each version code, and determine the current error version code corresponding to the current lost test case based on the sixth verification result.

[0191] Each module in the above-mentioned code regression testing device can be implemented in whole or in part by software, hardware and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0192] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig.13As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store code regression test data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a code regression test method is implemented.

[0193] Those skilled in the art will understand that Fig.13 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0194] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0195] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0196] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0197] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0198] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0199] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A code regression testing method, characterized in that: The method comprises: Get the latest version code and the next latest version code; Each original test case is tested respectively by using the latest version of the code to obtain a first test result corresponding to the latest version of the code; Each original test case is tested respectively by using the next-to-latest version code to obtain a second test result corresponding to the next-to-latest version code; Determine the original test case whose first test result is failure and whose second test result is passing as a lost test case; Based on the multiple missing test cases, determining a missing test case set; Determine the current lost test case to be verified in the lost test case set, and obtain the current latest error set, wherein the current latest error set contains the verified error version code; Determine the last error version code corresponding to the last lost test case from the current latest error set, and determine the version number of the last error version code; Based on the version number of the previous error version code, determining an adjacent error version code adjacent to the previous error version code; Verifying the last erroneous version code by using the current lost test case to obtain a first verification result corresponding to the last erroneous version code; Verifying the adjacent error version code through the current loss test case to obtain a first adjacent verification result corresponding to the adjacent error version code; If the first verification result is a failure and the first adjacent verification result is a pass, determining that the current error version code corresponding to the current lost test case is a previous error version code; the current error version code is used to update the error set; The next lost test case to be verified in the lost test case set is used as the current lost test case corresponding to the next verification, and the step of obtaining the current latest error set is returned to continue execution until the error version codes corresponding to all the lost test cases are obtained; The code regression test result is determined based on the erroneous version codes corresponding to the multiple missing test cases.

2. The method according to claim 1, characterized in that The method further comprises: If both the first verification result and the first adjacent verification result fail, the version number of the last error version code is used as the node number, and based on the current latest error set, it is determined whether there is an error version code with a version number smaller than the node number; If it exists, the error version code whose version number is smaller than the node number is used as the first code, and the current missing test case is passed, and verification is performed based on the first code to obtain a second verification result, and the current error version code corresponding to the current missing test case is determined based on the second verification result; If it does not exist, then based on the current missing test case, multiple version codes in the version set are verified separately to obtain third verification results corresponding to each version code respectively, and based on the third verification results corresponding to each version code respectively, the current error version code corresponding to the current missing test case is determined.

3. The method according to claim 2, characterized in that The step of passing the current lost test case and verifying based on the first code to obtain a second verification result, and determining a current error version code corresponding to the current lost test case based on the second verification result, includes: Using the error version code with the largest version number in the first codes as the first target error version code; Based on the first target error version code, determining a first adjacent target error version code corresponding to the first target error version code; Verifying the first target error version code through the current loss test case to obtain a second verification result corresponding to the first target error version code; Verifying the first adjacent target error version code through the current loss test case to obtain a second adjacent verification result corresponding to the first adjacent target error version code; If the second verification result is a failure and the second adjacent verification result is a pass, then the current error version code corresponding to the current lost test case is determined to be the first target error version code.

4. The method according to claim 3, characterized in that The method further comprises: If both the second verification result and the second adjacent verification result fail, the node label is updated based on the version number of the first target error version code, and the step of determining whether there is an error version code with a version number smaller than the node label based on the current latest error set is returned to continue execution.

5. The method according to claim 3, characterized in that: The method further comprises: If both the second verification result and the second adjacent verification result pass, then based on the current lost test case, multiple version codes in the version set are verified separately to obtain fourth verification results corresponding to each version code, and the current error version code corresponding to the current lost test case is determined based on the fourth verification result.

6. The method according to claim 1, characterized in that The method further comprises: If both the first verification result and the first adjacent verification result are passed, the version number of the last error version code is used as the node label, and based on the current latest error set, it is determined whether there is an error version code with a version number greater than the node label; If it exists, then use the error version code whose version number is greater than the node number as the second code, pass the current lost test case, and verify based on the second code to obtain a fifth verification result, and determine the current error version code corresponding to the current lost test case based on the fifth verification result; If not, then based on the current missing test case, verify the multiple version codes in the version set respectively to obtain sixth verification results corresponding to the respective version codes; Based on the sixth verification results respectively corresponding to the respective version codes, a current error version code corresponding to the current lost test case is determined.

7. The method according to claim 6, characterized in that The step of passing the current lost test case and performing verification based on the second code to obtain a fifth verification result, and determining a current error version code corresponding to the current lost test case based on the fifth verification result, comprises: Using the error version code with the largest version number in the second codes as the second target error version code; Based on the second target error version code, determining a second adjacent target error version code corresponding to the second target error version code; Verifying the second target error version code by using the current loss test case to obtain a fifth verification result corresponding to the second target error version code; Verifying the second adjacent target error version code by using the current loss test case to obtain a fifth adjacent verification result corresponding to the second adjacent target error version code; If the fifth verification result is a failure and the fifth adjacent verification result is a pass, then the current error version code corresponding to the current lost test case is determined to be the second target error version code.

8. The method according to claim 7, characterized in that The method further comprises: If both the fifth verification result and the fifth adjacent verification result pass, the node label is updated based on the version number of the second target error version code, and the step of determining whether there is an error version code with a version number greater than the node label based on the current latest error set is returned to continue execution.

9. The method according to claim 1, characterized in that: The method further comprises: If both the fifth verification result and the fifth adjacent verification result fail, then based on the current lost test case, multiple version codes in the version set are verified separately to obtain the sixth verification results corresponding to each version code, and the current error version code corresponding to the current lost test case is determined based on the sixth verification result.

10. A code regression testing device, characterized in that: The device comprises: An acquisition module is used to acquire the latest version code and the next latest version code; each original test case is tested respectively by the latest version code to obtain a first test result corresponding to the latest version code; each original test case is tested respectively by the next latest version code to obtain a second test result corresponding to the next latest version code; an original test case for which the first test result is a failure and the second test result is a pass is determined as a lost test case; based on multiple lost test cases, a lost test case set is determined; A first determination module is used to determine the current lost test case to be verified in the lost test case set, and obtain the current latest error set, wherein the current latest error set contains the verified error version code; A verification module, used to determine the previous error version code corresponding to the previous lost test case from the current latest error set, and determine the version number of the previous error version code; determine the adjacent error version code adjacent to the previous error version code based on the version number of the previous error version code; verify the previous error version code through the current lost test case to obtain a first verification result corresponding to the previous error version code; verify the adjacent error version code through the current lost test case to obtain a first adjacent verification result corresponding to the adjacent error version code; if the first verification result is failed and the first adjacent verification result is passed, determine that the current error version code corresponding to the current lost test case is the previous error version code; the current error version code is used to update the error set; An execution module, used to use the next lost test case to be verified in the lost test case set as the current lost test case corresponding to the next verification, and return to the step of obtaining the current latest error set to continue execution until the error version codes corresponding to all the lost test cases are obtained; The second determination module is used to determine the code regression test result based on the error version codes respectively corresponding to the multiple missing test cases.

11. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

12. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 9 are implemented.