A comparative test method, device, computer equipment and storage medium

Through the comparative testing method, the test results of the current version and the historical version are automatically compared, which solves the problems of heavy workload and low efficiency in software testing, improves the testing efficiency and quality, and is suitable for rapid update environments with multiple data sources.

CN112631919BActive Publication Date: 2024-10-01GUANGZHOU PINWEI SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011573621.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-25
Publication Date
2024-10-01
Estimated Expiration
2040-12-25

AI Technical Summary

Technical Problem

During the software testing process, the testing workload is huge and the test result data verification task is arduous. The existing testing methods are cumbersome and inefficient, require programming learning ability, and are difficult to manage and maintain test cases and data.

Method used

Provide a comparative testing method that receives test requests from the application to be tested, generates test tasks, performs test operations, obtains test result data, and compares the test results of the current version with the data of historical versions, and determines based on the comparison results Whether the test passes or not, it supports automated comparative testing of multiple data sources, reducing manual operations and coding requirements.

Benefits of technology

It improves software testing efficiency, saves testing time, improves testing quality, realizes automated execution and result feedback, simplifies test case and plan management, and adapts to the rapidly updated software environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112631919B_ABST
    Figure CN112631919B_ABST
Patent Text Reader

Abstract

The present invention discloses a comparative test method, device, computer equipment and storage medium, the method comprising: receiving a test request of a current version of an application to be tested, generating a corresponding test task according to the test request, executing the test task, executing a corresponding test operation on the current version of the application to be tested, obtaining current test result data, comparing the current test result data with the historical test result data of the application to be tested of a historical version according to a preset rule, obtaining a comparison result, and determining whether the current version of the application to be tested has passed the test according to the comparison result. The present invention improves the efficiency of software testers, saves test time, and greatly improves the quality of software testing, shortens the test duration, and realizes automated execution of configured test cases and plans and feedback of test result data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to a comparative testing method, device, computer equipment and storage medium. Background Art

[0002] With the development of computer technology, software services are being used more and more widely. In the process of software development, it is necessary to conduct relevant software testing on the developed applications. Software testing refers to the process of operating the application under specified conditions to find program errors, measure the quality of the application, and evaluate whether it can meet the design requirements. The testing methods currently used are very cumbersome, the test execution efficiency is not high, the debugging of test scripts is time-consuming and laborious, and the testers need to have certain programming learning abilities. At the same time, test cases and test data are not easy to manage and maintain. On the one hand, the software updates very quickly. For the same application, the corresponding version will change after each code change, and each version of the application needs to be tested before it is officially released. Only applications that pass the test can be released. On the other hand, the test tasks may correspond to different data sources, such as MySQL, Redis, HTTP interface, VMS messages, etc. Therefore, software testing faces problems such as huge testing workload and arduous test result data verification tasks.

[0003] Therefore, it is urgent to propose a new testing method to solve the above problems. Summary of the invention

[0004] In order to solve the problems of the prior art, the embodiments of the present invention provide a comparative test method, apparatus, computer equipment and storage medium to overcome the problems existing in the prior art such as huge test workload, arduous task of test result data verification and the like.

[0005] In order to solve one or more of the above technical problems, the technical solution adopted by the present invention is:

[0006] In a first aspect, a comparative test method is provided, the method comprising the following steps:

[0007] Receive a test request for the current version of the application to be tested, and generate a corresponding test task according to the test request;

[0008] Execute the test task, perform corresponding test operations on the current version of the application to be tested, and obtain current test result data;

[0009] Compare the current test result data with the historical test result data of the historical version of the application to be tested according to a preset rule to obtain a comparison result;

[0010] Determine whether the current version of the application to be tested has passed the test according to the comparison result.

[0011] Further, the receiving a test request of the current version of the application to be tested and generating a corresponding test task according to the test request includes:

[0012] A test request of a current version of an application to be tested is received, and a corresponding test task is generated according to the test request and a preset data template, wherein the data template is used to configure configuration data of the test task.

[0013] Furthermore, comparing the current test result data with historical test result data of the historical version of the application to be tested according to a preset rule to obtain the comparison result includes:

[0014] The result data corresponding to each test operation in the current test result data is compared with the corresponding result data in the historical test data to obtain a comparison result.

[0015] Furthermore, the method further comprises:

[0016] Determine whether the code logic of the current version of the application to be tested is changed compared with the historical version of the application to be tested;

[0017] Determining whether the current version of the application to be tested has passed the test according to the comparison result includes:

[0018] If the code logic of the current version of the application to be tested has changed compared to the historical version of the application to be tested, the result data corresponding to the changed code logic in the comparison result is obtained to determine whether the result data meets the preset requirements. If so, it is determined that the current version of the application to be tested has passed the test.

[0019] Furthermore, the method further comprises:

[0020] The current test result data is stored as historical test result data in association with the current version of the application to be tested in a baseline database, where the baseline database is used to store historical test data.

[0021] Further, executing the test task, performing corresponding test operations on the current version of the application to be tested, and obtaining current test result data includes:

[0022] Execute the test task, perform corresponding test operations on the current version of the application to be tested, and generate current test result data according to a preset result data module.

[0023] Furthermore, the test task includes at least one of a Saturn task or a Shell task.

[0024] In a second aspect, a comparative test device is provided, the device comprising:

[0025] A task generation module, used to receive a test request of the current version of the application to be tested, and generate a corresponding test task according to the test request;

[0026] A test execution module, used to execute the test task, perform corresponding test operations on the current version of the application to be tested, and obtain current test result data;

[0027] A result comparison module, used to compare the current test result data with the historical test result data of the historical version of the application to be tested according to preset rules to obtain a comparison result;

[0028] The test judgment module is used to determine whether the current version of the application to be tested has passed the test according to the comparison result.

[0029] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:

[0030] Receive a test request for the current version of the application to be tested, and generate a corresponding test task according to the test request;

[0031] Execute the test task, perform corresponding test operations on the current version of the application to be tested, and obtain current test result data;

[0032] Compare the current test result data with the historical test result data of the historical version of the application to be tested according to a preset rule to obtain a comparison result;

[0033] Determine whether the current version of the application to be tested has passed the test according to the comparison result.

[0034] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0035] Receive a test request for the current version of the application to be tested, and generate a corresponding test task according to the test request;

[0036] Execute the test task, perform corresponding test operations on the current version of the application to be tested, and obtain current test result data;

[0037] Compare the current test result data with the historical test result data of the historical version of the application to be tested according to a preset rule to obtain a comparison result;

[0038] Determine whether the current version of the application to be tested has passed the test according to the comparison result.

[0039] The technical solution provided by the embodiment of the present invention has the following beneficial effects:

[0040] The comparative test method, apparatus, computer equipment and storage medium provided by the embodiments of the present invention receive a test request of the current version of the application to be tested, generate a corresponding test task according to the test request, execute the test task, perform corresponding test operations on the current version of the application to be tested, obtain current test result data, compare the current test result data with the historical test result data of the historical version of the application to be tested according to preset rules, obtain the comparison result, and determine whether the current version of the application to be tested has passed the test according to the comparison result. This method can cope with software testing scenarios with tight time and high demand, improve the efficiency of software testers, save testing time, and greatly improve the quality of software testing, shorten the testing time, and realize automatic execution of configured test cases and plans and feedback of test result data.

[0041] Furthermore, by receiving a test request for the current version of the application to be tested, a corresponding test task is generated according to the test request and a preset data template, the data template is used to configure the configuration data of the test task, and after obtaining the current test result data, the current test result data is associated with the current version of the application to be tested as historical test result data and stored in a baseline database, the baseline database is used to store historical test data, so as to realize comparative verification of background task processing of data from different data sources. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 is a system architecture diagram of a comparison test platform according to an exemplary embodiment;

[0044] Figure 2 is a flowchart of a use case execution according to an exemplary embodiment;

[0045] Figure 3is a flow chart of a comparative test method according to an exemplary embodiment;

[0046] Figure 4 is a schematic structural diagram of a comparative test device according to an exemplary embodiment;

[0047] Figure 5 The figure is a schematic diagram showing the internal structure of a computer device according to an exemplary embodiment. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is only a part of the embodiment of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0049] As described in the background technology, in the application system of each business, there will be more or less situations where background timed tasks are used to process business data, such as pulling data with JAVA tasks, receiving messages pushed by upstream systems with message tasks, or batch processing with SHELL tasks, etc. At present, the test of such background operation tasks is usually either tested manually or written into test scripts for automated testing. On the one hand, these test methods have the problems of cumbersome operation, low test execution efficiency, time-consuming and laborious debugging of test scripts, and the need for certain programming learning ability, and the difficulty in managing and maintaining test cases and data. On the other hand, the software is updated very quickly, and there may be many corresponding versions of the same application program, and each version of the application program must undergo various tests before being officially released, and the test result data needs to be verified after the test, resulting in a huge test workload, which is time-consuming and labor-intensive.

[0050] In order to solve these pain points, the embodiments of the present invention creatively provide a comparative test platform for scheduled task testing. The system platform mainly provides a visual, non-coding, configurable and efficient automated testing solution for background scheduled tasks (including Saturn tasks and SHELL tasks). The test platform supports comparative testing of background tasks processing multiple data sources (such as MySQL, Redis, HTTP interface, VMS messages, etc.), saves time without coding, automatically executes and feeds back test results, and can greatly improve test efficiency.

[0051] Figure 1 is a system architecture diagram of a comparative test platform according to an exemplary embodiment, referring to Figure 1As shown in the figure, the comparison test platform is mainly composed of the front-end management system, the use case execution system, the database, and Redis. The database includes the basic database and the baseline database. The basic database is mainly used to store the basic data of the front-end configuration management, and the baseline database is mainly used to store the baseline data of the test case, such as the test result data, etc. This data is used to compare with the actual result data after the test task is run to verify whether the test case is successful. Redis is mainly used for distributed locks to control concurrent test cases.

[0052] Among them, the front-end management system of the comparative test platform in the embodiment of the present invention can mainly realize the following functions:

[0053] 1. Basic data management, including business line management, product management, and module management, which is mainly used to distinguish the business line, product, and module to which the test cases belong;

[0054] 2. Test environment management, including hosts configuration and application job configuration. Hosts configuration is mainly used to configure DNS in different environments, mainly the configuration of user http interface. Job configuration mainly configures the tasks of the application to be tested, including Saturn domain name and job name, or SHELL task IP, user password and corresponding script;

[0055] 3. Data source management, including MySQL data source configuration, REDIS data source configuration and VMS message configuration, etc., mainly to configure the data source configuration used by the task to be tested, including IP, port, user name and password. If it is message configuration, it is to configure the environment, channel and queue to which the message belongs;

[0056] 4. Template management, including data template and message template management. Data templates are divided into two types: number template and result template. Number template acts on the input data of the test case, and result template acts on the output data of the test case. Therefore, the data template here is used to configure number templates and result templates of different data sources, such as MySQL, Redis, HTTP, etc. The message template mainly configures the sender's message and acts on the consumer's input data;

[0057] 5. Use case management, mainly including the functions of creating new test cases, executing test cases and querying test case results. Test cases will be associated with the application to be tested, number templates and result templates;

[0058] 6. Plan management, mainly including plan creation, plan execution and viewing of plan execution results. The test plan can be composed of multiple test cases.

[0059] In the embodiment of the present invention, the use case execution system mainly includes two functions: one is test plan execution, and the other is test case execution.

[0060] The test plan execution process is as follows:

[0061] First, query all the test plans to be executed, and then execute the test plans and the test cases in the test plans in sequence. Before executing a test case, check whether there is a test case using the same data source in Redis. If so, wait. Otherwise, write the data source used by the test case to Redis, and then execute the test case. When the test case is executed, delete the Redis data source data of the test case.

[0062] Figure 2 is a flowchart of a use case execution according to an exemplary embodiment, referring to Figure 2 As shown, the test case execution process is as follows:

[0063] First, all the test cases to be executed (not the planned ones) will be queried, and then all the test cases to be executed will be executed concurrently. During the execution of a single test case, the data configured in the number template is first imported into the actual library of the test task, and then the data in the result template is imported into the baseline database, and then the Saturn task or SHELL task to be tested is started. After the task is executed, the result data in the actual library of the test task is queried and compared with the baseline data in the baseline database. If the data is successfully compared according to a certain comparison rule (excluding certain comparison fields such as id, create_time, update_time, etc.), the test case test is judged to pass, otherwise the test fails.

[0064] Figure 3 is a flowchart of a comparative test method according to an exemplary embodiment, referring to Figure 3 As shown, the method comprises the following steps:

[0065] S1: receiving a test request of a current version of an application to be tested, and generating a corresponding test task according to the test request.

[0066] Specifically, each test application may correspond to multiple versions, and a test request of the current version of the application to be tested is obtained, the test request includes but is not limited to: the version number of the application to be tested, test requirements, change information, data source information and other data, and a corresponding test task is generated according to the request. In an embodiment of the present invention, the background scheduled task (i.e., test task) of the comparison test platform can be a Saturn task or a Shell task, and the user can set it according to actual needs.

[0067] S2: Execute the test task, perform corresponding test operations on the current version of the application to be tested, and obtain current test result data.

[0068] Specifically, in an embodiment of the present invention, the start and stop operations and execution status of different background test tasks are monitored. When starting a test task to execute a test, it is necessary to determine the task execution status, whether it is in progress or completed. The purpose of monitoring the executing task is to prevent abnormalities from occurring and the task cannot be terminated normally. For such tasks that cannot be terminated normally, a forced stop is required. First, to prevent the process of executing the test task from being stuck all the time, and second, to prevent the same task from being executed multiple times, thereby starting multiple processes, and each process cannot be terminated normally until the server resources are exhausted.

[0069] Specifically, each test task will have a corresponding test case. In order to facilitate the management of test tasks, in the embodiment of the present invention, a test plan will be created according to preset rules, and each test plan may include multiple test cases (corresponding test tasks). When the platform performs a test operation, it first queries all the test plans to be executed, and then executes the test plans and the test cases in the test plans in sequence. Before executing a test case, it will check whether there is a use case using the same data source in Redis. If it exists, wait, otherwise write the data source used by the test case to Redis, and then execute the use case. When the use case is executed, delete the Redis data source data of the use case.

[0070] S3: Compare the current test result data with the historical test result data of the historical version of the application to be tested according to a preset rule to obtain a comparison result.

[0071] Specifically, in an embodiment of the present invention, it is set to store the historical test result data of the application to be tested in a baseline database. During the execution of a single use case, the data configured in the number generation template is first imported into the actual library of the test task, and then the data in the result template is imported into the baseline database. Then the test task is started. After the task is executed, the result data in the actual library of the test task is queried and compared with the baseline data in the baseline database to generate a comparison result.

[0072] In order to improve the efficiency of test result data verification, the current test result data is compared with the historical test result data of the historical version of the application to be tested according to preset rules, and whether the current test passes is determined based on the comparison result.

[0073] S4: Determine whether the current version of the application to be tested has passed the test according to the comparison result.

[0074] Specifically, if the comparison result meets the preset requirements, the current test is determined to have passed; if not, the current test is determined to have failed.

[0075] As a preferred implementation, in an embodiment of the present invention, the receiving of a test request of the current version of the application to be tested and generating a corresponding test task according to the test request includes:

[0076] A test request of a current version of an application to be tested is received, and a corresponding test task is generated according to the test request and a preset data template, wherein the data template is used to configure configuration data of the test task.

[0077] Specifically, the embodiment of the present invention supports the access and comparison of different data sources. Since the data sources used by different test tasks can be different, and even multiple data sources are used at the same time, the data formats stored in different data sources are also quite different. In the embodiment of the present invention, template management is used to support the connection, operation and data storage of various data sources, and the data formats of different types of data sources can be converted and compared. Template management includes data template and message template management. The templates are divided into two types: number templates and result templates. The number template acts on the input data of the test case, and the result template acts on the output data of the test case. That is, the data template here is used to configure the number template and result template of different data sources (such as MySQL, Redis, HTTP, etc.). The message template mainly configures the sender's message and acts on the consumer's input data.

[0078] As a preferred implementation, in an embodiment of the present invention, comparing the current test result data with the historical test result data of the historical version of the application to be tested according to a preset rule, and obtaining the comparison result includes:

[0079] The result data corresponding to each test operation in the current test result data is compared with the corresponding result data in the historical test data to obtain a comparison result.

[0080] Specifically, in the embodiment of the present invention, there is no specific restriction on the preset rules, and the user can set them according to actual needs, such as excluding certain comparison fields, such as id, create_time, update_time and other fields.

[0081] As a preferred implementation, in an embodiment of the present invention, the method further includes:

[0082] Determine whether the code logic of the current version of the application to be tested is changed compared with the historical version of the application to be tested;

[0083] Determining whether the current version of the application to be tested has passed the test according to the comparison result includes:

[0084] If the code logic of the current version of the application to be tested has changed compared to the historical version of the application to be tested, the result data corresponding to the changed code logic in the comparison result is obtained to determine whether the result data meets the preset requirements. If so, it is determined that the current version of the application to be tested has passed the test.

[0085] Specifically, after the code of the application is changed, it will affect the regression of the automated use case. For example, when the code logic of the current version of the application to be tested is changed compared to the historical version of the application to be tested, the execution result data corresponding to the code logic will change accordingly. Therefore, when determining whether the current version of the application to be tested has passed the test based on the comparison results, it is necessary to check the comparison results corresponding to the changed code logic. If the result data meets the preset requirements, it is determined that the current version of the application to be tested has passed the test, otherwise, it is determined that it has failed.

[0086] As a preferred implementation, in an embodiment of the present invention, the method further includes:

[0087] The current test result data is stored as historical test result data in association with the current version of the application program to be tested in a baseline database, where the baseline database is used to store historical test data.

[0088] Specifically, after obtaining the current test result data, in an embodiment of the present invention, it is set to store the current test result data in the baseline database so as to be used as historical result data for comparison in subsequent test operations. Before storage, it can be checked according to certain rules. If it meets the requirements, it is stored, otherwise it is not stored.

[0089] Since the data formats stored in different data sources are different, when storing, you can import them into the preset result data module for storage, or you can directly store them first, and then import them into the result data module for comparison when performing specific comparisons. You can choose here according to the actual needs of the user.

[0090] As a preferred implementation, in an embodiment of the present invention, executing the test task, performing corresponding test operations on the current version of the application to be tested, and obtaining current test result data include:

[0091] Execute the test task, perform corresponding test operations on the current version of the application to be tested, and generate current test result data according to a preset result data module.

[0092] Specifically, since different data sources store data in different formats, when generating the current test result data, the execution result may be imported into a preset result data module to generate the current test result data.

[0093] As a preferred implementation, in the embodiment of the present invention, the test task includes at least one of a Saturn task or a Shell task.

[0094] Figure 4 is a schematic structural diagram of a comparative test device according to an exemplary embodiment, the device comprising:

[0095] A task generation module, used to receive a test request of the current version of the application to be tested, and generate a corresponding test task according to the test request;

[0096] A test execution module, used to execute the test task, perform corresponding test operations on the current version of the application to be tested, and obtain current test result data;

