Database Iterative Testing Method, Device, Equipment and Storage Medium

By selecting the benchmark database construction and verifying test cases, the problem of low database iteration testing is solved, and a more efficient testing method is realized.

CN114647576BActive Publication Date: 2025-07-29深圳市汉云科技有限公司
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210199839.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-02
Publication Date
2025-07-29
Estimated Expiration
2042-03-02

AI Technical Summary

Technical Problem

The existing database iterative testing methods are inefficient in testing, and each test requires the execution of use case files in the database to be tested and the benchmark database, which is a waste of time.

Method used

Select the historical database as the benchmark database, construct the first test case and verify the results until the expected effect is achieved, stored as the benchmark test case and result set, construct the second test case for iterative database testing, and compare the difference information to generate a report.

Benefits of technology

Reduce test case execution times and improve test efficiency and accuracy by maintaining benchmark test cases and result sets.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114647576B_ABST
    Figure CN114647576B_ABST
Patent Text Reader

Abstract

The present invention provides a database iterative testing method, apparatus, device and storage medium. The method includes selecting a version from the historical databases of previous versions as a reference database; constructing a first test case; using the first test case to test the reference database to obtain a first test result set; verifying whether the first test result set meets the expected effect; when the first test result set does not meet the expected effect, adjusting the first test case until the first test result set meets the expected effect; storing the first test case when the first test result set meets the expected effect as a reference test case, and storing the first test result set that meets the expected effect as a reference result set. The present invention reduces the number of executions of test cases and improves the test efficiency by maintaining a reference test case and a reference result set for comparative testing with the latest version database.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of database testing, and particularly relates to a method, device, equipment and storage medium for iterative testing of a database. Background Art

[0002] During the version iteration process of a relational database, a wide variety of functional features will be derived. Each function updated in each version requires human resources for testing. When the newly added function is tested without errors, it is also necessary to ensure that the original functions are not affected. In the prior art, test case files need to be executed in the database to be tested and the benchmark database every time, wasting test time. Although the combinations of SQL statements in the prior art test cases can vary in thousands of ways, in the case of fixed input statements, the behaviors shown by the database are mostly fixed, which provides the possibility for realizing automated testing of the database.

[0003] Therefore, the prior art still needs to be improved and developed. Summary of the Invention

[0004] The main purpose of the present invention is to solve the technical problem of low test efficiency of the existing database iterative testing method.

[0005] The first aspect of the present invention provides a method for iterative testing of a database, and the method for iterative testing of the database includes:

[0006] Select a version from the historical databases of previous versions as the benchmark database;

[0007] Construct a first test case adapted to the benchmark database;

[0008] Use the first test case to test the benchmark database to obtain a first test result set;

[0009] Verify whether the first test result set meets the expected effect;

[0010] When the first test result set does not meet the expected effect, adjust the first test case until the first test result set meets the expected effect;

[0011] Store the first test case when the first test result set meets the expected effect as the benchmark test case, and store the first test result set that meets the expected effect as the benchmark result set;

[0012] Obtain the iterative database;

[0013] Construct a second test case, and the second test case includes all the case statements of the first test case and the case statements of the newly added test key points;

[0014] Test the iterative database using the second test case to obtain a second test result set;

[0015] Compare the second test result set with the benchmark result set, collect the difference information that appears during the comparison process, and generate a report file for the difference information.

[0016] In an alternative embodiment of the first aspect of the present invention, the first test case for constructing and adapting to the benchmark database includes:

[0017] Generate syntax template data according to the test criteria of the benchmark database, where the syntax template data includes a set of test case pseudocodes that conform to the database test criteria and instance data formal parameter definition data;

[0018] Generate instance data enumeration values according to the instance data formal parameter definition data and the basic information of the database to be tested;

[0019] Replace the formal parameters in the syntax template data with the instance data enumeration values to obtain the first test case.

[0020] In an alternative embodiment of the first aspect of the present invention, the step of testing the benchmark database using the first test case to obtain a first test result set includes:

[0021] Input the first test case into the database test program;

[0022] Initialize the test environment of the database test program;

[0023] Use the database test program to scan and analyze each test case statement in the first test case;

[0024] Send different test case statements to different modules in the database test program for execution according to the analysis results;

[0025] Obtain the execution results of each module and output them in different formats to the memory for temporary storage.

[0026] In an alternative embodiment of the first aspect of the present invention, the step of verifying whether the first test result set meets the expected effect includes:

[0027] Determine whether there are unexpected errors in the execution results;

[0028] If there are no unexpected errors in the execution results, it is determined that the first test result set meets the expected effect;

[0029] If there are unexpected errors in the execution results, it is determined that the first test result set does not meet the expected effect.

[0030] In an alternative embodiment of the first aspect of the present invention, when the first test result set does not meet the expected effect, adjusting the first test case until the first test result set meets the expected effect includes:

[0031] When the first test result set does not meet the expected effect, the database test program outputs an error prompt to notify the tester to adjust the first test case;

[0032] Re-input the adjusted first test case into the database test program to obtain the first test result set again.

[0033] In an alternative embodiment of the first aspect of the present invention, comparing the second test result set with the reference result set, collecting the difference information that appears during the comparison process, and generating a report file of the difference information includes:

[0034] Compare the execution results of the second test result set with the reference results in the reference result set item by item;

[0035] If there is no corresponding reference result in the reference result set for the execution result, generate a difference information indicating non-existence in the comparison and record it in the report file;

[0036] If there is a corresponding reference result in the reference result set for the execution result, compare the result data of the execution result with the result data of the reference result to find out the specific difference information between the execution result and the reference result and record it in the report file.

[0037] In an alternative embodiment of the first aspect of the present invention, both the historical database and the iterative database are relational databases, and the first test case and the second test case are organized in the format of a csv file.

[0038] The second aspect of the present invention provides a database iterative testing device, and the database iterative testing device includes:

[0039] A selection module, configured to select a version from the historical databases of previous versions as a reference database;

[0040] A first construction module, configured to construct a first test case adapted to the reference database;

[0041] A first testing module, configured to test the reference database using the first test case to obtain a first test result set;

[0042] A verification module, configured to verify whether the first test result set meets the expected effect;

[0043] A judgment and adjustment module, configured to adjust the first test case when the first test result set fails to meet the expected effect until the first test result set meets the expected effect;

[0044] A storage module, configured to store the first test case when the first test result set meets the expected effect as a benchmark test case, and store the first test result set that meets the expected effect as a benchmark result set;

[0045] An acquisition module, configured to acquire an iterative database;

[0046] A second construction module, configured to construct a second test case, where the second test case includes all use case statements of the first test case and use case statements of newly added test key points;

[0047] A second test module, configured to test the iterative database by using the second test case to obtain a second test result set;

[0048] A comparison module, configured to compare the second test result set with the benchmark result set, collect difference information that appears during the comparison process, and generate a report file of the difference information.

[0049] A third aspect of the present invention provides a database iterative test device, where the database iterative test device includes: a memory and at least one processor, instructions are stored in the memory, and the memory and the at least one processor are interconnected through a line;

[0050] The at least one processor calls the instructions in the memory to enable the database iterative test device to execute the database iterative test method as described in any one of the above.

[0051] A fourth aspect of the present invention provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the database iterative test method as described in any one of the above is implemented.

[0052] Beneficial effects: The present invention provides a database iterative testing method, device, equipment and storage medium. The method includes selecting a version from the historical databases of previous versions as a reference database; constructing a first test case; using the first test case to test the reference database to obtain a first test result set; verifying whether the first test result set meets the expected effect; when the first test result set does not meet the expected effect, adjusting the first test case until the first test result set meets the expected effect; storing the first test case when the first test result set meets the expected effect as a reference test case, and storing the first test result set that meets the expected effect as a reference result set. The present invention reduces the number of executions of test cases and improves the test efficiency by maintaining a reference test case and a reference result set for comparative testing with the latest version database. Description of the Drawings

[0053] Figure 1 It is a schematic diagram of an embodiment of a database iterative testing method of the present invention;

[0054] Figure 2 It is an embodiment

[0055] schematic diagram of a database iterative testing device of the present invention;

[0056] Figure 3 It is a schematic diagram of an embodiment of a database iterative testing equipment of the present invention. Detailed Embodiments

[0057] Embodiments of the present invention provide a database iterative testing method, device, equipment and storage medium. Terms such as "first", "second", "third", "fourth", etc. (if any) in the specification, claims and above-mentioned drawings of the present invention are used to distinguish similar objects and do not have to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments described herein can be implemented in an order different from that illustrated or described herein. In addition, the terms "comprising" or "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or equipment that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or equipment.

