CN111767213B - Database check point testing method and device, electronic equipment and storage medium - Google Patents
Database check point testing method and device, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN111767213B CN111767213B CN202010561840.0A CN202010561840A CN111767213B CN 111767213 B CN111767213 B CN 111767213B CN 202010561840 A CN202010561840 A CN 202010561840A CN 111767213 B CN111767213 B CN 111767213B
- Authority
- CN
- China
- Prior art keywords
- database
- log file
- inspection point
- target
- test case
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention provides a method and a device for testing a database check point, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a database inspection point test case and executing the database inspection point test case, wherein the database inspection point test case comprises database inspection point expected data; after the database inspection point test cases are executed, a database inspection point monitoring plug-in is called to acquire a target log file in a database; analyzing the actual data written into the fields in the database target database table after the database inspection point test case is executed from the target log file, and comparing the actual data with the expected data of the database inspection point. Therefore, the comparison of actual data and expected data can be realized based on the log files in the database, SQL sentences are not required to be injected into the automatic test codes, the automatic test is not invasive, the automatic test is prevented from being unable to be normally carried out, and the workload of testers is correspondingly reduced.
Description
Technical Field
The present invention relates to the field of automated testing technologies, and in particular, to a method and apparatus for testing a database checkpoint, an electronic device, and a storage medium.
Background
Automated testing is a process of converting human-driven testing behavior into machine execution, typically by a tester performing the test step by step according to the protocols described in the test cases, resulting in a comparison of actual results with expected results. Testing that requires checkpointing of a database is often encountered in automated testing procedures. However, the database tables contained in the general project at present are often tens, and each database table is tested by a database check point, so that the workload of the test is very huge. In addition, if fields are added or changed in these database tables, the test implementation of the database checkpoints is affected. Therefore, how to simply and efficiently implement the test of database checkpoints is an urgent requirement for the automated test.
In the related art, after the automated test is performed, an SQL (Structured Query Language ) statement needs to be injected into the automated test code to query the database, so as to obtain the data of the fields in the database table after the automated test is performed, and compare the data with the expected result. Because the current implementation mode belongs to hard coding, if fields in a database table change, SQL sentences in corresponding automatic test codes change, workload of testers is increased, and the test of a database check point is invaded into the automatic test, if the test of the database check point fails, the automatic test cannot be normally performed.
Disclosure of Invention
The embodiment of the invention aims to provide a method and a device for testing a database check point, electronic equipment and a storage medium, so as to realize the beneficial effects of reducing the workload of testers, being non-invasive to automatic testing and avoiding that the automatic testing cannot be normally performed. The specific technical scheme is as follows:
in a first aspect of the embodiment of the present invention, there is provided a method for testing a database checkpoint, where testing and automated testing of the database checkpoint are performed independently of each other, the method including:
acquiring a database inspection point test case and executing the database inspection point test case, wherein the database inspection point test case comprises database inspection point expected data;
after the database inspection point test cases are executed, a database inspection point monitoring plug-in is called to acquire a target log file in a database;
and analyzing the actual data written into the fields in the database target database table after the database inspection point test case is executed from the target log file, and comparing the actual data with the expected data of the database inspection point.
In an alternative embodiment, the method further comprises:
before executing the database inspection point test case, calling the database inspection point monitoring plug-in to acquire an initial log file in a database;
the step of analyzing the actual data written into the fields in the database target database table after the database inspection point test case is executed from the target log file comprises the following steps:
calling the database checkpoint monitoring plug-in to calculate an incremental log file according to the initial log file and the target log file;
and analyzing and executing the actual data written into the fields in the database target database table after the database inspection point test cases are completed from the incremental log file.
In an alternative embodiment, the invoking the database checkpoint monitoring plug-in to calculate an incremental log file from the initial log file and the target log file includes:
invoking the database checkpoint monitoring plug-in to determine a first file size of the initial log file;
invoking the database checkpoint monitoring plug-in to determine a second file size of the target log file;
invoking the database checkpoint monitoring plug-in to calculate a difference between the first file size and the second file size;
calling the database check point monitoring plug-in to acquire log information from the tail part of the target log file until the size of the log information is equal to the difference value;
and calling the database checkpoint monitoring plug-in to generate an incremental log file based on the log information.
In an alternative embodiment, said comparing with said database checkpoint expected data comprises:
analyzing a database check point test executive side identifier and a database table identifier from the increment log file;
matching the database inspection point test cases according to the test executor identifiers and the database table identifiers;
and comparing the expected data of the database check point included in the database check point test case.
In an optional implementation manner, the parsing the actual data written into the field in the database target database table after the database checkpoint test case is executed from the target log file includes:
recording the moment of executing the database inspection point test case;
extracting incremental log information after the moment from the target log file;
and analyzing and executing the actual data written into the fields in the database target database table after the database inspection point test cases are completed from the incremental log information.
In an alternative embodiment, before executing the database checkpoint test cases, the method further comprises:
and (5) clearing log information contained in the target log file in the database.
In an alternative embodiment, the method further comprises:
and generating a test report of the database check point in a preset format based on the comparison result of the actual data and the expected data of the database check point.
In a second aspect of the embodiments of the present invention, there is also provided a device for testing a database checkpoint, where the testing of the database checkpoint and the automated testing are performed independently of each other, the device including:
the system comprises a case execution module, a database inspection point test case generation module and a database inspection point test module, wherein the case execution module is used for acquiring a database inspection point test case and executing the database inspection point test case, and the database inspection point test case comprises database inspection point expected data;
the file acquisition module is used for calling the database check point monitoring plug-in to acquire a target log file in the database after the database check point test case is executed;
and the data comparison module is used for analyzing the actual data written into the fields in the database target database table after the database inspection point test case is executed from the target log file, and comparing the actual data with the database inspection point expected data.
In a third aspect of the embodiment of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
and the processor is used for realizing the testing method of the database check point in any one of the first aspect when executing the program stored in the memory.
In a fourth aspect of embodiments of the present invention, there is also provided a storage medium having stored therein instructions that, when executed on a computer, cause the computer to perform the method for testing a database checkpoint as described in any one of the first aspects above.
In a fifth aspect of embodiments of the present invention, there is also provided a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of testing a database checkpoint as in any of the first aspects above.
According to the technical scheme provided by the embodiment of the invention, the database check point test cases are acquired and executed, after the execution of the database check point test cases is finished, the database check point monitoring plug-in is called to acquire the target log file in the database, the actual data written into the database table fields in the database after the execution of the database check point test cases is analyzed from the target log file, and the actual data is compared with the expected database check point data contained in the database check point test cases. Therefore, the comparison of actual data and expected data can be realized based on the log files in the database, SQL sentences are not required to be injected into the automatic test codes, the automatic test is not invasive, the automatic test is prevented from being unable to be normally carried out, and the workload of testers is correspondingly reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the invention or the technical solutions of the prior art, the drawings which are used in the description of the embodiments or the prior art will be briefly described, and it will be obvious to a person skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic flow chart of a method for testing database checkpoints according to an embodiment of the present invention;
FIG. 2 is a flow chart illustrating another exemplary method for testing database checkpoints according to an embodiment of the present invention;
FIG. 3 is a flow chart illustrating another exemplary method for testing database checkpoints according to an embodiment of the present invention;
FIG. 4 is a flow chart illustrating another exemplary method for testing database checkpoints according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a database checkpoint testing apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
As shown in fig. 1, a schematic implementation flow chart of a method for testing a database checkpoint according to an embodiment of the present invention may specifically include the following steps:
s101, acquiring a database inspection point test case and executing the database inspection point test case, wherein the database inspection point test case comprises database inspection point expected data;
in the embodiment of the invention, a tester can predesign a database inspection point test case and store the database inspection point test case, wherein the database inspection point test case can write data into one or a plurality of database tables aiming at calling a database interface, and the designed database inspection point test case can be used for initiating the operation of writing the data by an inserting operation or a changing operation.
The database inspection point test case may include an address of a tested database interface, an entry of the tested database interface, expected data of a database inspection point, and the like, which is not limited in the embodiment of the present invention.
The embodiment of the invention can acquire the database inspection point test case and execute the database inspection point test case, and the expected data of the database inspection point contained in the database inspection point test case can be shown in the following table 1.
Name of name | Age of | Learning calendar | Sex (sex) |
Zhang San | 25 | Gramineae (Gramineae) | Man's body |
Li Si | 25 | Gramineae (Gramineae) | Man's body |
TABLE 1
S102, after the database inspection point test case is executed, a database inspection point monitoring plug-in is called to acquire a target log file in a database;
in the embodiment of the invention, the database check point monitoring plug-in is designed in advance, can be realized based on shell and other languages, and is used for sensing the change of the field in the target database table of the database after the execution of the database check point test case is finished so as to conveniently acquire the target log file in the database.
Therefore, after the database checkpoint test cases are executed, the embodiment of the invention can call the database checkpoint monitoring plug-in to acquire the target log files in the database. For example, for database a, after the database checkpoint test cases are executed, the database checkpoint monitoring plug-in is invoked to obtain the binlog in database a.
S103, analyzing and executing the actual data written into the fields in the database target database table after the database inspection point test cases are completed from the target log file, and comparing the actual data with the database inspection point expected data.
In the embodiment of the present invention, for the target log file, specific log information is parsed from the target log file: and obtaining actual data written into fields in a database target database table after the database inspection point test case is executed from the insert intoand update log information, and comparing the actual data with expected data of the database inspection point included in the database inspection point test case.
For example, for a binlog log in database a, specific log information in the binlog is parsed: and obtaining actual data written into fields in a database target database table after the database inspection point test cases are executed from the insert intoand update log information, wherein the actual data is shown in the following table 2.
Name of name | Age of | Learning calendar | Sex (sex) |
Zhang San | 25 | Gramineae (Gramineae) | Man's body |
Li Si | 25 | Gramineae (Gramineae) | Man's body |
TABLE 2
The actual data shown in the above table 2 is compared with the expected data of the database checkpoints included in the database checkpoint test cases shown in the above table 1, and the actual data is consistent with the expected data.
Through the description of the technical scheme provided by the embodiment of the invention, the database check point test cases are acquired and executed, after the execution of the database check point test cases is finished, the database check point monitoring plug-in is called to acquire the target log file in the database, the actual data written into the database table field in the database after the execution of the database check point test cases is analyzed from the target log file, and the actual data is compared with the database check point expected data contained in the database check point test cases. Therefore, the comparison of actual data and expected data can be realized based on the log files in the database, SQL sentences are not required to be injected into the automatic test codes, the automatic test is not invasive, the automatic test is prevented from being unable to be normally carried out, and the workload of testers is correspondingly reduced.
As shown in fig. 2, a flowchart of another method for testing a database checkpoint according to an embodiment of the present invention may specifically include the following steps:
s201, acquiring a database inspection point test case and executing the database inspection point test case, wherein the database inspection point test case comprises database inspection point expected data;
in the embodiment of the present invention, the step is similar to the step S101, and the embodiment of the present invention is not described here again.
S202, calling the database check point monitoring plug-in to acquire an initial log file in a database before executing the database check point test case;
for the database checkpoint test case, before the database checkpoint test case is executed, the embodiment of the invention can call the database checkpoint monitoring plug-in to acquire the initial log file in the database, and can store the initial log file in the database, thereby facilitating the subsequent calculation of the incremental log file.
For example, before executing the database checkpoint test cases, the embodiment of the present invention invokes the database checkpoint monitoring plug-in to obtain an initial log file in the database and stores the initial log file in the database in the following format, as shown in table 3 below.
Key | Value |
Initial log file name | File size |
TABLE 3 Table 3
S203, after the database inspection point test case is executed, a database inspection point monitoring plug-in is called to acquire a target log file in a database;
in the embodiment of the present invention, the step is similar to the step S102, and the embodiment of the present invention is not described here again.
S204, calling the database checkpoint monitoring plug-in to calculate an incremental log file according to the initial log file and the target log file;
according to the embodiment of the invention, the database check point monitoring plug-in is called to calculate the incremental log file based on the initial log file and the target log file, and then the actual data written into the field in the database target database table after the database check point test case is executed is analyzed from the incremental log file, so that the analysis efficiency and the test efficiency can be effectively improved.
The embodiment of the invention calls the database check point monitoring plug-in to determine the first file size of the initial log file; invoking the database checkpoint monitoring plug-in to determine a second file size of the target log file; invoking the database checkpoint monitoring plug-in to calculate a difference between the first file size and the second file size; calling the database check point monitoring plug-in to acquire log information from the tail part of the target log file until the size of the log information is equal to the difference value; and calling the database checkpoint monitoring plug-in to generate an incremental log file based on the log information.
For example, a database checkpoint monitoring plug-in is invoked to determine a first file size of an initial log file: 15KB, calling a database checkpoint monitoring plug-in to determine a second file size of the target log file: 20KB, calling a database checkpoint monitoring plug-in to calculate the difference between the first file size and the second file size: and 5KB, calling a database checkpoint monitoring plug-in to acquire log information from the tail of the target log file until the size of the log information is 5KB, and calling the database checkpoint monitoring plug-in to generate an incremental log file based on the log information of the 5 KB.
S205, analyzing the actual data written into the fields in the database target database table after the database inspection point test cases are executed from the incremental log file, and comparing the actual data with the database inspection point expected data.
In order to improve file analysis efficiency and test efficiency, the embodiment of the invention can analyze specific log information from the incremental log file: and obtaining actual data written into fields in a database target database table after the database inspection point test case is executed from the insert intoand update log information, and comparing the actual data with expected data of the database inspection point included in the database inspection point test case.
For example, for a delta log file, specific log information is parsed from the delta log file: and obtaining actual data written into fields in a database target database table after the database inspection point test case is executed from the insert intoand update log information, and comparing the actual data with expected data of a database inspection point included in the database inspection point test case shown in the table 1 as shown in the table 2, wherein the actual data is consistent with the expected data.
Analyzing a database check point test executor identifier and a database table identifier from the incremental log file, matching the database check point test case with the database check point expected data included in the database check point test case according to the test executor identifier and the database table identifier, and comparing the database check point expected data with the database check point expected data included in the database check point test case.
For example, the embodiment of the present invention establishes a corresponding relationship between the database checkpoint test case and the database checkpoint test executor identifier and the database table identifier in advance, as shown in the following table 4.
TABLE 4 Table 4
Analyzing the identification of the database checkpoint test executor from the incremental log file: zhang III, and database table identification: database table a, according to test executor identification: zhang III, and database table identification: the database table A is matched with the database inspection point test case 1, and the actual data written into the fields in the database target database table (database table A) after the database inspection point test case is executed is compared with the expected data of the database inspection point included in the database inspection point test case 1.
As shown in fig. 3, a flowchart of another method for testing a database checkpoint according to an embodiment of the present invention may specifically include the following steps:
s301, acquiring a database inspection point test case and executing the database inspection point test case, wherein the database inspection point test case comprises database inspection point expected data;
in the embodiment of the present invention, the step is similar to the step S101, and the embodiment of the present invention is not described here again.
S302, after the database inspection point test case is executed, a database inspection point monitoring plug-in is called to acquire a target log file in a database;
in the embodiment of the present invention, the step is similar to the step S102, and the embodiment of the present invention is not described here again.
S303, recording the moment of executing the database inspection point test case;
in the embodiment of the invention, the moment of executing the database checkpoint test case can be recorded in the process of executing the database checkpoint test case.
For example, when 12:00 starts executing the database checkpoint test cases, the embodiment of the present invention records the time when the database checkpoint test cases are executed: 12:00.
S304, extracting the moment and increment log information after the moment from the target log file;
for the target log file, the embodiment of the invention extracts the time and the increment log information after the time from the target log file, which means that after the database inspection point test case is executed, the database inspection point monitoring plug-in is called to acquire the target log file in the database, and the increment log information after the time and the time is extracted from the target log file, thereby reducing the extraction of information quantity and effectively improving the analysis efficiency and the test efficiency.
For example, after the database checkpoint test cases are executed, a database checkpoint monitoring plug-in is called to acquire a target log file in the database, and incremental log information after 12:00 and 12:00 is extracted from the target log file.
S305, analyzing and executing the actual data of the fields in the database target database table after the database inspection point test cases are completed from the increment log information.
For the extracted incremental log information, the embodiment of the invention analyzes specific log information from the incremental log information: and obtaining actual data written into fields in a database target database table after the database inspection point test case is executed from the insert intoand update log information, and comparing the actual data with expected data of the database inspection point included in the database inspection point test case.
For example, for incremental log information, specific log information is parsed from the incremental log information: and obtaining actual data written into fields in a database target database table after the database inspection point test case is executed from the insert intoand update log information, and comparing the actual data with expected data of a database inspection point included in the database inspection point test case shown in the table 1 as shown in the table 2, wherein the actual data is consistent with the expected data.
As shown in fig. 4, a flowchart of another method for testing a database checkpoint according to an embodiment of the present invention may specifically include the following steps:
s401, acquiring a database inspection point test case and executing the database inspection point test case, wherein the database inspection point test case comprises database inspection point expected data;
in the embodiment of the present invention, the steps are similar to the step S101, and the embodiment of the present invention is not described here again
S402, before executing the database inspection point test case, clearing log information contained in a target log file in a database;
in the embodiment of the invention, before the database inspection point test case is executed, the log information contained in the target log file in the database can be selected to be emptied, so that the log information contained in the target log file in the database is empty, and after the database inspection point test case is executed, the log information contained in the target log file in the database, namely the incremental log information, can be directly obtained.
S403, after the database inspection point test case is executed, a database inspection point monitoring plug-in is called to acquire a target log file in a database;
in the embodiment of the present invention, the step is similar to the step S102, and the embodiment of the present invention is not described here again.
S404, analyzing and executing the actual data written into the fields in the database target database table after the database inspection point test cases are completed from the target log file, and comparing the actual data with the database inspection point expected data;
in the embodiment of the present invention, the step is similar to the step S103, and the embodiment of the present invention is not described here again.
S405, based on the comparison result of the actual data and the expected data of the database check point, a test report of the database check point in a preset format is generated.
For the comparison result of the actual data and the expected data of the database check point, the embodiment of the invention can generate the test report of the database check point with the preset format based on the comparison result.
The test report of the database check point in the preset format may be a test report of the database check point in the HTML (Hyper Text Markup Language ) format, and may be a test report of the database check point in the Excel format, which is not limited in the embodiment of the present invention.
For the content included in the test report of the database checkpoint, it may be as follows: the number of the matched database inspection point test case, the database inspection point test case parameter, the test executor identifier, the database table identifier, the time of writing in the actual data, the actual data and the analysis result (A, success; B, failure, field of specific failure).
For a test report of a database checkpoint in a preset format, the test report may be presented in an interface for a tester to view, and the test report of the database checkpoint in the preset format may be stored.
Corresponding to the above method embodiment, the embodiment of the present invention further provides a device for testing a database checkpoint, as shown in fig. 5, where the device may include: a use case execution module 510, a file acquisition module 520, and a data comparison module 530.
The case execution module 510 is configured to obtain a database checkpoint test case, and execute the database checkpoint test case, where the database checkpoint test case includes database checkpoint expected data;
the file obtaining module 520 is configured to call a database checkpoint monitoring plug-in to obtain a target log file in the database after the database checkpoint test case is executed;
and the data comparison module 530 is configured to parse the actual data written into the field in the database target database table after the database checkpoint test case is executed from the target log file, and compare the actual data with the database checkpoint expected data.
In the specific implementation of the embodiments of the present invention,
the file obtaining module 520 is further configured to invoke the database checkpoint monitoring plug-in to obtain an initial log file in a database before executing the database checkpoint test case;
the data comparison module 530 specifically includes:
a file calculation sub-module 531, configured to invoke the database checkpoint monitoring plug-in to calculate an incremental log file according to the initial log file and the target log file;
the data comparison sub-module 532 is configured to parse the actual data written into the field in the database target database table after the database checkpoint test case is executed from the incremental log file.
In a specific implementation of the embodiment of the present invention, the file computing sub-module 531 is specifically configured to:
invoking the database checkpoint monitoring plug-in to determine a first file size of the initial log file;
invoking the database checkpoint monitoring plug-in to determine a second file size of the target log file;
invoking the database checkpoint monitoring plug-in to calculate a difference between the first file size and the second file size;
calling the database check point monitoring plug-in to acquire log information from the tail part of the target log file until the size of the log information is equal to the difference value;
and calling the database checkpoint monitoring plug-in to generate an incremental log file based on the log information.
In a specific implementation of the embodiment of the present invention, the data comparison module 530 is specifically configured to:
analyzing a database check point test executive side identifier and a database table identifier from the increment log file;
matching the database inspection point test cases according to the test executor identifiers and the database table identifiers;
and comparing the expected data of the database check point included in the database check point test case.
In a specific implementation of the embodiment of the present invention, the data comparison module 530 is specifically configured to:
recording the moment of executing the database inspection point test case;
extracting incremental log information after the moment from the target log file;
and analyzing and executing the actual data written into the fields in the database target database table after the database inspection point test cases are completed from the incremental log information.
In a specific implementation of the embodiment of the present invention, the apparatus further includes:
and the information emptying module 540 is configured to empty log information contained in the target log file in the database before the database checkpoint test case is executed.
In a specific implementation of the embodiment of the present invention, the apparatus further includes:
and the report generating module 550 is configured to generate a test report of the database checkpoint in a preset format based on a comparison result of the actual data and the database checkpoint expected data.
The embodiment of the invention also provides an electronic device, as shown in fig. 6, which comprises a processor 61, a communication interface 62, a memory 63 and a communication bus 64, wherein the processor 61, the communication interface 62 and the memory 63 complete communication with each other through the communication bus 64,
a memory 63 for storing a computer program;
the processor 61 is configured to execute the program stored in the memory 63, and implement the following steps:
acquiring a database inspection point test case and executing the database inspection point test case, wherein the database inspection point test case comprises database inspection point expected data; after the database inspection point test cases are executed, a database inspection point monitoring plug-in is called to acquire a target log file in a database; and analyzing the actual data written into the fields in the database target database table after the database inspection point test case is executed from the target log file, and comparing the actual data with the expected data of the database inspection point.
The communication bus mentioned by the above electronic device may be a peripheral component interconnect standard (Peripheral Component Interconnect, abbreviated as PCI) bus or an extended industry standard architecture (Extended Industry Standard Architecture, abbreviated as EISA) bus, or the like. The communication bus may be classified as an address bus, a data bus, a control bus, or the like. For ease of illustration, the figures are shown with only one bold line, but not with only one bus or one type of bus.
The communication interface is used for communication between the electronic device and other devices.
The memory may include random access memory (Random Access Memory, RAM) or non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU for short), a network processor (Network Processor, NP for short), etc.; but also digital signal processors (Digital Signal Processing, DSP for short), application specific integrated circuits (Application Specific Integrated Circuit, ASIC for short), field-programmable gate arrays (Field-Programmable Gate Array, FPGA for short) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In yet another embodiment of the present invention, a storage medium is provided, in which instructions are stored which, when executed on a computer, cause the computer to perform the method for testing a database checkpoint as in any of the above embodiments.
In yet another embodiment of the present invention, a computer program product comprising instructions that, when run on a computer, cause the computer to perform the method of testing a database checkpoint as in any of the embodiments above is also provided.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present invention, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in a storage medium or transmitted from one storage medium to another, for example, from one website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The storage media may be any available media that can be accessed by a computer or a data storage device such as a server, data center, or the like that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), etc.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing description is only of the preferred embodiments of the present invention and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (8)
1. A method for testing a database checkpoint, wherein testing of the database checkpoint and automated testing are performed independently of each other, the method comprising:
acquiring a database inspection point test case and executing the database inspection point test case, wherein the database inspection point test case comprises database inspection point expected data;
before executing the database inspection point test case, calling the database inspection point monitoring plug-in to acquire an initial log file in a database;
after the database inspection point test cases are executed, a database inspection point monitoring plug-in is called to acquire a target log file in a database;
analyzing the actual data written into the fields in the database target database table after the database inspection point test cases are executed from the target log file, and comparing the actual data with the expected data of the database inspection point;
analyzing the actual data written into the fields in the database target database table after the database inspection point test case is executed from the target log file, wherein the method comprises the following steps: calling the database checkpoint monitoring plug-in to calculate an incremental log file according to the initial log file and the target log file; analyzing and executing the actual data of the field in the database target database table after the database inspection point test case is completed from the increment log file;
the calling the database checkpoint monitoring plug-in to calculate an incremental log file according to the initial log file and the target log file comprises the following steps: invoking the database checkpoint monitoring plug-in to determine a first file size of the initial log file; invoking the database checkpoint monitoring plug-in to determine a second file size of the target log file; invoking the database checkpoint monitoring plug-in to calculate a difference between the first file size and the second file size; calling the database check point monitoring plug-in to acquire log information from the tail part of the target log file until the size of the log information is equal to the difference value; and calling the database checkpoint monitoring plug-in to generate an incremental log file based on the log information.
2. The method of claim 1, wherein the comparing with the database checkpoint expected data comprises:
analyzing a database check point test executive side identifier and a database table identifier from the increment log file;
matching the database inspection point test cases according to the test executor identifiers and the database table identifiers;
and comparing the expected data of the database check point included in the database check point test case.
3. The method of claim 1, wherein parsing the actual data written to the fields in the database target database table after the database checkpoint test case is executed from the target log file comprises:
recording the moment of executing the database inspection point test case;
extracting incremental log information after the moment from the target log file;
and analyzing and executing the actual data written into the fields in the database target database table after the database inspection point test cases are completed from the incremental log information.
4. The method of claim 1, wherein prior to executing the database checkpoint test cases, the method further comprises:
and (5) clearing log information contained in the target log file in the database.
5. The method according to any one of claims 1 to 4, further comprising:
and generating a test report of the database check point in a preset format based on the comparison result of the actual data and the expected data of the database check point.
6. A database checkpoint testing apparatus wherein database checkpoint testing and automated testing are performed independently of each other, the apparatus comprising:
the system comprises a case execution module, a database inspection point test case generation module and a database inspection point test module, wherein the case execution module is used for acquiring a database inspection point test case and executing the database inspection point test case, and the database inspection point test case comprises database inspection point expected data; before executing the database inspection point test case, calling the database inspection point monitoring plug-in to acquire an initial log file in a database;
the file acquisition module is used for calling the database check point monitoring plug-in to acquire a target log file in the database after the database check point test case is executed;
the data comparison module is used for analyzing the actual data written into the fields in the database target database table after the database inspection point test cases are executed from the target log file, and comparing the actual data with the database inspection point expected data;
analyzing the actual data written into the fields in the database target database table after the database inspection point test case is executed from the target log file, wherein the method comprises the following steps: calling the database checkpoint monitoring plug-in to calculate an incremental log file according to the initial log file and the target log file; analyzing and executing the actual data of the field in the database target database table after the database inspection point test case is completed from the increment log file;
the calling the database checkpoint monitoring plug-in to calculate an incremental log file according to the initial log file and the target log file comprises the following steps: invoking the database checkpoint monitoring plug-in to determine a first file size of the initial log file; invoking the database checkpoint monitoring plug-in to determine a second file size of the target log file; invoking the database checkpoint monitoring plug-in to calculate a difference between the first file size and the second file size; calling the database check point monitoring plug-in to acquire log information from the tail part of the target log file until the size of the log information is equal to the difference value; and calling the database checkpoint monitoring plug-in to generate an incremental log file based on the log information.
7. The electronic equipment is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory are communicated with each other through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1-5 when executing a program stored on a memory.
8. A storage medium having stored thereon a computer program, which when executed by a processor, implements the method of any of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010561840.0A CN111767213B (en) | 2020-06-18 | 2020-06-18 | Database check point testing method and device, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010561840.0A CN111767213B (en) | 2020-06-18 | 2020-06-18 | Database check point testing method and device, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111767213A CN111767213A (en) | 2020-10-13 |
CN111767213B true CN111767213B (en) | 2024-04-05 |
Family
ID=72721145
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010561840.0A Active CN111767213B (en) | 2020-06-18 | 2020-06-18 | Database check point testing method and device, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111767213B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112346898B (en) * | 2020-10-28 | 2024-11-01 | 交控科技股份有限公司 | Method and system for testing rail transit system |
CN116150022A (en) * | 2023-03-01 | 2023-05-23 | 上海中通吉网络技术有限公司 | Method, device and storage medium for generating scenario test data |
CN116149969B (en) * | 2023-04-04 | 2023-06-20 | 湖南中青能科技有限公司 | Database model matching anomaly monitoring and processing method |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104636432A (en) * | 2014-12-29 | 2015-05-20 | 大唐移动通信设备有限公司 | Method and device for journal file compression and decompression |
CN109408330A (en) * | 2018-10-15 | 2019-03-01 | 东软集团股份有限公司 | Log analysis method, device, terminal device and readable storage medium storing program for executing |
CN109408378A (en) * | 2018-09-30 | 2019-03-01 | 福建星瑞格软件有限公司 | A kind of test method and system quickly positioning SQL parsing mistake under big data quantity |
CN109460349A (en) * | 2018-09-19 | 2019-03-12 | 武汉达梦数据库有限公司 | A kind of method for generating test case and device based on log |
CN109669622A (en) * | 2017-10-13 | 2019-04-23 | 杭州海康威视系统技术有限公司 | A kind of file management method, document management apparatus, electronic equipment and storage medium |
CN110046086A (en) * | 2018-12-20 | 2019-07-23 | 阿里巴巴集团控股有限公司 | Expected data generation method and device and electronic equipment for test |
CN110083381A (en) * | 2018-01-26 | 2019-08-02 | 启碁科技股份有限公司 | The method and device of increment upgrading |
CN110297866A (en) * | 2019-05-20 | 2019-10-01 | 平安普惠企业管理有限公司 | Method of data synchronization and data synchronization unit based on log analysis |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1387269A1 (en) * | 2002-08-02 | 2004-02-04 | Hewlett Packard Company, a Delaware Corporation | Backup system and method of generating a checkpoint for a database |
US20070288526A1 (en) * | 2006-06-08 | 2007-12-13 | Emc Corporation | Method and apparatus for processing a database replica |
US7991744B2 (en) * | 2008-07-10 | 2011-08-02 | International Business Machines Corporation | Method and system for dynamically collecting data for checkpoint tuning and reduce recovery time |
-
2020
- 2020-06-18 CN CN202010561840.0A patent/CN111767213B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104636432A (en) * | 2014-12-29 | 2015-05-20 | 大唐移动通信设备有限公司 | Method and device for journal file compression and decompression |
CN109669622A (en) * | 2017-10-13 | 2019-04-23 | 杭州海康威视系统技术有限公司 | A kind of file management method, document management apparatus, electronic equipment and storage medium |
CN110083381A (en) * | 2018-01-26 | 2019-08-02 | 启碁科技股份有限公司 | The method and device of increment upgrading |
CN109460349A (en) * | 2018-09-19 | 2019-03-12 | 武汉达梦数据库有限公司 | A kind of method for generating test case and device based on log |
CN109408378A (en) * | 2018-09-30 | 2019-03-01 | 福建星瑞格软件有限公司 | A kind of test method and system quickly positioning SQL parsing mistake under big data quantity |
CN109408330A (en) * | 2018-10-15 | 2019-03-01 | 东软集团股份有限公司 | Log analysis method, device, terminal device and readable storage medium storing program for executing |
CN110046086A (en) * | 2018-12-20 | 2019-07-23 | 阿里巴巴集团控股有限公司 | Expected data generation method and device and electronic equipment for test |
CN110297866A (en) * | 2019-05-20 | 2019-10-01 | 平安普惠企业管理有限公司 | Method of data synchronization and data synchronization unit based on log analysis |
Non-Patent Citations (4)
Title |
---|
Coordinated checkpoint versus message log for fault tolerant MPI;Pierre Lemarinier;《International Journal of High Performance Computing and Networking》;146-155 * |
Transparent Fault Tolerance Solution at Socket Level Based on RADIC;Marcela Castro;《 2012 IEEE 10th International Symposium on Parallel and Distributed Processing with Applications》;1-5 * |
内存数据库关键技术的研究与设计;张浩阳;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;I138-2195 * |
嵌入式内存数据库引擎的研究与实现;晏燕;《中国优秀硕士学位论文全文数据库 (信息科技辑)》;I138-447 * |
Also Published As
Publication number | Publication date |
---|---|
CN111767213A (en) | 2020-10-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8782609B2 (en) | Test failure bucketing | |
CN111767213B (en) | Database check point testing method and device, electronic equipment and storage medium | |
KR101979329B1 (en) | Method and apparatus for tracking security vulnerable input data of executable binaries thereof | |
CN110046086B (en) | Expected data generation method and device for test and electronic equipment | |
CN113238940A (en) | Interface test result comparison method, device, equipment and storage medium | |
CN114756868B (en) | A fingerprint-based network asset and vulnerability association method and device | |
US10782942B1 (en) | Rapid onboarding of data from diverse data sources into standardized objects with parser and unit test generation | |
CN110688823A (en) | XML file verification method and device | |
CN117216095A (en) | Structured query statement detection method, device, equipment and medium | |
CN113419738A (en) | Interface document generation method and device and interface management equipment | |
CN112099838B (en) | Method, device and storage medium for determining version difference | |
CN113868137A (en) | Method, device and system for processing buried point data and server | |
CN112685316A (en) | Code execution path acquisition method and device, computer equipment and storage medium | |
CN117171030A (en) | Method, device, equipment and storage medium for detecting software running environment | |
CN111338956A (en) | Automatic pressure measurement method, device, equipment and storage medium | |
CN116775488A (en) | Abnormal data determination method, device, equipment, medium and product | |
CN117435189A (en) | Test case analysis method, device, equipment and medium of financial system interface | |
CN114048082B (en) | Configuration method, device, computer equipment and storage medium for interface testing | |
CN116680106A (en) | Abnormality locating method, device, equipment and storage medium | |
CN111400245B (en) | Art resource migration method and device | |
CN113672233A (en) | Server out-of-band management method, device and equipment based on Redfish | |
CN113792055A (en) | Data processing method, electronic device and storage medium | |
CN113408250A (en) | Project file processing method and device | |
CN116483377B (en) | Code detection method and device, electronic equipment and storage medium | |
CN115545677B (en) | Online process specification detection method and system based on automatic case execution condition |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |