Software regression testing method and device, electronic equipment and storage medium

By using automated test scripts and machine learning models to calculate the similarity of software regression test results, combined with test step information and personnel confirmation, the problem of high testing costs and long processing times in existing technologies is solved, achieving efficient and accurate software regression testing.

CN116010278BActive Publication Date: 2026-04-07NORTH CHINA DIGITAL HEALTH TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-17
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies for software regression testing are costly, time-consuming, and require the maintenance of test scripts, leading to increased manpower and time costs.

Method used

Automated test scripts are used to test the software. A machine learning model is used to calculate the similarity between the current test result screenshot and the historical test result screenshot. Combined with the test step name and path information, the matching historical test result screenshot is automatically selected to determine the current test result. Grid segmentation and tester confirmation are used to improve accuracy.

Benefits of technology

It automates software regression testing, reduces testing costs and time, improves testing efficiency, and ensures the accuracy of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116010278B_ABST
    Figure CN116010278B_ABST
Patent Text Reader

Abstract

The application provides a software regression testing method and device, electronic equipment and storage medium, the method comprises the following steps: testing the first software by using an automatic test script, obtaining a current test result screenshot of the first software at a current test step; determining the similarity between the current test result screenshot and the historical test result screenshots of the second software at each historical step, the historical test result screenshots are obtained by testing the second software by using the automatic test script, and the first software is an upgraded version of the second software; according to the similarity, selecting a screenshot matched with the current test result screenshot from the historical test result screenshots, and determining whether the test result of the current test step passes according to whether the test result corresponding to the matched screenshot passes. The application improves the test efficiency, reduces the test cost and test time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of software testing technology, and in particular to a software regression testing method, apparatus, electronic device, and storage medium. Background Technology

[0002] After a software product is updated and released, it undergoes feature iterations and version upgrades. To ensure that newly added features function correctly after each upgrade without affecting existing features, regression testing is necessary. Through regression testing, the software development team can determine whether the complete application can run effectively after code modifications.

[0003] If regression testing is performed manually, it is costly and time-consuming. As applications become increasingly complex, it eventually becomes necessary to allocate additional resources and manpower to regression testing.

[0004] If regression testing uses automated testing methods, changes to the software interface of existing functions due to program modifications require test engineers with programming skills to maintain the automated test scripts, which consumes more manpower and time. Summary of the Invention

[0005] This invention provides a software regression testing method, apparatus, electronic device, and storage medium to address the shortcomings of existing regression testing technologies, such as high cost, long time consumption, and the need to maintain test scripts. It enables automated testing using existing test scripts, thereby reducing testing costs and time.

[0006] This invention provides a software regression testing method, comprising:

[0007] The first software is tested using an automated test script, and a screenshot of the current test result of the first software in the current test step is obtained.

[0008] Determine the similarity between the current test result screenshot and the historical test result screenshot of the second software at each historical test step. The historical test result screenshot is obtained by testing the second software using the automated test script. The first software is an upgraded version of the second software.

[0009] Based on the similarity, a screenshot matching the current test result screenshot is selected from the historical test result screenshots. The success of the current test step is determined based on whether the test result corresponding to the matching screenshot passes.

[0010] According to a software regression testing method provided by the present invention, the step of determining the similarity between the current test result screenshot and the historical test result screenshot of the second software at each historical test step includes:

[0011] The current test result screenshot and each historical test result screenshot are input into the machine learning model to obtain the similarity between the current test result screenshot and each historical test result screenshot;

[0012] The machine learning model is trained by using the screenshots of historical test results as samples and the label of whether the test result corresponding to the screenshots of historical test results is passed or not.

[0013] According to a software regression testing method provided by the present invention, the step of determining whether the test result of the current testing step passes based on whether the test result corresponding to the matched screenshot passes includes:

[0014] If the name of the current test step matches the name of the historical test step corresponding to the matched screenshot, the test result of the current test step is determined to be passed based on whether the test result corresponding to the matched screenshot is passed.

[0015] According to a software regression testing method provided by the present invention, the step of determining whether the test result of the current testing step passes based on whether the test result corresponding to the matched screenshot passes includes:

[0016] If the name of the current test step is the same as the name of the historical test step corresponding to the matched screenshot, and the execution path of the current test step is the same as the execution path of the historical test step corresponding to the matched screenshot, the test result of the current test step is determined to be passed based on whether the test result corresponding to the matched screenshot is passed.

[0017] According to a software regression testing method provided by the present invention, after the step of selecting a screenshot matching the current test result screenshot from the historical test result screenshots based on the similarity, the method further includes:

[0018] The current test result screenshot and the matching screenshot are divided into grids to obtain multiple regions of the current test result screenshot and multiple regions of the matching screenshot, and the regions of the current test result screenshot and the regions of the matching screenshot correspond one-to-one;

[0019] Compare each region of the current test result screenshot with the corresponding region of the matching screenshot;

[0020] If any area in the current test result screenshot does not match the corresponding area in the matching screenshot, the corresponding area of ​​the matched screenshot and the area of ​​the matched screenshot are displayed so that the tester can confirm whether the test result of the current test step has passed.

[0021] According to a software regression testing method provided by the present invention, after the step of determining whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes, the method further includes:

[0022] Obtain confirmation from the tester regarding whether the test result of the current test step has passed;

[0023] If the confirmation result is incorrect, the test result of the current test step shall be changed to determine whether it passes.

[0024] The screenshot of the current test result is used as the screenshot of the historical test result.

[0025] The present invention also provides a software regression testing apparatus, comprising:

[0026] The screenshot module is used to test the first software using an automated test script and obtain a screenshot of the current test result of the first software in the current test step.

[0027] A calculation module is used to determine the similarity between the current test result screenshot and the historical test result screenshot of the second software at each historical test step. The historical test result screenshot is obtained by testing the second software using the automated test script. The first software is an upgraded version of the second software.

[0028] The prediction module is used to select a screenshot that matches the current test result screenshot from the historical test result screenshots based on the similarity, and to determine whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes.

[0029] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the software regression testing method described above.

[0030] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the software regression testing method as described above.

[0031] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the software regression testing method as described above.

[0032] The software regression testing method, apparatus, electronic device, and storage medium provided by this invention perform regression testing on upgraded software using automated test scripts that test the original software. Based on the similarity between historical test result screenshots of the original software and test result screenshots of the upgraded software, historical test result screenshots matching the upgraded software's test result screenshots are obtained. The pass / fail status of the current test step is determined by whether the test result corresponding to the historical test result screenshot has passed. This achieves automated regression testing of the upgraded software, improving testing efficiency and reducing testing costs and time. Attached Figure Description

[0033] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0034] Figure 1 This is one of the flowcharts of the software regression testing method provided by the present invention;

[0035] Figure 2 This is the second flowchart of the software regression testing method provided by the present invention;

[0036] Figure 3 This is a schematic diagram of the structure of the software regression testing device provided by the present invention;

[0037] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0038] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0039] The following is combined with Figure 1 A software regression testing method according to the present invention includes:

[0040] Step 101: Use an automated test script to test the first software and obtain a screenshot of the current test result of the first software in the current test step;

[0041] The first software is the version of the original software after functional iterations and upgrades. Regression testing is necessary to determine whether the newly added functions of the first software are working properly and whether they affect the original functions.

[0042] The first software was tested using an automated test script, and screenshots were taken of the test results for each test step during the testing process.

[0043] Optionally, the test results include the interface of the first software after the current test step is executed and the test process information of the current test step. The test process information includes the names and order of the called functions, thereby improving the accuracy of matching and thus enhancing test precision.

[0044] Step 102: Determine the similarity between the current test result screenshot and the historical test result screenshot of the second software at each historical test step. The historical test result screenshot is obtained by taking screenshots of the test results of the second software at each test step using the automated test script to test the second software. The first software is an upgraded version of the second software.

[0045] The second software is the version of the first software before its functional iterations and version upgrades. Automated test scripts are used to test the second software. Once it is determined that the second software functions normally, it is updated and released.

[0046] Since the first software program has changed compared to the second software program, and the automated test script is designed for the second software, existing technologies maintain the automated test script to accommodate program changes, and then use the maintained automated test script to perform regression testing on the first software. This embodiment directly uses the automated test script to perform regression testing on the first software.

[0047] like Figure 2 As shown, during the testing of the second software using automated test scripts, screenshots of the test results for each test step are taken to generate historical test result screenshots of the second software.

[0048] Calculate the similarity between the current test result screenshot and each historical test result screenshot. Optionally, extract the text features of the test process information and the interface features of the software from both the current test result screenshot and each historical test result screenshot, and calculate the similarity based on the two features using a similarity algorithm.

[0049] Step 103: Select a screenshot that matches the current test result screenshot from the historical test result screenshots based on the similarity, and determine whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes.

[0050] Optionally, the screenshot of the historical test result with the highest similarity among the similarities greater than a set threshold can be selected as the screenshot to match the current test result screenshot.