[0097] A result comparison module, used to compare the current test result data with the historical test result data of the historical version of the application to be tested according to preset rules to obtain a comparison result;

[0098] The test judgment module is used to determine whether the current version of the application to be tested has passed the test according to the comparison result.

[0099] As a preferred implementation, in the embodiment of the present invention, the task generation module is specifically used for:

[0100] A test request of a current version of an application to be tested is received, and a corresponding test task is generated according to the test request and a preset data template, wherein the data template is used to configure configuration data of the test task.

[0101] As a preferred implementation, in the embodiment of the present invention, the result comparison module is specifically used for:

[0102] The result data corresponding to each test operation in the current test result data is compared with the corresponding result data in the historical test data to obtain a comparison result.

[0103] As a preferred implementation, in the embodiment of the present invention, the device further includes:

[0104] A change determination module, used to determine whether the code logic of the current version of the application to be tested is changed compared with the historical version of the application to be tested;

[0105] The test judgment module is specifically used to obtain result data corresponding to the changed code logic in the comparison result if the code logic of the current version of the application to be tested has changed compared to the historical version of the application to be tested, and to determine whether the result data meets the preset requirements. If so, it is determined that the test of the current version of the application to be tested has passed.

[0106] As a preferred implementation, in the embodiment of the present invention, the device further includes:

[0107] The data storage module is used to store the current test result data as historical test result data in association with the current version of the application program to be tested in a baseline database, where the baseline database is used to store historical test data.

[0108] As a preferred implementation, in the embodiment of the present invention, the test execution module is specifically used for:

[0109] Execute the test task, perform corresponding test operations on the current version of the application to be tested, and generate current test result data according to a preset result data module.

[0110] As a preferred implementation, in the embodiment of the present invention, the test task includes at least one of a Saturn task or a Shell task.

[0111] Figure 5 is a schematic diagram of the internal structure of a computer device according to an exemplary embodiment. Figure 5 As shown, the computer device includes a processor, a memory and a network interface connected through a system bus. 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 network 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, an optimization method for an execution plan is implemented.

[0112] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the solution of the present invention 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.

[0113] As a preferred implementation, in an embodiment of the present invention, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented:

[0114] Receive a test request for the current version of the application to be tested, and generate a corresponding test task according to the test request;

[0115] Execute the test task, perform corresponding test operations on the current version of the application to be tested, and obtain current test result data;

[0116] Compare the current test result data with the historical test result data of the historical version of the application to be tested according to a preset rule to obtain a comparison result;

[0117] Determine whether the current version of the application to be tested has passed the test according to the comparison result.

[0118] As a preferred implementation, in the embodiment of the present invention, the processor further implements the following steps when executing the computer program:

[0119] A test request of a current version of an application to be tested is received, and a corresponding test task is generated according to the test request and a preset data template, wherein the data template is used to configure configuration data of the test task.

[0120] As a preferred implementation, in the embodiment of the present invention, the processor further implements the following steps when executing the computer program:

[0121] The result data corresponding to each test operation in the current test result data is compared with the corresponding result data in the historical test data to obtain a comparison result.

[0122] As a preferred implementation, in the embodiment of the present invention, the processor further implements the following steps when executing the computer program:

[0123] Determine whether the code logic of the current version of the application to be tested is changed compared with the historical version of the application to be tested;

[0124] If the code logic of the current version of the application to be tested has changed compared to the historical version of the application to be tested, the result data corresponding to the changed code logic in the comparison result is obtained to determine whether the result data meets the preset requirements. If so, it is determined that the current version of the application to be tested has passed the test.

[0125] As a preferred implementation, in the embodiment of the present invention, the processor further implements the following steps when executing the computer program:

[0126] The current test result data is stored as historical test result data in association with the current version of the application program to be tested in a baseline database, where the baseline database is used to store historical test data.

[0127] As a preferred implementation, in the embodiment of the present invention, the processor further implements the following steps when executing the computer program:

[0128] Execute the test task, perform corresponding test operations on the current version of the application to be tested, and generate current test result data according to a preset result data module.

[0129] In an embodiment of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0130] Receive a test request for the current version of the application to be tested, and generate a corresponding test task according to the test request;

[0131] Execute the test task, perform corresponding test operations on the current version of the application to be tested, and obtain current test result data;

[0132] Compare the current test result data with the historical test result data of the historical version of the application to be tested according to a preset rule to obtain a comparison result;

[0133] Determine whether the current version of the application to be tested has passed the test according to the comparison result.

[0134] As a preferred implementation, in the embodiment of the present invention, when the computer program is executed by the processor, the following steps are also implemented:

[0135] A test request of a current version of an application to be tested is received, and a corresponding test task is generated according to the test request and a preset data template, wherein the data template is used to configure configuration data of the test task.

[0136] As a preferred implementation, in the embodiment of the present invention, when the computer program is executed by the processor, the following steps are also implemented:

[0137] The result data corresponding to each test operation in the current test result data is compared with the corresponding result data in the historical test data to obtain a comparison result.

[0138] As a preferred implementation, in the embodiment of the present invention, when the computer program is executed by the processor, the following steps are also implemented:

[0139] Determine whether the code logic of the current version of the application to be tested is changed compared with the historical version of the application to be tested;

[0140] If the code logic of the current version of the application to be tested has changed compared to the historical version of the application to be tested, the result data corresponding to the changed code logic in the comparison result is obtained to determine whether the result data meets the preset requirements. If so, it is determined that the current version of the application to be tested has passed the test.

[0141] As a preferred implementation, in the embodiment of the present invention, when the computer program is executed by the processor, the following steps are also implemented:

[0142] The current test result data is stored as historical test result data in association with the current version of the application program to be tested in a baseline database, where the baseline database is used to store historical test data.

[0143] As a preferred implementation, in the embodiment of the present invention, when the computer program is executed by the processor, the following steps are also implemented:

[0144] Execute the test task, perform corresponding test operations on the current version of the application to be tested, and generate current test result data according to a preset result data module.

[0145] In summary, the technical solution provided by the embodiment of the present invention has the following beneficial effects:

[0146] The comparative test method, apparatus, computer equipment and storage medium provided by the embodiments of the present invention receive a test request of the current version of the application to be tested, generate a corresponding test task according to the test request, execute the test task, perform corresponding test operations on the current version of the application to be tested, obtain current test result data, compare the current test result data with the historical test result data of the historical version of the application to be tested according to preset rules, obtain the comparison result, and determine whether the current version of the application to be tested has passed the test according to the comparison result. This method can cope with software testing scenarios with tight time and high demand, improve the efficiency of software testers, save testing time, and greatly improve the quality of software testing, shorten the testing time, and realize automatic execution of configured test cases and plans and feedback of test result data.

[0147] Furthermore, by receiving a test request for the current version of the application to be tested, a corresponding test task is generated according to the test request and a preset data template, the data template is used to configure the configuration data of the test task, and after obtaining the current test result data, the current test result data is associated with the current version of the application to be tested as historical test result data and stored in a baseline database, the baseline database is used to store historical test data, so as to realize comparative verification of background task processing of data from different data sources.

