CN111767213A - Method and device for testing database check points, electronic equipment and storage medium - Google Patents

Method and device for testing database check points, electronic equipment and storage medium Download PDF

Info

Publication number
CN111767213A
CN111767213A CN202010561840.0A CN202010561840A CN111767213A CN 111767213 A CN111767213 A CN 111767213A CN 202010561840 A CN202010561840 A CN 202010561840A CN 111767213 A CN111767213 A CN 111767213A
Authority
CN
China
Prior art keywords
database
check point
test case
database check
log file
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.)
Granted
Application number
CN202010561840.0A
Other languages
Chinese (zh)
Other versions
CN111767213B (en
Inventor
岳晓敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Tongbang Zhuoyi Technology Co ltd
Original Assignee
Beijing Tongbang Zhuoyi Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Tongbang Zhuoyi Technology Co ltd filed Critical Beijing Tongbang Zhuoyi Technology Co ltd
Priority to CN202010561840.0A priority Critical patent/CN111767213B/en
Publication of CN111767213A publication Critical patent/CN111767213A/en
Application granted granted Critical
Publication of CN111767213B publication Critical patent/CN111767213B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test 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 check point test case and executing the database check point test case, wherein the database check point test case comprises expected data of a database check point; after the database check point test case is executed, calling a database check point monitoring plug-in to acquire a target log file in a database; and analyzing and executing actual data written into fields in a database target database table after the database check point test case is completed from the target log file, and comparing the actual data with expected data of the database check point. Therefore, the comparison between the actual data and the expected data can be realized based on the log file in the database, SQL sentences do not need to be injected into the automatic test codes, the automatic test is not intrusive, the automatic test cannot be normally carried out, and the workload of test personnel is correspondingly reduced.

Description

Method and device for testing database check points, electronic equipment and storage medium
Technical Field
The invention relates to the technical field of automatic testing, in particular to a method and a device for testing a database check point, electronic equipment and a storage medium.
Background
Automated testing is a process of converting human-driven testing behavior into machine execution, and testing is usually performed step by a tester according to the procedures described in test cases, so as to obtain a comparison between an actual result and an expected result. Tests that require database checkpointing are often encountered in automated testing processes. However, the number of database tables included in a general project is typically several tens, and a database check point is tested for each database table, so that the workload of testing is very huge. In addition, if new fields or changed fields are added to the database tables, the test implementation of the database check points is affected. Therefore, how to simply and efficiently realize the test of the database check point is an urgent appeal for the automated test.
In the related art, after the automatic test is completed, SQL (Structured Query Language) statements are required to be injected into the automatic test codes to Query the database, so as to obtain data of fields in the database table after the automatic test is completed, and compare the data with an expected result. Because the current implementation mode belongs to hard coding, if the field in the database table changes, the SQL statement in the corresponding automatic test code changes, the workload of testers is increased, the test of the database check point is invaded into the automatic test, and if the test of the database check point fails, the automatic test cannot be normally carried out.
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 achieve the beneficial effects of reducing the workload of testers, having no invasion to an automatic test and avoiding the abnormal operation of the automatic test. The specific technical scheme is as follows:
in a first aspect of the embodiments of the present invention, a method for testing a database checkpoint is provided, where a test of a database checkpoint and an automated test are performed independently, and the method includes:
acquiring a database check point test case and executing the database check point test case, wherein the database check point test case comprises expected data of a database check point;
after the database check point test case is executed, calling a database check point monitoring plug-in to acquire a target log file in a database;
and analyzing and executing the actual data written into the field in the database target database table after the database check point test case is completed from the target log file, and comparing the actual data with the expected data of the database check point.
In an optional embodiment, the method further comprises:
before executing the database check point test case, calling the database check point monitoring plug-in to acquire an initial log file in a database;
the analyzing and executing actual data written into fields in a database target database table after the database check point test case is completely executed from the target log file comprises:
calling the database check point 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 field in the database target database table after the database check point test case is completed from the incremental log file.
In an optional 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:
calling the database check point monitoring plug-in to determine the first file size of the initial log file;
calling the database check point monitoring plug-in to determine the second file size of the target log file;
calling the database check point monitoring plug-in to calculate the 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 check point 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 party identifier and a database table identifier from the incremental log file;
matching the test execution party identifier and the database table identifier to the database check point test case;
and comparing the expected data of the database check point included in the database check point test case.
In an optional embodiment, the parsing, from the target log file, actual data written to a field in a target database table of a database after the completion of executing the test case of the database check point includes:
recording the time of executing the database check point test case;
extracting the time and the incremental log information after the time from the target log file;
and analyzing and executing the actual data written into the field in the database target database table after the database check point test case is completed from the incremental log information.
In an optional embodiment, before executing the database check point test case, the method further includes:
and clearing the log information contained in the target log file in the database.
In an optional embodiment, the method further comprises:
and generating a test report of the database check point in a preset format based on a 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 provided a test apparatus for a database check point, where a test of the database check point and an automated test are performed independently of each other, the apparatus including:
the database inspection point test case execution module is used for acquiring a database inspection point test case and executing the database inspection point test case, wherein the database inspection point test case comprises expected data of a database inspection point;
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 execution of the database check point test case is finished;
and the data comparison module is used for analyzing and executing actual data written into fields in a database target database table after the test case of the database check point is completed from the target log file, and comparing the actual data with expected data of the database check point.
In a third aspect of the embodiments of the present invention, there is further 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;
a processor, configured to implement the method for testing a database check point according to any one of the first aspect described above when executing a program stored in a memory.
In a fourth aspect of the embodiments of the present invention, there is further provided a storage medium, in which instructions are stored, and when the storage medium is run on a computer, the storage medium causes the computer to execute the method for testing the database check point according to any one of the first aspect.
In a fifth aspect of the embodiments of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method for testing a database check point as described in any one of the above first aspects.
According to the technical scheme provided by the embodiment of the invention, the database check point test case is obtained and executed, after the database check point test case is executed, the database check point monitoring plug-in is called to obtain 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 case is finished is analyzed from the target log file, and the actual data is compared with the expected data of the database check point contained in the database check point test case. Therefore, the comparison between the actual data and the expected data can be realized based on the log file in the database, SQL sentences do not need to be injected into the automatic test codes, the automatic test is not intrusive, the automatic test cannot be normally carried out, and the workload of test personnel 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 present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
Fig. 1 is a schematic flow chart illustrating an implementation of a method for testing a database checkpoint in an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating another method for testing a database checkpoint, according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart illustrating another method for testing a database checkpoint, according to an embodiment of the present invention;
FIG. 4 is a schematic flow chart illustrating another method for testing a database checkpoint, according to an embodiment of the present invention;
FIG. 5 is a schematic structural 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 shown in the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
As shown in fig. 1, an implementation flow diagram of a method for testing a database checkpoint provided in an embodiment of the present invention specifically includes the following steps:
s101, obtaining a database check point test case and executing the database check point test case, wherein the database check point test case comprises expected data of a database check point;
in the embodiment of the present invention, a tester may design a database check point test case in advance, and store the database check point test case, where the database check point test case may write data into one or more database tables for invoking a database interface, and the designed database check point test case may be caused to write data by an insertion operation or a change operation.
The database checkpoint test case may include an address of a tested database interface, an entry parameter of the tested database interface, expected data of a database checkpoint, and the like, which is not limited in the embodiment of the present invention.
The embodiment of the present invention may obtain the database check point test case, and execute the database check point test case, where the expected data of the database check point included in the database check point test case may be as shown in table 1 below.
Name (I) Age (age) Study calendar Sex
Zhang three 25 This section For male
Li four 25 This section For male
TABLE 1
S102, after the execution of the database check point test case is finished, calling a database check point monitoring plug-in to acquire a target log file in a database;
the embodiment of the invention designs the database check point monitoring plug-in advance, which 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 database check point test case is executed so as to obtain the target log file in the database.
Therefore, after the test case of the database check point is executed, the embodiment of the invention can call the monitoring plug-in of the database check point to acquire the target log file in the database. For example, for the database a, after the execution of the database check point test case is completed, the database check point monitoring plug-in is called to obtain the binlog log in the database a.
S103, analyzing and executing actual data written into fields in a database target database table after the database check point test case is completed from the target log file, and comparing the actual data with expected data of the database check point.
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 target database table of the database after the database check point test case is executed from the insert intro and update log information, and comparing the actual data with expected data of the database check point in the database check point test case.
For example, for a binlog log in database a, the specific log information in the binlog log is parsed: and obtaining actual data written into fields in a target database table of the database after the database check point test case is executed from the insert intro and update log information, as shown in the following table 2.
Name (I) Age (age) Study calendar Sex
Zhang three 25 This section For male
Li four 25 This section For male
TABLE 2
The actual data shown in table 2 above is compared with the expected data of the database check point included in the database check point test case shown in table 1 above, and the actual data is consistent with the expected data.
Through the above description of the technical scheme provided by the embodiment of the present invention, by obtaining and executing the database check point test case, after the execution of the database check point test case is completed, the database check point monitoring plug-in is invoked to obtain the target log file in the database, and the actual data written into the database table field of the database after the execution of the database check point test case is completed is analyzed from the target log file, and compared with the expected data of the database check point included in the database check point test case. Therefore, the comparison between the actual data and the expected data can be realized based on the log file in the database, SQL sentences do not need to be injected into the automatic test codes, the automatic test is not intrusive, the automatic test cannot be normally carried out, and the workload of test personnel is correspondingly reduced.
As shown in fig. 2, an implementation flow diagram of another method for testing a database checkpoint provided in an embodiment of the present invention specifically includes the following steps:
s201, obtaining a database check point test case and executing the database check point test case, wherein the database check point test case comprises expected data of a database check point;
in the embodiment of the present invention, this step is similar to the step S101, and the details of the embodiment of the present invention are not repeated herein.
S202, before executing the database check point test case, calling the database check point monitoring plug-in to acquire an initial log file in a database;
for the database check point test case, before the database check point test case is executed, the embodiment of the invention can call the database check point monitoring plug-in to obtain 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 check point test case, the embodiment of the present invention calls the database check point monitoring plug-in to obtain the 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
S203, after the execution of the database check point test case is finished, calling a database check point monitoring plug-in to acquire a target log file in a database;
in the embodiment of the present invention, this step is similar to the step S102, and the details of the embodiment of the present invention are not repeated herein.
S204, calling the database check point monitoring plug-in to calculate an incremental log file according to the initial log file and the target log file;
in 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 target database table of the database after the test case of the database check point 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; calling the database check point monitoring plug-in to determine the second file size of the target log file; calling the database check point monitoring plug-in to calculate the 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 check point monitoring plug-in to generate an incremental log file based on the log information.
For example, the database checkpoint monitoring plug-in is invoked to determine a first file size of the initial log file: 15KB, call database checkpoint monitoring plug-in to determine the second file size of the target log file: 20KB, calling the database checkpoint monitoring plug-in to calculate the difference between the first file size and the second file size: and 5KB, calling the database check point monitoring plug-in to acquire the log information from the tail of the target log file until the size of the log information is 5KB, and calling the database check point monitoring plug-in to generate an incremental log file based on the log information of the 5 KB.
S205, analyzing and executing the actual data written into the field in the database target database table after the test case of the database check point is completed from the incremental log file, and comparing the actual data with the expected data of the database check point.
In order to improve file parsing efficiency and testing efficiency, the embodiment of the invention can parse specific log information from an incremental log file: and obtaining actual data written into fields in a target database table of the database after the database check point test case is executed from the insert intro and update log information, and comparing the actual data with expected data of the database check point in the database check 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 check point test case is executed from the insert intro and update log information, wherein the actual data is compared with expected data of the database check point in the database check point test case shown in the table 1 as shown in the table 2, and the actual data is consistent with the expected data.
The embodiment of the invention analyzes the database check point test executive party identifier and the database table identifier from the incremental log file, matches the database check point test case according to the test executive party identifier and the database table identifier, and compares the database check point test case with expected data of the database check point included in the database check point test case.
For example, in the embodiment of the present invention, a corresponding relationship between the database check point test case, the database check point test executor identifier, and the database table identifier is pre-established, as shown in table 4 below.
Figure BDA0002546431710000101
TABLE 4
Analyzing the database check point test executive identification from the incremental log file: zhang three, and database table identification: the database table A is used for identifying according to the test executing party: zhang three, and database table identification: the database table A is matched with the database check point test case 1, actual data written into fields in a target database table (the database table A) of the database after the execution of the database check point test case is finished are compared with expected data of the database check point included in the database check point test case 1.
As shown in fig. 3, an implementation flow diagram of another method for testing a database checkpoint provided in an embodiment of the present invention specifically includes the following steps:
s301, acquiring a database check point test case and executing the database check point test case, wherein the database check point test case comprises expected data of a database check point;
in the embodiment of the present invention, this step is similar to the step S101, and the details of the embodiment of the present invention are not repeated herein.
S302, after the execution of the database check point test case is finished, calling a database check point monitoring plug-in to acquire a target log file in a database;
in the embodiment of the present invention, this step is similar to the step S102, and the details of the embodiment of the present invention are not repeated herein.
S303, recording the time for executing the database check point test case;
in the embodiment of the invention, in the process of executing the database check point test case, the time of executing the database check point test case can be recorded.
For example, when 12:00 starts executing the database check point test case, the embodiment of the present invention records the time when the database check point test case is executed: 12:00.
S304, extracting the time and the incremental log information after the time from the target log file;
for the target log file, the embodiment of the present invention extracts the time and the incremental log information after the time from the target log file, which means that after the execution of the database check point test case is completed, the database check point monitoring plug-in is called to obtain the target log file in the database, and the time and the incremental log information after the time are extracted from the target log file, so that the extraction of the information amount is reduced, and the analysis efficiency and the test efficiency can be effectively improved.
For example, after the execution of the database check point test case is completed, the database check point monitoring plug-in is called to obtain a target log file in the database, and the incremental log information at 12:00 and after 12:00 is extracted from the target log file.
S305, analyzing and executing the actual data written into the field in the database target database table after the database check point test case is completed from the incremental log information.
For the extracted incremental log information, the embodiment of the present invention parses specific log information from the incremental log information: and obtaining actual data written into fields in a target database table of the database after the database check point test case is executed from the insert intro and update log information, and comparing the actual data with expected data of the database check point in the database check 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 check point test case is executed from the insert intro and update log information, wherein the actual data is compared with expected data of the database check point in the database check point test case shown in the table 1 as shown in the table 2, and the actual data is consistent with the expected data.
As shown in fig. 4, an implementation flow diagram of another method for testing a database checkpoint provided in an embodiment of the present invention specifically includes the following steps:
s401, obtaining a database check point test case and executing the database check point test case, wherein the database check point test case comprises expected data of a database check point;
in the embodiment of the present invention, this step is similar to the step S101, and the details of the embodiment of the present invention are not repeated herein
S402, before executing the test case of the database check point, clearing the log information contained in the target log file in the database;
in the embodiment of the present invention, before executing the test case of the database check point, the log information included in the target log file in the database may be selected to be cleared, so that the log information included in the target log file in the database is empty, and after the test case of the database check point is executed, the log information included in the target log file in the database, that is, the incremental log information, may be directly obtained from the target log file in the database.
S403, after the execution of the database check point test case is finished, calling a database check point monitoring plug-in to acquire a target log file in a database;
in the embodiment of the present invention, this step is similar to the step S102, and the details of the embodiment of the present invention are not repeated herein.
S404, analyzing and executing actual data written into fields in a database target database table after the database check point test case is completely executed from the target log file, and comparing the actual data with expected data of the database check point;
in the embodiment of the present invention, this step is similar to the step S103, and the details of the embodiment of the present invention are not repeated herein.
S405, 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.
For the comparison result between 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 in 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 a database check point in an HTML (Hyper Text markup language) format, and may be a test report of a database check point in an Excel format, which is not limited in the embodiment of the present invention.
For the contents included in the test report of the database check point, the following may be mentioned: the number of the matched database check point test case, the reference of the database check point test case, the identifier of the test executive party, the identifier of the database table, the time for writing the actual data, the actual data and the analysis result (A, success; B, failure, specific failure field).
The test report of the database check point in the preset format can be displayed in an interface for a tester to check, and the test report of the database check point in the preset format can be stored.
Corresponding to the foregoing method embodiment, an embodiment of the present invention further provides a device for testing a database checkpoint, where as shown in fig. 5, the device may include: a use case execution module 510, a file acquisition module 520, and a data comparison module 530.
A case execution module 510, configured to obtain a database check point test case, and execute the database check point test case, where the database check point test case includes expected data of a database check point;
the file acquisition module 520 is configured to call the database check point monitoring plug-in to acquire a target log file in the database after the execution of the database check point test case is completed;
a data comparison module 530, configured to analyze, from the target log file, actual data written into a field in a target database table of the database after the test case of the database check point is executed, and compare the actual data with expected data of the database check point.
In a specific implementation of an embodiment of the present invention,
the file obtaining module 520 is further configured to call the database check point monitoring plug-in to obtain an initial log file in the database before executing the database check point test case;
the data comparing module 530 specifically includes:
the file calculation submodule 531 is configured to call the database check point monitoring plug-in to calculate an incremental log file according to the initial log file and the target log file;
and the data comparison submodule 532 is configured to analyze, from the incremental log file, actual data written into a field in a database target database table after the database check point test case is executed.
In a specific implementation manner of the embodiment of the present invention, the file calculating sub-module 531 is specifically configured to:
calling the database check point monitoring plug-in to determine the first file size of the initial log file;
calling the database check point monitoring plug-in to determine the second file size of the target log file;
calling the database check point monitoring plug-in to calculate the 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 check point monitoring plug-in to generate an incremental log file based on the log information.
In a specific implementation manner of the embodiment of the present invention, the data comparing module 530 is specifically configured to:
analyzing a database check point test executive party identifier and a database table identifier from the incremental log file;
matching the test execution party identifier and the database table identifier to the database check point test case;
and comparing the expected data of the database check point included in the database check point test case.
In a specific implementation manner of the embodiment of the present invention, the data comparing module 530 is specifically configured to:
recording the time of executing the database check point test case;
extracting the time and the incremental log information after the time from the target log file;
and analyzing and executing the actual data written into the field in the database target database table after the database check point test case is completed from the incremental log information.
In a specific implementation manner of the embodiment of the present invention, the apparatus further includes:
and an information clearing module 540, configured to clear log information included in the target log file in the database before executing the database checkpoint test case.
In a specific implementation manner of the embodiment of the present invention, the apparatus further includes:
a report generating module 550, configured to generate a test report of the database inspection point in a preset format based on a comparison result between the actual data and the expected data of the database inspection point.
An embodiment of the present invention further provides an electronic device, as shown in fig. 6, including a processor 61, a communication interface 62, a memory 63, and a communication bus 64, where the processor 61, the communication interface 62, and the memory 63 complete mutual communication through the communication bus 64,
a memory 63 for storing a computer program;
the processor 61 is configured to implement the following steps when executing the program stored in the memory 63:
acquiring a database check point test case and executing the database check point test case, wherein the database check point test case comprises expected data of a database check point; after the database check point test case is executed, calling a database check point monitoring plug-in to acquire a target log file in a database; and analyzing and executing the actual data written into the field in the database target database table after the database check point test case is completed from the target log file, and comparing the actual data with the expected data of the database check point.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a 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 processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In yet another embodiment of the present invention, a storage medium is further provided, where the storage medium stores instructions that, when executed on a computer, cause the computer to execute the method for testing a database check point according to any one of the above embodiments.
In a further embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method of testing a database check point as described in any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized 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, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a storage medium or transmitted from one storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more available media integrated servers, data centers, and the like. 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)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for testing a database check point, wherein the testing of the database check point and the automated testing are performed independently of each other, the method comprising:
acquiring a database check point test case and executing the database check point test case, wherein the database check point test case comprises expected data of a database check point;
after the database check point test case is executed, calling a database check point monitoring plug-in to acquire a target log file in a database;
and analyzing and executing the actual data written into the field in the database target database table after the database check point test case is completed from the target log file, and comparing the actual data with the expected data of the database check point.
2. The method of claim 1, further comprising:
before executing the database check point test case, calling the database check point monitoring plug-in to acquire an initial log file in a database;
the analyzing and executing actual data written into fields in a database target database table after the database check point test case is completely executed from the target log file comprises:
calling the database check point 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 field in the database target database table after the database check point test case is completed from the incremental log file.
3. The method of claim 2, wherein said invoking said database checkpoint monitoring plug-in to compute a delta log file from said initial log file and said target log file comprises:
calling the database check point monitoring plug-in to determine the first file size of the initial log file;
calling the database check point monitoring plug-in to determine the second file size of the target log file;
calling the database check point monitoring plug-in to calculate the 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 check point monitoring plug-in to generate an incremental log file based on the log information.
4. The method of claim 2, wherein said comparing with said database checkpoint expected data comprises:
analyzing a database check point test executive party identifier and a database table identifier from the incremental log file;
matching the test execution party identifier and the database table identifier to the database check point test case;
and comparing the expected data of the database check point included in the database check point test case.
5. The method of claim 1, wherein parsing the actual data written to a field in a database target database table after the database check point test case is executed from the target log file comprises:
recording the time of executing the database check point test case;
extracting the time and the incremental log information after the time from the target log file;
and analyzing and executing the actual data written into the field in the database target database table after the database check point test case is completed from the incremental log information.
6. The method of claim 1, wherein prior to executing the database checkpoint test case, the method further comprises:
and clearing the log information contained in the target log file in the database.
7. The method according to any one of claims 1 to 6, further comprising:
and generating a test report of the database check point in a preset format based on a comparison result of the actual data and the expected data of the database check point.
8. A testing apparatus for a database check point, wherein a test of the database check point and an automated test are performed independently of each other, the apparatus comprising:
the database inspection point test case execution module is used for acquiring a database inspection point test case and executing the database inspection point test case, wherein the database inspection point test case comprises expected data of a database inspection point;
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 execution of the database check point test case is finished;
and the data comparison module is used for analyzing and executing actual data written into fields in a database target database table after the test case of the database check point is completed from the target log file, and comparing the actual data with expected data of the database check point.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 7 when executing a program stored in the memory.
10. A storage medium on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN202010561840.0A 2020-06-18 2020-06-18 Database check point testing method and device, electronic equipment and storage medium Active CN111767213B (en)

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 true CN111767213A (en) 2020-10-13
CN111767213B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346898A (en) * 2020-10-28 2021-02-09 交控科技股份有限公司 Test method and system for rail transit system
CN116149969A (en) * 2023-04-04 2023-05-23 湖南中青能科技有限公司 Database model matching anomaly monitoring and processing method

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040139127A1 (en) * 2002-08-02 2004-07-15 Lech Pofelski 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
US20100011026A1 (en) * 2008-07-10 2010-01-14 International Business Machines Corporation Method and system for dynamically collecting data for checkpoint tuning and reduce recovery time
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

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040139127A1 (en) * 2002-08-02 2004-07-15 Lech Pofelski 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
US20100011026A1 (en) * 2008-07-10 2010-01-14 International Business Machines Corporation Method and system for dynamically collecting data for checkpoint tuning and reduce recovery time
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 (5)

* Cited by examiner, † Cited by third party
Title
MARCELA CASTRO: "Transparent Fault Tolerance Solution at Socket Level Based on RADIC", 《 2012 IEEE 10TH INTERNATIONAL SYMPOSIUM ON PARALLEL AND DISTRIBUTED PROCESSING WITH APPLICATIONS》, pages 1 - 5 *
PIERRE LEMARINIER: "Coordinated checkpoint versus message log for fault tolerant MPI", 《INTERNATIONAL JOURNAL OF HIGH PERFORMANCE COMPUTING AND NETWORKING》, pages 146 - 155 *
刘小厨: "Android_增量更新(BSDiff)", pages 1 - 5, Retrieved from the Internet <URL:《https://juejin.cn/post/6844904192776077325》> *
张浩阳: "内存数据库关键技术的研究与设计", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, pages 138 - 2195 *
晏燕: "嵌入式内存数据库引擎的研究与实现", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, pages 138 - 447 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112346898A (en) * 2020-10-28 2021-02-09 交控科技股份有限公司 Test method and system for rail transit system
CN116149969A (en) * 2023-04-04 2023-05-23 湖南中青能科技有限公司 Database model matching anomaly monitoring and processing method
CN116149969B (en) * 2023-04-04 2023-06-20 湖南中青能科技有限公司 Database model matching anomaly monitoring and processing method