[0058] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to Figure 1 In the first aspect of the present invention, a database iterative testing method is provided. The database iterative testing method includes:

[0059] S100. Select a version from the historical databases of previous versions as the benchmark database; in this step, it is preferred to select the latest version of the historical database as the benchmark database;

[0060] S200. Construct the first test case adapted to the benchmark database; in this step, it is to simulate the behavior of the software accessing the database to construct the first test case, and the first test case is usually organized in the form of a csv file, and each test case consists of multiple sql statements;

[0061] In step S200, an exemplary specific method for constructing the first test case adapted to the benchmark database includes: generating syntax template data according to the test criteria of the benchmark database, where the syntax template data includes a set of test case pseudocodes that meet the database test criteria and instance data parameter definition data; generating instance data enumeration values according to the instance data parameter definition data and the basic information of the database to be tested; replacing the parameters in the syntax template data with the instance data enumeration values to obtain the first test case.

[0062] S300. Use the first test case to test the benchmark database to obtain the first test result set; after selecting the benchmark version of the database in the present invention, the first test result set will be recorded based on the first test case, and then the tester will verify whether the first test result set meets the expected effect. During the verification process, the test case file will be continuously adjusted. The first test result set after verification is called the benchmark result set;

[0063] In step S300, an exemplary specific method for using the first test case to test the benchmark database to obtain the first test result set in the present invention specifically includes:

[0064] Input the first test case into the database test program; initialize the test environment of the database test program; use the database test program to scan each test case statement in the first test case and analyze it; send different test case statements to different modules in the database test program for execution according to the analysis results; obtain the execution results of each module and output them in different formats to the memory for temporary storage.

[0065] Specifically, the database test program in the technical solution of the present invention receives a use case file as input and scans each use case in the use case file to execute the following process: Before executing each use case, an initialization file can be selected for initialization. A use case consists of one or more use case statements. Each use case statement is scanned and analyzed, and different statements are distributed to different modules for execution. According to the execution results of the use cases, different formats are output to the memory for temporary storage. If an unexpected error occurs during the execution of the use cases, an error prompt needs to be output to notify the tester to adjust the use cases. If all use cases are executed successfully, the result set data in the memory is output to the benchmark result set file on the disk.

[0066] S400. Verify whether the first test result set meets the expected effect; Specifically, the present invention improves the test efficiency and accuracy by maintaining a structured benchmark test case (including all test points of the previous version) and a benchmark result set for functional comparison testing with the latest version. Whether the benchmark test case is qualified needs to be judged by verifying whether the first test result set meets the expected effect.

[0067] An exemplary method for verifying whether the first test result set meets the expected effect in step S400 of the present invention specifically includes: judging whether an unexpected error appears in the execution result; if no unexpected error appears in the execution result, it is determined that the first test result set meets the expected effect; if an unexpected error appears in the execution result, it is determined that the first test result set does not meet the expected effect. In this step, the first test case in the present invention is mainly constructed by imitating the behavior of software accessing the database. During the execution of the use case statements in the first test case, if the access method is different from that of a certain function in the database, the database test software will report an error to remind that the use case statement cannot be executed. The purpose of verifying whether the first test result set meets the expected effect is to enable all use case statements in the first test case to be successfully executed in the benchmark database and obtain the corresponding test result data.

[0068] S500. When the first test result set does not meet the expected effect, adjust the first test case until the first test result set meets the expected effect.

[0069] In step S500, when the first test result set does not meet the expected effect, adjusting the first test case until the first test result set meets the expected effect specifically includes:

[0070] When the first test result set fails to meet the expected effect, the database test program outputs an error prompt to notify the tester to adjust the first test case; the adjusted first test case is re-input into the database test program to obtain the first test result set again. In this step, if the re-obtained first test result set still fails to meet the expected effect, an error prompt is output again to notify the tester to adjust the first test case until the first test result set that meets the expected effect is generated after the first test case adjusted by the tester is input into the database test program.

[0071] S600. Store the first test case when the first test result set meets the expected effect as the benchmark test case, and store the first test result set that meets the expected effect as the benchmark result set; the present invention improves the test efficiency and accuracy by maintaining a structured benchmark test case (including all test points of the previous version) and its corresponding benchmark result set for functional comparison testing with the latest version iterative database.

[0072] S700. Obtain the iterative database; the iterative database here refers to all subsequent iterative databases, that is, all subsequent iterative databases are compared with the benchmark test results;

