Regression testing method and related device
By calculating the MD5 value of the functional file and determining the correlation, the functional points that need to be tested are intelligently identified, solving the problem of inefficient full regression testing, and achieving high efficiency and accuracy of regression testing.
Patent Information
- Application Number
- CN202411412593.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-02-07
AI Technical Summary
Existing regression testing methods usually use full-quantity regression testing, which is very labor-intensive and inefficient as project iterations and test cases increase.
By calculating the MD5 values of the function files in the original firmware and the firmware to be tested, the functional files whose MD5 values have changed are determined, the initial functional points to be tested are determined based on these changing files, and the final functional points to be tested are determined based on the correlation between the functional points. points, finally test these functional points and complete the regression test.
The workload of regression testing is reduced, the efficiency of regression testing is significantly improved, and the testing of all functional points is avoided, ensuring the accuracy and efficiency of the test.
Smart Images

Figure CN119396718A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of regression testing, and in particular to a regression testing method and related devices. Background Art
[0002] Regression testing refers to retesting after modifying the old code to confirm that the modification has not introduced new errors or caused errors in other codes. In incremental and rapid iterative development, the continuous release of new versions makes regression testing more frequent. Therefore, it is very meaningful to improve the efficiency and effectiveness of regression testing by choosing the right regression testing strategy.
[0003] At present, when adding new functions to a product, fixing defects in a product, or changing the requirements of a product, the code of the product needs to be modified. After the code is modified, it may affect the original function of the product, so regression testing is required. However, the regression testing method currently used is usually a full regression testing method, that is, testing all functional points. With the iteration of the project, the number of test cases continues to increase, so the workload of the full regression testing method is large. Summary of the invention
[0004] The purpose of this application is to provide a regression testing method and related devices, which can reduce the workload of regression testing and significantly improve the efficiency of regression testing.
[0005] To achieve the above objectives, this application provides the following solutions:
[0006] In a first aspect, the present application provides a regression testing method, the regression testing method comprising:
[0007] Calculate the MD5 value of each first function file in the original firmware;
[0008] Calculate the MD5 value of each second function file in the firmware to be tested; the firmware to be tested is the firmware obtained by updating the original firmware;
[0009] Compare the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested, determine the second function file whose MD5 value has changed, and record the second function file whose MD5 value has changed as a changed function file;
[0010] Based on all the changed function files, determining the initial function points to be tested;
[0011] Determining final function points to be tested based on all the initial function points to be tested and the associations between the function points;
[0012] All the final function points to be tested are tested to complete the regression test of the firmware to be tested.
[0013] Optionally, comparing the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested to determine the second function file whose MD5 value has changed specifically includes:
[0014] For each second function file in the firmware to be tested, determine whether the MD5 value of the second function file is equal to the MD5 value of any first function file in the original firmware; if not, determine the second function file as the second function file whose MD5 value has changed.
[0015] Optionally, based on all the changed function files, determining the initial function points to be tested specifically includes:
[0016] Based on the file correspondence table of the firmware to be tested, determining the function point corresponding to each second function file in the firmware to be tested; the file correspondence table includes the function point and test case corresponding to each second function file;
[0017] For each of the changed function files, a function point corresponding to the changed function file is used as an initial function point to be tested.
[0018] Optionally, determining the final function point to be tested based on all the initial function points to be tested and the associations between the function points specifically includes:
[0019] For each of the initial function points to be tested, based on the correlation between function points, a number of associated function points associated with the initial function point to be tested are determined; and all the initial function points to be tested and all the associated function points are combined into a final function point to be tested.
[0020] Optionally, testing all the final function points to be tested specifically includes:
[0021] For each of the final function points to be tested, the test case corresponding to the final function point to be tested is determined based on the file correspondence table of the firmware to be tested, and the final function point to be tested is tested using the test case; the file correspondence table includes the function points and test cases corresponding to each second function file.
[0022] Optionally, the method for generating the file correspondence table includes:
[0023] Arrange each second function file in the firmware to be tested, and determine the function point corresponding to each second function file;
[0024] For each of the second function files, based on the function points corresponding to the second function file, generate a test case corresponding to the second function file;
[0025] All the second function files, the function points corresponding to the second function files, and the test cases are stored correspondingly to obtain a file correspondence table.
[0026] In a second aspect, the present application provides a regression testing device, the regression testing device comprising:
[0027] A first calculation module, used for calculating the MD5 value of each first function file in the original firmware;
[0028] The second calculation module is used to calculate the MD5 value of each second function file in the firmware to be tested; the firmware to be tested is the firmware obtained by updating the original firmware;
[0029] A comparison module, used for comparing the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested, determining the second function file whose MD5 value has changed, and recording the second function file whose MD5 value has changed as a changed function file;
[0030] A first determination module, configured to determine an initial function point to be tested based on all the changed function files;
[0031] A second determination module, configured to determine a final function point to be tested based on the associations between all the initial function points to be tested and the function points;
[0032] The test module is used to test all the final function points to be tested and complete the regression test of the firmware to be tested.
[0033] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement any of the above-described regression testing methods.
[0034] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the above-mentioned regression testing methods.
[0035] In a fifth aspect, the present application provides a computer program product, including a computer program, which implements any of the above-mentioned regression testing methods when executed by a processor.
[0036] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0037] The present application provides a regression test method and related devices, which compare the MD5 value of each first function file in the original firmware and the MD5 value of each second function file in the firmware to be tested, determine the second function file whose MD5 value has changed, further determine the initial function point to be tested, and then determine the final function point to be tested based on the correlation between all initial function points to be tested and function points, and finally test all final function points to be tested to complete the regression test of the firmware to be tested. Compared with the full regression test method, the present application can determine the final function point to be tested, does not need to test all function points, can reduce the workload of regression testing, and significantly improve the efficiency of regression testing. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 An application environment diagram of a regression testing method provided in Example 1 of the present application.
[0040] Figure 2 A flowchart of a regression testing method provided in Example 1 of the present application.
[0041] Figure 3 A schematic diagram of the principle of a regression testing method provided in Example 1 of the present application.
[0042] Figure 4 A detailed flowchart of a regression testing method provided in Example 1 of the present application.
[0043] Figure 5 A schematic diagram of the process of generating the file correspondence table provided in Example 1 of the present application.
[0044] Figure 6 A schematic diagram of the functional modules of a regression testing device provided in Example 2 of the present application.
[0045] Figure 7 A schematic diagram of the structure of a computer device provided in Example 3 of the present application. DETAILED DESCRIPTION
[0046] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0047] Example 1
[0048] The regression testing method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be set up separately, integrated on the server, or placed on the cloud or other servers. The terminal can send each first function file in the original firmware to be processed and each second function file in the firmware to be tested to the server. After the server receives each first function file in the original firmware to be processed and each second function file in the firmware to be tested, for each first function file in the original firmware to be processed and each second function file in the firmware to be tested, the server calculates the MD5 value of each first function file in the original firmware; calculates the MD5 value of each second function file in the firmware to be tested; compares the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested, determines the second function file whose MD5 value changes, and records the second function file whose MD5 value changes as a changed function file; based on all changed function files, determines the initial function point to be tested; based on the correlation between all initial function points to be tested and function points, determines the final function point to be tested; tests all final function points to be tested, and completes the regression test of the firmware to be tested. The server can feed back the obtained regression test results to the terminal.
[0049] In addition, in some embodiments, the regression testing method can also be implemented solely by a server or a terminal. For example, the terminal can directly process each first function file in the original firmware to be processed and each second function file in the firmware to be tested, or the server can obtain each first function file in the original firmware to be processed and each second function file in the firmware to be tested from a data storage system, and process each first function file in the original firmware to be processed and each second function file in the firmware to be tested.
[0050] The terminals may be, but are not limited to, various desktop computers, laptops, smart phones, tablet computers, IoT devices and portable wearable devices. IoT devices may be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices may be smart watches, smart bracelets, head-mounted devices, etc. The server may be implemented as an independent server or a server cluster consisting of multiple servers, or a cloud server.
[0051] like Figure 2 As shown, a regression testing method is provided. The method is executed by a computer device, and can be executed by a computer device such as a terminal or a server alone, or by a terminal and a server together. In the embodiment of the present application, the method is applied to Figure 1 Taking the server in as an example, the regression testing method includes the following steps:
[0052] Step S1, calculating the MD5 value of each first function file in the original firmware.
[0053] Step S2, calculating the MD5 value of each second function file in the firmware to be tested; the firmware to be tested is the firmware obtained by updating the original firmware.
[0054] Step S3, comparing the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested, determining the second function file whose MD5 value has changed, and recording the second function file whose MD5 value has changed as a changed function file.
[0055] Step S4: determining the initial function points to be tested based on all the changed function files.
[0056] Step S5: determining the final function points to be tested based on all the initial function points to be tested and the associations between the function points.
[0057] Step S6, testing all the final function points to be tested to complete the regression test of the firmware to be tested.
[0058] By implementing the above steps S1 to S6, this embodiment determines the second function file whose MD5 value has changed by comparing the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested, further determines the initial function point to be tested, and then determines the final function point to be tested based on the correlation between all initial function points to be tested and function points, tests all final function points to be tested, and completes the regression test of the firmware to be tested. The present application intelligently identifies the final function point to be tested that has changed, and does not need to test all function points of the firmware to be tested, but only needs to test the final function point to be tested that has changed, which can reduce the workload of regression testing and significantly improve the efficiency of regression testing.
[0059] When adding new functions to a product, fixing defects of a product, or changing the requirements of a product, the code of a product needs to be modified. After the code is modified, the original function of a product may be affected, so regression testing is required. Among them, a product can be any digital device using the Linux system that contains firmware, such as a mobile phone, a digital camera, a router, a mouse, a display, a hard disk, a keyboard, etc. A product contains firmware. After the code of a product is modified, the firmware will also be updated. In this embodiment, the original firmware is recorded as the original firmware, and the firmware updated due to the code modification is recorded as the firmware to be tested. Therefore, the firmware to be tested is the firmware obtained by updating the original firmware, and regression testing refers to testing the firmware to be tested.
[0060] The regression testing method currently used is usually a full regression testing method, that is, testing all functional points of the firmware to be tested. As the project iterates, the number of test cases continues to increase, so the workload of the full regression testing method is very large. Even if a minor change is made to the original firmware, it will bring a lot of workload, take a long time, have low testing efficiency, and be costly because all functional points of the firmware to be tested need to be tested.
[0061] In order to solve this problem, a manual prediction and evaluation method is proposed. After obtaining the firmware to be tested, the affected functional points are determined mainly through communication and historical experience, and only the affected functional points are tested subsequently. However, this manual prediction and evaluation method relies on subjective judgment and experience, and has low accuracy. It may result in some affected functional points not being tested, and the stability and quality of the functions cannot be guaranteed.
[0062] Based on this, the present embodiment further proposes a focus regression testing method, where the focus refers to the target object, which can also be considered as the scope of influence, that is, the final functional point to be tested. Compared with the full regression testing method, it is no longer necessary to test all functional points of the firmware to be tested, which reduces the testing time, improves the testing efficiency, and has low cost. Moreover, since the testing efficiency is improved, it is no longer necessary to occupy resources for a long time, so the resource utilization rate can be further improved. Compared with the manual prediction and evaluation method, the final functional point to be tested that is affected can be accurately determined through an objective method to ensure the stability and quality of the function.
[0063] like Figure 3 and Figure 4 As shown, this embodiment provides a regression testing method, and the regression testing method includes:
[0064] (1) Calculate the MD5 (Message Digest Algorithm 5) value of each first function file in the original firmware.
[0065] After downloading the product firmware, all functional points will be reflected in the form of files. Each file can be called a functional file. Functional files refer to all files related to functional points in the Linux system. Each functional file corresponds to a functional point. Functional point refers to a specific business process that can be completed independently.
[0066] (2) Calculate the MD5 value of each second function file in the firmware to be tested.
[0067] (3) Compare the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested, determine the second function file whose MD5 value has changed, and record the second function file whose MD5 value has changed as a changed function file.
[0068] Different MD5 values mean that there are changes. At this time, compare the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested to determine the second function file whose MD5 value has changed, specifically including: for each second function file in the firmware to be tested, determine whether the MD5 value of the second function file is equal to the MD5 value of any first function file in the original firmware; if not, determine the second function file as the second function file with a changed MD5 value.
[0069] (4) Based on all the changed functional files, determine the initial functional points to be tested.
[0070] After obtaining the modified function files, each function file is mapped to the corresponding function point to determine the initial function point to be tested. At this time, the initial function point to be tested is determined based on all the function files, specifically including: determining the function point corresponding to each second function file in the firmware to be tested based on the file correspondence table of the firmware to be tested, the file correspondence table includes the function point and test case corresponding to each second function file; for each function file to be tested, the function point corresponding to the function file to be tested is used as the initial function point to be tested.
[0071] (5) Based on all the initial function points to be tested and the correlation between the function points, determine the final function points to be tested.
[0072] After determining the initial function points to be tested, this embodiment further determines the final function points to be tested based on the correlation between the function points, and the final function points to be tested constitute the test scope. The correlation is reflected in multiple levels, including the direct connection and mutual dependence between the function points, and the correlation between the function points is manually determined in advance. At this time, based on the correlation between all the initial function points to be tested and the function points, the final function points to be tested are determined, specifically including: for each initial function point to be tested, based on the correlation between the function points, a number of associated function points that are associated with the initial function point to be tested are determined; all the initial function points to be tested and all the associated function points constitute the final function point to be tested.
[0073] (6) Test all final function points to be tested and complete the regression test of the firmware to be tested.
[0074] After the final function point to be tested is determined, that is, after the test scope is determined, the test case is output according to the determined test scope to perform regression testing on the firmware to be tested. At this time, all the final function points to be tested are tested, specifically including: for each final function point to be tested, based on the file correspondence table of the firmware to be tested, the test case corresponding to the final function point to be tested is determined, and the final function point to be tested is tested using the test case, and the file correspondence table includes the function point and test case corresponding to each second function file.
[0075] As an optional implementation, this embodiment may regard the test scope consisting of all final functional points to be tested as the initial test scope, and further supplement the initial test scope by manually reviewing the initial test scope to obtain the final test scope, and output test cases based on the final test scope to perform regression testing on the firmware to be tested.
[0076] like Figure 5 As shown, in this embodiment, the method for generating the file correspondence table includes:
[0077] (1) Each second function file in the firmware to be tested is sorted to determine the function point corresponding to each second function file.
[0078] (2) For each second function file, based on the function points corresponding to the second function file, generate a test case corresponding to the second function file.
[0079] In this embodiment, test cases are written according to function points. Test cases are a set of conditions or variables, and the tester determines whether the application software or software system works correctly based on it. Specifically, the test cases can be written by using methods such as equivalence class partitioning, boundary value analysis, and error speculation to obtain test cases corresponding to the function points. The test cases corresponding to the function points are also the test cases corresponding to the second function files corresponding to the function points.
[0080] (3) All second function files, function points corresponding to the second function files, and test cases are stored in correspondence to obtain a file correspondence table.
[0081] The file correspondence table includes the storage path, file name, corresponding function point and storage path of the corresponding test case of each second function file. Therefore, through the file correspondence table, this embodiment can determine the function point and test case corresponding to each second function file.
[0082] In this embodiment, for a product, a comprehensive sorting may be performed only once to obtain a file correspondence table of a certain firmware, and the file correspondence table may be subsequently modified or supplemented according to the update content to obtain a file correspondence table of a subsequently updated firmware.
[0083] This embodiment outputs the test range based on the association between the file correspondence table and the function points of the firmware to be tested and the changes in the MD5 value of the function file. It is no longer necessary to test all the function points, thereby improving the test efficiency.
[0084] At present, the mode of firmware incremental update is to compare all functional files. If the functional files are consistent, they will not be updated. The regression test case always uses the old test case, and will repeat the test on the functional points that have not been changed. Therefore, this embodiment wants to modify the full regression test into a focused regression test according to the characteristics of incremental update. In the process of firmware or image upgrade, the first task is to clarify the test focus, that is, to accurately locate the final functional point to be tested. The core strategy of the focused regression test is to efficiently use the comparison results of the MD5 values of the functional files of the new and old versions of the firmware, intelligently identify the initial functional points to be tested that have changed, and further determine the final functional points to be tested based on the correlation between the functional points. This method effectively avoids the waste of resources and time caused by blindly conducting full regression testing, ensures that the test activities can concentrate firepower, and conduct in-depth and detailed verification for those functional points that are truly affected by the new version, that is, based on the existing full coverage data, constantly refine and streamline, and try to cover the most core, most real, and most necessary test points under limited test resources, so as to avoid detours and reduce unnecessary investment. Through the above improvement ideas, traditional full regression testing can be transformed into focused regression testing, which can improve testing efficiency and quality while reducing testing costs and resource consumption, thereby better adapting to the software development needs of rapid iteration and continuous delivery.
[0085] This embodiment can further introduce a change impact analysis mechanism, which not only covers the identification of the direct impact scope of the change, but also deeply analyzes the dependency relationship between the change and each functional point and the potential risks that these changes may cause. The change analysis process first determines the functional point corresponding to each changed functional file and identifies the direct impact scope of the change. Then, the associated dependencies between each functional file and the functional point are sorted out to build a comprehensive impact network diagram. After identifying the potential change impact, the potential change impact refers to the test points (i.e., the functional points that need to be tested) that may be involved in addition to the direct impact scope of the change and the dependency relationship between each functional point. It is necessary to conduct an in-depth risk assessment of the potential change impact, and formulate corresponding prevention strategies in advance based on the assessment results. That is, if the test points that are not involved in the focus test strategy are found, the focus test strategy can be continuously improved according to the actual situation to minimize the negative impact that the change may bring. The above process can be completed manually.
[0086] This embodiment can also further introduce a continuous monitoring and feedback mechanism, regularly evaluate test results and coverage, and timely adjust test strategies and optimize test cases to adapt to changes in software changes and business needs, that is, regularly evaluate the strategy and effect of regression testing, optimize and adjust according to actual conditions, and continuously improve the test strategy of regression testing. The improvement methods include but are not limited to the following: Based on the evaluation results, focus regression testing is prioritized for changes with large impacts and high risks, reducing unnecessary full-volume testing and improving test efficiency; eliminating redundant or outdated test cases, updating test cases that have become invalid due to product changes, and ensuring that the test content keeps up with product development; for high-frequency changes or complex scenarios, automated test scripts can be added to improve the automation level of test execution. The above process can be completed manually.
[0087] After determining the modified functional files, this embodiment needs to clarify the functional points corresponding to these functional files, and determine the test scope based on the correlation between the functional points to ensure that only the affected functional points are tested and avoid repetitive testing of irrelevant functional points. The test scope can also be manually reviewed to determine the final test scope. According to the determined test scope, the relevant test cases are updated to ensure that the newly added or modified functional points are covered. That is, the test cases are output according to the determined test scope, a streamlined test plan is formulated, and the corresponding test cases are executed in priority to ensure that the focus of the test and limited resources are used where testing is most needed, thereby improving the efficiency and accuracy of regression testing.
[0088] This embodiment further considers the use of automation tools to automatically output test cases to improve the efficiency and consistency of test execution. Automated test scripts can be designed based on the correlation between functional points to reduce the workload of manual testing. The purpose of introducing automated testing is to reduce repetitive work, improve testing efficiency, and ensure software quality.
[0089] This embodiment can also manually revise old test cases, add new test points or optimize existing test cases to adapt to the functional changes of the new version.
[0090] The embodiment of the present application also provides an application scenario, which applies the above-mentioned regression test method. Specifically, the regression test method provided by this embodiment can be applied in a product regression test scenario, which includes an acquisition link and a processing link. The acquisition link is used to acquire each first function file in the original firmware and each second function file in the firmware to be tested, and the processing link is used to process each first function file in the original firmware and each second function file in the firmware to be tested to complete the regression test of the firmware to be tested. The regression test method provided by this embodiment belongs to the processing link.
[0091] Example 2
[0092] Based on the same inventive concept, the embodiment of the present application also provides a regression testing device for implementing the 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 regression testing device embodiment provided below can refer to the limitations on the regression testing method above, and will not be repeated here.
[0093] like Figure 6 As shown, a regression testing device is provided, the regression testing device comprising:
[0094] The first calculation module M1 is used to calculate the MD5 value of each first function file in the original firmware.
[0095] The second calculation module M2 is used to calculate the MD5 value of each second function file in the firmware to be tested; the firmware to be tested is the firmware obtained by updating the original firmware.
[0096] The comparison module M3 is used to compare the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested, determine the second function file whose MD5 value has changed, and record the second function file whose MD5 value has changed as a changed function file.
[0097] The first determination module M4 is used to determine the initial function point to be tested based on all the changed function files.
[0098] The second determining module M5 is used to determine the final function points to be tested based on all the initial function points to be tested and the associations between the function points.
[0099] The test module M6 is used to test all the final function points to be tested and complete the regression test of the firmware to be tested.
[0100] Example 3
[0101] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 7 As 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 data to be processed. 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 regression testing method is implemented.
[0102] Those skilled in the art will understand that Figure 7 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.
[0103] In an exemplary embodiment, a computer device is also provided, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the regression testing method described in Example 1.
[0104] Example 4
[0105] An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the regression testing method described in Embodiment 1 is implemented.
[0106] Example 5
[0107] An embodiment of the present application provides a computer program product, including a computer program, which implements the regression testing method described in Example 1 when executed by a processor.
[0108] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0109] 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.
[0110] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A regression testing method, characterized in that: The regression testing method comprises: Calculate the MD5 value of each first function file in the original firmware; Calculate the MD5 value of each second function file in the firmware to be tested; the firmware to be tested is the firmware obtained by updating the original firmware; Compare the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested, determine the second function file whose MD5 value has changed, and record the second function file whose MD5 value has changed as a changed function file; Based on all the changed function files, determining the initial function points to be tested; Determining final function points to be tested based on all the initial function points to be tested and the associations between the function points; All the final function points to be tested are tested to complete the regression test of the firmware to be tested.
2. The regression testing method according to claim 1, characterized in that: Comparing the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested, and determining the second function file whose MD5 value has changed, specifically includes: For each second function file in the firmware to be tested, determine whether the MD5 value of the second function file is equal to the MD5 value of any first function file in the original firmware; if not, determine the second function file as the second function file whose MD5 value has changed.
3. The regression testing method according to claim 1, characterized in that: Based on all the changed function files, determine the initial function points to be tested, specifically including: Based on the file correspondence table of the firmware to be tested, determining the function point corresponding to each second function file in the firmware to be tested; the file correspondence table includes the function point and test case corresponding to each second function file; For each of the changed function files, a function point corresponding to the changed function file is used as an initial function point to be tested.
4. The regression testing method according to claim 1, characterized in that: Based on all the initial function points to be tested and the correlations between the function points, determining the final function points to be tested specifically includes: For each of the initial function points to be tested, based on the correlation between function points, a number of associated function points associated with the initial function point to be tested are determined; and all the initial function points to be tested and all the associated function points are combined into a final function point to be tested.
5. The regression testing method according to claim 1, characterized in that: Testing all the final function points to be tested includes: For each of the final function points to be tested, the test case corresponding to the final function point to be tested is determined based on the file correspondence table of the firmware to be tested, and the final function point to be tested is tested using the test case; the file correspondence table includes the function points and test cases corresponding to each second function file.
6. The regression testing method according to claim 3 or 5, characterized in that: The method for generating the file correspondence table includes: Arrange each second function file in the firmware to be tested, and determine the function point corresponding to each second function file; For each of the second function files, based on the function points corresponding to the second function file, generate a test case corresponding to the second function file; All the second function files, the function points corresponding to the second function files, and the test cases are stored correspondingly to obtain a file correspondence table.
7. A regression testing device, characterized in that: The regression testing device comprises: A first calculation module, used for calculating the MD5 value of each first function file in the original firmware; The second calculation module is used to calculate the MD5 value of each second function file in the firmware to be tested; the firmware to be tested is the firmware obtained by updating the original firmware; A comparison module, used for comparing the MD5 value of each first function file in the original firmware with the MD5 value of each second function file in the firmware to be tested, determining the second function file whose MD5 value has changed, and recording the second function file whose MD5 value has changed as a changed function file; A first determination module, configured to determine an initial function point to be tested based on all the changed function files; A second determination module, configured to determine a final function point to be tested based on the associations between all the initial function points to be tested and the function points; The test module is used to test all the final function points to be tested and complete the regression test of the firmware to be tested.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the regression testing method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the regression testing method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the regression testing method according to any one of claims 1 to 6 is implemented.