[0051] If the current test step involves a new feature or an existing feature affected by a new feature, a matching graph may not be found. Testers should then annotate the screenshot of the current test result to determine if the test result passed, i.e., whether it meets the expected test result, and record the annotation and the screenshot of the current test result. Figure 1 And store it in the dataset for subsequent screenshot matching.

[0052] The test result corresponding to the matched screenshot is used as the predicted result of the test result of the current test step.

[0053] If the current test step is predicted to pass, then the current test step passes; otherwise, it fails.

[0054] After the first software test is completed, ReportNG is used to generate a test report.

[0055] This embodiment uses automated test scripts for testing the original software to perform regression testing on the upgraded software. Based on the similarity between the historical test result screenshots of the original software and the test result screenshots of the upgraded software, it obtains historical test result screenshots that match the test result screenshots of the upgraded software. It then determines whether the test result of the current test step passes based on whether the test result corresponding to the historical test result screenshot passes, thereby achieving automated regression testing of the upgraded software, improving testing efficiency, and reducing testing costs and time.

[0056] Based on the above embodiments, the step of determining the similarity between the current test result screenshot and the historical test result screenshot of the second software in each historical test step in this embodiment includes:

[0057] The current test result screenshot and each historical test result screenshot are input into the machine learning model to obtain the similarity between the current test result screenshot and each historical test result screenshot;

[0058] The machine learning model is trained by using the screenshots of historical test results as samples and the label of whether the test result corresponding to the screenshots of historical test results is passed or not.

[0059] Optionally, the machine learning model is a neural network model, such as a convolutional neural network model. This embodiment does not limit the type of machine learning model.

[0060] The current test result screenshot of the first software and the historical test result screenshot of the second software are input into the machine learning model. The machine learning model extracts features from both and calculates the similarity of the extracted features.

[0061] like Figure 2 As shown, the test result corresponding to each historical test result screenshot labeled by the tester is used as a label, and the historical test result screenshots and labels are used as a dataset for model training.

[0062] Alternatively, PyTorch can be used as the framework for training machine learning models.

[0063] During training, a machine learning model matches each historical test result screenshot in the dataset with its corresponding expected test result screenshot. Based on the matching results, it predicts whether the historical test result screenshot matches the expectation. The predicted result and the corresponding test result of the historical test result screenshot are compared to determine if they are consistent. If they are inconsistent, the parameters of the machine learning model are adjusted to make them consistent.

[0064] The trained machine learning model is deployed to a server, packaged as a web service, and provides an interface for calling the machine learning model.

[0065] After calling the trained machine learning model to calculate the similarity between the current test result screenshot and each historical test result screenshot, the historical test result screenshot with the highest similarity among those with similarities greater than a set threshold is selected as the matching screenshot.

[0066] Based on the above embodiments, the step in this embodiment of determining whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes includes:

[0067] If the name of the current test step matches the name of the historical test step corresponding to the matched screenshot, the test result of the current test step is determined to be passed based on whether the test result corresponding to the matched screenshot is passed.

[0068] Specifically, obtain the name of the historical test step corresponding to the current test step and the matched screenshot. The name of the historical test step corresponding to the current test step and the matched screenshot can be the name of the corresponding test case.

[0069] Even if the matched screenshot has a high similarity to the current test result screenshot, if the names of the current test step and the historical test step corresponding to the matched screenshot are different, that is, the current test step and the historical test step are not the same step, it may be inaccurate to determine whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes, thereby improving the accuracy of the test result prediction for the current test step.

[0070] Based on the above embodiments, the step in this embodiment of determining whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes includes:

[0071] If the name of the current test step is the same as the name of the historical test step corresponding to the matched screenshot, and the execution path of the current test step is the same as the execution path of the historical test step corresponding to the matched screenshot, the test result of the current test step is determined to be passed based on whether the test result corresponding to the matched screenshot is passed.

[0072] Specifically, obtain the name and path of the current test step, as well as the name and path of the historical test steps corresponding to the matched screenshot.

[0073] The path of the current test step is a time sequence of the test steps executed before the current test step, arranged according to their execution time, and is used to characterize the context preceding the current test step.

[0074] The path of historical test steps is a time sequence of test steps executed before the historical test steps, arranged according to their execution time, and is used to characterize the preceding context of the historical test steps.

[0075] Even if the matched screenshot is highly similar to the current test result screenshot, if the names of the current test step and the historical test step corresponding to the matched screenshot are different, that is, the current test step and the historical test step are not the same step, or the same step but with different contexts during the test process, it may be inaccurate to determine whether the test result of the current test step has passed based on whether the test result corresponding to the matched screenshot has passed, thus improving the accuracy of software regression testing.

[0076] Based on the above embodiments, after the step of selecting a screenshot that matches the current test result screenshot from the historical test result screenshots according to the similarity, the method further includes:

[0077] The current test result screenshot and the matching screenshot are divided into grids to obtain multiple regions of the current test result screenshot and multiple regions of the matching screenshot, and the regions of the current test result screenshot and the regions of the matching screenshot correspond one-to-one;

[0078] The current test result screenshot and the matched screenshot are divided into the same grid, that is, the number of rows and columns of the grid are the same.

[0079] A one-to-one correspondence between the area in the current test result screenshot and the area in the matching screenshot means that the same location in both screenshots corresponds. For example, the area in the first row and first column of the current test result screenshot corresponds to the area in the first row and first column of the matching screenshot.

[0080] Compare each region of the current test result screenshot with the corresponding region of the matching screenshot;

[0081] Optionally, the similarity between each region of the current test result screenshot and the corresponding region of the matched screenshot is calculated.

[0082] If any area in the current test result screenshot does not match the corresponding area in the matching screenshot, the corresponding area of ​​the matched screenshot and the area of ​​the matched screenshot are displayed so that the tester can confirm whether the test result of the current test step has passed.

[0083] If there is a discrepancy between the corresponding area of ​​the current test result screenshot and the matching screenshot, the tester can refer to the two corresponding areas to determine whether the test result of the current test step has passed.

[0084] If the tester provides a confirmation result, the tester's confirmation result is used to determine whether the test result of the current test step passes. Otherwise, the test result corresponding to the matching screenshot is used to determine whether the test result of the current test step passes, thereby improving the accuracy of software regression testing.

[0085] Based on the above embodiments, this embodiment further includes, after the step of determining whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes:

[0086] Obtain confirmation from the tester regarding whether the test result of the current test step has passed;

[0087] If the confirmation result is incorrect, the test result of the current test step shall be changed to determine whether it passes.

[0088] Testers confirm whether the predicted test results of the current test steps pass, thereby intervening in the predicted results and improving the accuracy of software regression testing.

[0089] The screenshot of the current test result is used as the screenshot of the historical test result.

[0090] The screenshot of the current test result and whether the final test result passes are added to the dataset for matching subsequent test result screenshots and / or iterative optimization of the machine learning model, thereby enriching the dataset and improving the matching effect.

[0091] The software regression testing apparatus provided by the present invention is described below. The software regression testing apparatus described below can be referred to in correspondence with the software regression testing method described above.

[0092] like Figure 3As shown, the device includes:

[0093] The screenshot module 301 is used to test the first software using an automated test script and obtain a screenshot of the current test result of the first software in the current test step.

[0094] The calculation module 302 is used to determine the similarity between the current test result screenshot and the historical test result screenshot of the second software at each historical test step. The historical test result screenshot is obtained by testing the second software using the automated test script. The first software is an upgraded version of the second software.

[0095] The prediction module 303 is used to select a screenshot that matches the current test result screenshot from the historical test result screenshots based on the similarity, and to determine whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes.

[0096] This embodiment uses automated test scripts for testing the original software to perform regression testing on the upgraded software. Based on the similarity between the historical test result screenshots of the original software and the test result screenshots of the upgraded software, it obtains historical test result screenshots that match the test result screenshots of the upgraded software. It then determines whether the test result of the current test step passes based on whether the test result corresponding to the historical test result screenshot passes, thereby achieving automated regression testing of the upgraded software, improving testing efficiency, and reducing testing costs and time.

[0097] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, communications interface 420, and memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute a software regression testing method. This method includes: testing a first software using an automated test script to obtain a screenshot of the current test result of the first software in the current test step; determining the similarity between the current test result screenshot and historical test result screenshots of the second software in each historical step, wherein the historical test result screenshots are obtained by testing the second software using the automated test script, and the first software is an upgraded version of the second software; selecting a screenshot matching the current test result screenshot from the historical test result screenshots based on the similarity; and determining whether the test result of the current test step passes based on whether the test result corresponding to the matching screenshot passes.

[0098] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0099] On the other hand, the present invention also provides a computer program product, the computer program product including a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the software regression testing method provided by the above methods. The method includes: testing a first software using an automated test script to obtain a screenshot of the current test result of the first software in the current test step; determining the similarity between the current test result screenshot and a historical test result screenshot of the second software in each historical step, wherein the historical test result screenshot is obtained by testing the second software using the automated test script, and the first software is an upgraded version of the second software; selecting a screenshot that matches the current test result screenshot from the historical test result screenshots according to the similarity; and determining whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes.

[0100] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a software regression testing method provided by the methods described above. The method includes: testing first software using an automated test script to obtain a screenshot of the current test result of the first software at the current test step; determining the similarity between the current test result screenshot and historical test result screenshots of the second software at each historical step, wherein the historical test result screenshots are obtained by testing the second software using the automated test script, and the first software is an upgraded version of the second software; selecting a screenshot matching the current test result screenshot from the historical test result screenshots based on the similarity; and determining whether the test result of the current test step passes based on whether the test result corresponding to the matching screenshot passes.

[0101] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0102] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0103] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A software regression testing method, characterized in that, include: The first software is tested using an automated test script, and a screenshot of the current test result of the first software in the current test step is obtained. Determine the similarity between the current test result screenshot and the historical test result screenshot of the second software at each historical test step. The historical test result screenshot is obtained by testing the second software using the automated test script. The first software is an upgraded version of the second software. Based on the similarity, a screenshot matching the current test result screenshot is selected from the historical test result screenshots. The test result of the current test step is determined to be successful based on whether the test result corresponding to the matching screenshot is successful. The step of determining whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes includes: If the name of the current test step matches the name of the historical test step corresponding to the matched screenshot, the test result of the current test step is determined to be passed based on whether the test result corresponding to the matched screenshot is passed. The step of determining whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes includes: If the name of the current test step is the same as the name of the historical test step corresponding to the matched screenshot, and the execution path of the current test step is the same as the execution path of the historical test step corresponding to the matched screenshot, the test result of the current test step is determined to be passed based on whether the test result corresponding to the matched screenshot is passed.

2. The software regression testing method according to claim 1, characterized in that, The step of determining the similarity between the current test result screenshot and the historical test result screenshot of the second software at each historical test step includes: The current test result screenshot and each historical test result screenshot are input into the machine learning model to obtain the similarity between the current test result screenshot and each historical test result screenshot; The machine learning model is trained by using the screenshots of historical test results as samples and the label of whether the test result corresponding to the screenshots of historical test results is passed or not.

3. The software regression testing method according to any one of claims 1-2, characterized in that, After the step of selecting a screenshot that matches the current test result screenshot from the historical test result screenshots based on the similarity, the method further includes: The current test result screenshot and the matching screenshot are divided into grids to obtain multiple regions of the current test result screenshot and multiple regions of the matching screenshot, and the regions of the current test result screenshot and the regions of the matching screenshot correspond one-to-one; Compare each region of the current test result screenshot with the corresponding region of the matching screenshot; If any area in the current test result screenshot does not match the corresponding area in the matching screenshot, the corresponding area of ​​the matched screenshot and the area of ​​the matched screenshot are displayed so that the tester can confirm whether the test result of the current test step has passed.

4. The software regression testing method according to any one of claims 1-2, characterized in that, After the step of determining whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes, the method further includes: Obtain confirmation from the tester regarding whether the test result of the current test step has passed; If the confirmation result is incorrect, the test result of the current test step shall be changed to determine whether it passes. The screenshot of the current test result is used as the screenshot of the historical test result.

5. A software regression testing apparatus, characterized in that, include: The screenshot module is used to test the first software using an automated test script and obtain a screenshot of the current test result of the first software in the current test step. The calculation module is used to determine the similarity between the current test result screenshot and the historical test result screenshot of the second software at each historical test step. The historical test result screenshots are obtained by testing the second software using the automated test script. The first software is an upgraded version of the second software. The prediction module is used to select a screenshot that matches the current test result screenshot from the historical test result screenshots based on the similarity, and to determine whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes. The prediction module specifically includes: The testing module is used to determine whether the test result of the current test step passes based on whether the test result corresponding to the matched screenshot passes, when the name of the current test step is consistent with the name of the historical test step corresponding to the matched screenshot. The test module is specifically used for: If the name of the current test step is the same as the name of the historical test step corresponding to the matched screenshot, and the execution path of the current test step is the same as the execution path of the historical test step corresponding to the matched screenshot, the test result of the current test step is determined to be passed based on whether the test result corresponding to the matched screenshot is passed.

6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the software regression testing method as described in any one of claims 1 to 4.

7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the software regression testing method as described in any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the software regression testing method as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Automatic software testing method and apparatus

    CN104978270A

  • Test method and device for application program page adaptation

    CN108255726A