[0073] S800. Construct a second test case, where the second test case includes all the use case statements of the first test case and the use case statements of the newly added test points; in this embodiment, the second test case is also organized in the format of a csv file and is also composed of multiple sql statements; the second test case including all the use case statements of the first test case also includes all the test points of the benchmark database.

[0074] S900. Use the second test case to test the iterative database to obtain a second test result set; in this step, the process of using the second test case to test the iterative database to obtain the second test result set is the same as the method of using the first test case to test the benchmark database, both are carried out using database test software, and the only difference between the two is that there are some differences in the use case statements included in the first test case and the second test case.

[0075] S1000. Compare the second test result set with the benchmark result set, collect the difference information that appears during the comparison process, and generate a report file of the difference information. Specifically, the technical solution of the present invention can clearly judge the performance difference between the iterative database and the previous historical database by comparing and collecting the difference information between the second test result set and the benchmark result set, and judge whether these performance differences meet the expected effect.

[0076] An exemplary step S1000 of the present invention for comparing the second test result set and the reference result set, collecting difference information occurring during the comparison process, and generating a report file of the difference information specifically includes:

[0077] Compare the execution results of the second test result set and the reference results in the reference result set item by item;

[0078] If there is no corresponding reference result in the reference result set for the execution result, generate a difference information indicating non - existence in the comparison and record it in the report file;

[0079] If there is a corresponding reference result in the reference result set for the execution result, compare the result data of the execution result and the result data of the reference result, find out the difference information in specific details between the execution result and the reference result, and record it in the report file. In this step, when comparing the execution result with its corresponding reference result in the reference result set, it includes judging the types of the execution result and the reference result. If both are valid equivalent class result sets, then compare their SQL statements, SQL quantities, result set types, field types, field names, affected row counts, and result set data in sequence. If an error occurs during the comparison process, record the error information in the report file; if both are non - valid equivalent class result sets, then compare their SQL statements, SQL quantities, error information, and error codes in sequence. If an error occurs during the comparison process, record the error information in the report file; if the result set types of the two are inconsistent, directly record the relevant error information in the report file; if all comparisons are correct, delete the second test result set file generated this time, otherwise retain the second test result set file for subsequent testers to manually compare.

[0080] In addition, it should be noted that both the historical database and the iterative database in the technical solution of the present invention are relational databases. A relational database usually expresses and implements its data in the structure of a two - dimensional table, and its data format and length strictly comply with the definition of its corresponding two - dimensional table. Since the data stored in it are all structured data, it can be relatively conveniently directly recorded into a text file and used for verification and comparison.

[0081] See Figure 2 , the second aspect of the present invention provides a database iterative testing device, and the database iterative testing device includes:

[0082] A selection module 10 for selecting a version from the historical databases of previous versions as the reference database;

[0083] A first construction module 20 for constructing a first test case adapted to the reference database;

[0084] The first test module 30 is configured to test the reference database by using the first test case to obtain a first test result set;

[0085] The verification module 40 is configured to verify whether the first test result set meets the expected effect;

[0086] The judgment and adjustment module 50 is configured to adjust the first test case when the first test result set does not meet the expected effect until the first test result set meets the expected effect;

[0087] The storage module 60 is configured to store the first test case when the first test result set meets the expected effect as a reference test case, and store the first test result set that meets the expected effect as a reference result set;

[0088] The acquisition module 70 is configured to acquire an iterative database;

[0089] The second construction module 80 is configured to construct a second test case, where the second test case includes all use case statements of the first test case and use case statements of newly added test key points;

[0090] The second test module 90 is configured to test the iterative database by using the second test case to obtain a second test result set;

[0091] The comparison module 100 is configured to compare the second test result set with the reference result set, collect difference information that appears during the comparison process, and generate a report file of the difference information.

[0092] In an optional implementation manner of the second aspect of the present invention, the first construction module includes:

[0093] The module generation unit is configured to generate syntax template data according to the test standard of the reference database, where the syntax template data includes a test case pseudocode set that conforms to the database test standard and instance data parameter definition data;

[0094] The instance generation unit is configured to generate instance data enumerated values according to the instance data parameter definition data and the basic information of the database to be tested;

[0095] The replacement unit is configured to replace the instance data enumerated values with the parameters in the syntax template data to obtain a first test case.

[0096] In an optional implementation manner of the second aspect of the present invention, the first test module includes:

[0097] The input unit is configured to input the first test case into a database test program;