[0148] It should be noted that: the comparison test device provided in the above embodiment only uses the division of the above functional modules as an example when triggering the comparison service. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the comparison test device provided in the above embodiment belongs to the same concept as the comparison test method embodiment, that is, the device is based on the comparison test method. The specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0149] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0150] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A comparative test method, characterized in that: The method comprises the following steps: Receive a test request for the current version of the application to be tested, and generate a corresponding test task according to the test request; wherein, receive a test request for the current version of the application to be tested, and generate a corresponding test task according to the test request and a preset data template, the data template is used to configure configuration data of the test task, and the data template includes a number generation template and a result template; In response to receiving an instruction to execute a test task, query all to-be-executed test tasks stored in the Redis database, and determine whether there are test tasks with the same data source in the Redis database; If it exists, the data source required by the test task with the same data source is written into the Redis database, the test task is executed, the corresponding test operation is performed on the current version of the application to be tested, and the current test result data is obtained; the current test result data is stored as historical test result data in association with the current version of the application to be tested in a baseline database, and the baseline database is used to store historical test data; The current test result data is compared with the historical test result data of the historical version of the application to be tested according to preset rules to obtain a comparison result; wherein, the historical test results of the application to be tested are stored in a baseline database, the configuration data of the test task in the number-generating template is imported into the actual library of the test task, the result data of the test task is output through the result template and the result data of the test task is imported into the baseline database; in response to the completion of the execution of the test task, the result data in the actual library of the test task is queried and compared with the historical test results in the baseline database to generate a comparison result; Determine whether the current version of the application to be tested has passed the test according to the comparison result; wherein determining whether the code logic of the current version of the application to be tested is changed compared to the historical version of the application to be tested; Determining whether the current version of the application to be tested has passed the test according to the comparison result includes: If the code logic of the current version of the application to be tested has changed compared to the historical version of the application to be tested, the result data corresponding to the changed code logic in the comparison result is obtained to determine whether the result data meets the preset requirements. If so, it is determined that the current version of the application to be tested has passed the test.

2. The comparative test method according to claim 1, characterized in that: The comparing the current test result data with the historical test result data of the historical version of the application to be tested according to a preset rule to obtain the comparison result includes: The result data corresponding to each test operation in the current test result data is compared with the corresponding result data in the historical test data to obtain a comparison result.

3. The comparative test method according to claim 1, characterized in that: The executing the test task, performing corresponding test operations on the current version of the application to be tested, and obtaining current test result data includes: Execute the test task, perform corresponding test operations on the current version of the application to be tested, and generate current test result data according to a preset result data module.

4. The comparative test method according to claim 1, characterized in that: The test task includes at least one of a Saturn task and a Shell task.

5. A comparative test device, characterized in that: The device comprises: A task generation module, used to receive a test request of the current version of the application to be tested, and generate a corresponding test task according to the test request; wherein, the test request of the current version of the application to be tested is received, and the corresponding test task is generated according to the test request and a preset data template, wherein the data template is used to configure the configuration data of the test task, and the data template includes a number generation template and a result template; A test execution module is used to query all to-be-executed test tasks stored in the Redis database in response to receiving an instruction to execute a test task, and determine whether there is a test task with the same data source in the Redis database; if so, write the data source required by the test task with the same data source into the Redis database, execute the test task, perform corresponding test operations on the current version of the application to be tested, and obtain current test result data; store the current test result data as historical test result data in association with the current version of the application to be tested in a baseline database, and the baseline database is used to store historical test data; A result comparison module is used to compare the current test result data with the historical test result data of the historical version of the application to be tested according to preset rules to obtain a comparison result; wherein the historical test results of the application to be tested are stored in a baseline database, the configuration data of the test task in the number-generating template is imported into the actual library of the test task, the result data of the test task is output through the result template and the result data of the test task is imported into the baseline database; in response to the completion of the execution of the test task, the result data in the actual library of the test task is queried and compared with the historical test results in the baseline database to generate a comparison result; A test judgment module is used to determine whether the current version of the application to be tested has passed the test based on the comparison result, wherein it is determined whether the code logic of the current version of the application to be tested has changed compared with the historical version of the application to be tested; the determination of whether the current version of the application to be tested has passed the test based on the comparison result includes: if the code logic of the current version of the application to be tested has changed compared with the historical version of the application to be tested, obtaining result data corresponding to the changed code logic in the comparison result, and determining whether the result data meets the preset requirements; if so, determining that the current version of the application to be tested has passed the test.

6. A computer 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 computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. 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 4 are implemented.