Also Published As

Publication number Publication date
CN111767213B (en) 2024-04-05

Similar Documents

Publication Publication Date Title
CN109284269B (en) Abnormal log analysis method and device, storage medium and server
CN106656536B (en) Method and equipment for processing service calling information
CN110688307B (en) JavaScript code detection method, device, equipment and storage medium
CN108363634B (en) Method, device and equipment for identifying service processing failure reason
CN110389941B (en) Database checking method, device, equipment and storage medium
CN111767213A (en) Method and device for testing database check points, electronic equipment and storage medium
CN112540887A (en) Fault drilling method and device, electronic equipment and storage medium
CN105630656A (en) Log model based system robustness analysis method and apparatus
CN111413952B (en) Robot fault detection method and device, electronic equipment and readable storage medium
CN113392000A (en) Test case execution result analysis method, device, equipment and storage medium
CN116775488A (en) Abnormal data determination method, device, equipment, medium and product
CN112069052A (en) Abnormal object detection method, device, equipment and storage medium
CN113037521B (en) Method for identifying state of communication equipment, communication system and storage medium
CN113742213A (en) Method, system, and medium for data analysis
CN112363944A (en) Method and equipment for comparing return values of multiple environment interfaces
CN111736848A (en) Packet conflict positioning method and device, electronic equipment and readable storage medium
CN111953544B (en) Fault detection method, device, equipment and storage medium of server
CN113220594B (en) Automatic test method, device, equipment and storage medium
CN116680106A (en) Abnormality locating method, device, equipment and storage medium
CN113419738A (en) Interface document generation method and device and interface management equipment
CN117873860A (en) Data automatic testing method and device, electronic equipment and storage medium
CN117171030A (en) Method, device, equipment and storage medium for detecting software running environment
CN116302800A (en) Fault positioning method and device and electronic equipment
CN115774659A (en) Log generation method and device, electronic equipment and storage medium
CN117472958A (en) Verification method, device, equipment and medium for SQL statement execution result

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