[0098] An initialization unit for initializing the test environment of the database test program;

[0099] A scanning unit for scanning each test case statement in the first test case by using the database test program and performing analysis;

[0100] An allocation unit for sending different test case statements to different modules in the database test program for execution according to the analysis results;

[0101] A storage unit for obtaining the execution results of each module and outputting different formats to the memory for temporary storage.

[0102] In an optional implementation manner of the second aspect of the present invention, the verification module includes:

[0103] A judgment unit for judging whether an unexpected error appears in the execution result;

[0104] A first determination unit for determining that the first test result set reaches the expected effect if no unexpected error appears in the execution result;

[0105] A second determination unit for determining that the first test result set does not reach the expected effect if an unexpected error appears in the execution result.

[0106] In an optional implementation manner of the second aspect of the present invention, the judgment and adjustment module includes:

[0107] A prompt unit for, when the first test result set does not reach the expected effect, the database test program outputs an error prompt to notify the tester to adjust the first test case;

[0108] A re-input unit for re-inputting the adjusted first test case into the database test program to obtain the first test result set again.

[0109] In an optional implementation manner of the second aspect of the present invention, the comparison module includes:

[0110] A comparison unit for comparing the execution results of the second test result set and the reference results in the reference result set item by item;

[0111] A first error generation module for generating a difference information indicating non-existence in comparison and recording it into the report file if the execution result does not have a corresponding reference result in the reference result set;

[0112] A second error generation module is configured to, if the execution result has a corresponding benchmark result in the benchmark result set, compare the result data of the execution result with the result data of the benchmark result, find out the difference information in specific details between the execution result and the benchmark result, and record it in the report file.

[0113] In an optional implementation manner of the second aspect of the present invention, both the historical database and the iterative database are relational databases, and the first test case and the second test case are organized in the format of csv files.

[0114] Figure 3 FIG. is a schematic structural diagram of a database iterative testing device provided by an embodiment of the present invention. The database iterative testing device may vary greatly due to configuration or performance, and may include one or more processors 110 (central processing units, CPUs) (for example, one or more processors) and a memory 120, and one or more storage media 130 for storing application programs or data (for example, one or more mass storage devices). Among them, the memory and the storage media may be transient storage or persistent storage. The program stored in the storage media may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the database iterative testing device. Further, the processor may be configured to communicate with the storage media and execute a series of instruction operations in the storage media on the database iterative testing device.

[0115] The database iterative testing device of the present invention may further include one or more power supplies 140, one or more wired or wireless network interfaces 150, one or more input / output interfaces 160, and / or one or more operating systems, such as Windows Serve, Mac OS X, Unix, Linux, FreeBSD, and so on. Those skilled in the art can understand that Figure 3 The shown structural diagram of the database iterative testing device does not limit the database iterative testing device, and may include more or fewer components than shown, or combine some components, or have different component arrangements.

[0116] The present invention also provides a computer-readable storage medium, which may be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. Instructions are stored in the computer-readable storage medium. When the instructions run on a computer, the computer is caused to execute the steps of the database iterative testing method.

[0117] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, or units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0118] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0119] As described above, the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements for some of the technical features; and these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A database iterative testing method, characterized in that, The described database iterative testing method includes: Select a version from the historical databases of previous versions as the benchmark database; Construct a first test case adapted to the benchmark database; Use the first test case to test the benchmark database to obtain a first test result set; Verify whether the first test result set meets the expected effect; When the first test result set does not meet the expected effect, adjust the first test case until the first test result set meets the expected effect; Store the first test case when the first test result set meets the expected effect as the benchmark test case, and store the first test result set that meets the expected effect as the benchmark result set; Obtain the iterative database; Construct a second test case, where the second test case includes all the use case statements of the first test case and the use case statements of the newly added test key points; Use the second test case to test the iterative database to obtain a second test result set; Compare the second test result set with the benchmark result set, collect the difference information that appears during the comparison process, and generate a report file of the difference information; The constructing of the first test case adapted to the benchmark database includes: generating syntax template data according to the test standards of the benchmark database, where the syntax template data includes a test case pseudocode set that conforms to the database test standards and instance data formal parameter definition data; generating instance data enumerated values according to the instance data formal parameter definition data and the basic information of the database to be tested; replacing the formal parameters in the syntax template data with the instance data enumerated values to obtain the first test case; The first test case and the second test case are organized in the format of a csv file; The using of the first test case to test the benchmark database to obtain a first test result set includes: inputting the first test case into the database test program; initializing the test environment of the database test program; using the database test program to scan each use case statement in the first test case and perform analysis; sending different use case statements to different modules in the database test program for execution according to the analysis results; obtaining the execution results of each module and outputting different formats to the memory for temporary storage; The comparing of the second test result set with the benchmark result set, collecting the difference information that appears during the comparison process, and generating a report file of the difference information includes: comparing the execution results of the second test result set with the benchmark results in the benchmark result set one by one; if the execution result does not have a corresponding benchmark result in the benchmark result set, generate a difference information of non-existence in the comparison and record it in the report file; if the execution result has a corresponding benchmark result in the benchmark result set, compare the result data of the execution result with the result data of the benchmark result, and find out the specific detailed difference information between the execution result and the benchmark result and record it in the report file.

2. The database iterative testing method according to claim 1, wherein Verifying whether the first test result set meets the expected effect includes: Determining whether there are unexpected errors in the execution results; If there are no unexpected errors in the execution results, it is determined that the first test result set meets the expected effect; If there are unexpected errors in the execution results, it is determined that the first test result set does not meet the expected effect.

3. The database iterative testing method according to claim 1, wherein When the first test result set does not meet the expected effect, adjusting the first test case until the first test result set meets the expected effect includes: When the first test result set does not meet the expected effect, the database iterative test program outputs an error prompt to notify the tester to adjust the first test case; Re-input the adjusted first test case into the database iterative test program to obtain the first test result set again.

4. The database iterative testing method according to claim 1, wherein Both the historical database and the iterative database are relational databases.

5. A database iterative testing device, characterized in that, The database iterative test device includes: A selection module for selecting a version from the historical databases of previous versions as the reference database; A first construction module for constructing a first test case adapted to the reference database; A first test module for testing the reference database using the first test case to obtain a first test result set; A verification module for verifying whether the first test result set meets the expected effect; A judgment and adjustment module for adjusting the first test case when the first test result set does not meet the expected effect until the first test result set meets the expected effect; A storage module for storing the first test case when the first test result set meets the expected effect as the reference test case, and storing the first test result set that meets the expected effect as the reference result set; An acquisition module for acquiring the iterative database; A second construction module for constructing a second test case, where the second test case includes all the case statements of the first test case and the case statements of the newly added test key points; A second test module for testing the iterative database using the second test case to obtain a second test result set; A comparison module for comparing the second test result set with the reference result set, collecting the difference information during the comparison process, and generating a report file of the difference information; The first construction module includes: a module generation unit for generating syntax template data according to the test standards of the reference database, where the syntax template data includes a set of test case pseudocodes that meet the database test standards and instance data parameter definition data; an instance generation unit for generating instance data enumeration values according to the instance data parameter definition data and the basic information of the database to be tested; a replacement unit for replacing the instance data enumeration values with the parameters in the syntax template data to obtain the first test case; The first test case and the second test case are organized in the format of a csv file. The testing of the reference database using the first test case to obtain the first test result set includes: inputting the first test case into the database testing program; initializing the test environment of the database testing program; using the database testing program to scan and analyze each test case statement in the first test case; sending different test case statements to different modules in the database testing program for execution according to the analysis results; obtaining the execution results of each module and outputting them in different formats to the memory for temporary storage. Comparing the second test result set with the reference result set, collecting the difference information that appears during the comparison process, and generating a report file for the difference information includes: comparing the execution results of the second test result set with the reference results in the reference result set item by item; if there is no corresponding reference result for the execution result in the reference result set, generating a difference information indicating non-existence in the comparison and recording it in the report file; if there is a corresponding reference result for the execution result in the reference result set, comparing the result data of the execution result with the result data of the reference result to find the specific difference information between the execution result and the reference result and recording it in the report file.

6. A database iterative testing device, characterized in that, The database iterative testing device includes: a memory and at least one processor, where instructions are stored in the memory, and the memory and the at least one processor are interconnected by a line. The at least one processor invokes the instructions in the memory so that the database iterative testing device executes the database iterative testing method according to any one of claims 1-4.

7. A computer-readable storage medium, on which a computer program is stored, characterized in that, The computer program, when executed by a processor, implements the database iterative testing method according to any one of claims 1-4.

Citation Information

Patent Citations

  • Database testing method and device, equipment and storage medium

    CN109726136A