CN110647463B - Method and device for restoring test breakpoint and electronic equipment - Google Patents

Method and device for restoring test breakpoint and electronic equipment Download PDF

Info

Publication number
CN110647463B
CN110647463B CN201910818516.XA CN201910818516A CN110647463B CN 110647463 B CN110647463 B CN 110647463B CN 201910818516 A CN201910818516 A CN 201910818516A CN 110647463 B CN110647463 B CN 110647463B
Authority
CN
China
Prior art keywords
data
test case
table structure
preset
database
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
Application number
CN201910818516.XA
Other languages
Chinese (zh)
Other versions
CN110647463A (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.)
Peoples Insurance Company of China
Original Assignee
Peoples Insurance Company of China
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 Peoples Insurance Company of China filed Critical Peoples Insurance Company of China
Priority to CN201910818516.XA priority Critical patent/CN110647463B/en
Publication of CN110647463A publication Critical patent/CN110647463A/en
Application granted granted Critical
Publication of CN110647463B publication Critical patent/CN110647463B/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

Abstract

The application discloses a method for recovering test breakpoints, which aims to solve the problems that when a database full-table backup mode is adopted in the existing automatic test technology, all data in a database are required to be prepared for each test case in the database full-table backup process, and the automatic test process generally relates to a large number of cases, so that a large number of resources can be consumed, the consumption of test efficiency resources is seriously influenced, and the test efficiency is low. The method comprises the following steps: judging whether the current test case has input data or not; if not, calling preset test data as input data of the current test case, wherein the preset test data is data which has a mapping relation with the current test case in a preset mapping relation. The application also discloses a device for recovering the test breakpoint, electronic equipment and a computer readable storage medium.

Description

Method and device for restoring test breakpoint and electronic equipment
Technical Field
The present application relates to the field of data processing, and in particular, to a method, an apparatus, and an electronic device for recovering a test breakpoint.
Background
In the existing automatic test flow, in order to implement end-to-end verification, test data/input data is usually provided only for a first node use case, and the test data/input data of subsequent node use cases are derived from output data of a preamble node use case. Therefore, if the first node use case or a certain preorder node use case fails to be executed, the subsequent test use cases may not normally run due to the absence of test data/input data, and the automated test process may be interrupted.
At present, in order to avoid the above problems, two methods of data recovery of an automated testing process, i.e., solidified data preparation and database full-table backup, are proposed in the related art. The method comprises the steps of solidifying data preparation, namely manually preparing test data/input data for each test case in advance, and when the test case fails to be executed, automatically calling the test data/input data manually prepared in advance to serve as input data of a subsequent test case. And performing full-table backup on the database, namely automatically backing up all data in the database for each test case in advance (all data comprise data relevant to the test case and data irrelevant to the test case), and when the test case fails to be executed, automatically switching to a data backup source to provide input data for a subsequent test case.
However, in practical application, different problems exist in both of the above two methods, and firstly, when a data curing preparation method is adopted, on one hand, the workload is large because data needs to be manually prepared for each use case in advance; on the other hand, the manually prepared data is usually a fixed value, so that the data combination is less, the test data with various test cases cannot be completely covered, and the method is only suitable for scenes with fewer test cases.
Secondly, when a database full-table backup mode is adopted, although workload can be reduced and various test data of test cases can be covered comprehensively, all data in the database need to be prepared for each test case in the database full-table backup process, and the automatic test process generally involves a large number of cases, so that a large number of resources can be consumed, and the test efficiency is seriously influenced.
Disclosure of Invention
The embodiment of the application provides a method for recovering a test breakpoint, which is used for solving the problems of high resource consumption and low test efficiency in the prior art.
The embodiment of the application also provides a device for recovering the test breakpoint, electronic equipment and a computer readable storage medium.
The embodiment of the application adopts the following technical scheme:
in a first aspect, an embodiment of the present application provides a method for restoring a test breakpoint, including: judging whether the current test case has input data or not; if not, calling preset test data as input data of the current test case, wherein the preset test data is data which has a mapping relation with the current test case in a preset mapping relation.
Optionally, before the calling the preset test data as the input data of the current test case, the method further includes: determining data having a mapping relation with the current test case according to the preset mapping relation; and backing up the data which has the mapping relation with the current test case to serve as the preset test data.
Optionally, before the calling the preset test data as the input data of the current test case, the method further includes:
judging whether a first table structure of a first database where a current test case is located is consistent with a second table structure of a second database where the preset test data is located;
if so, calling the preset test data as the input data of the current test case.
Optionally, after the determining whether the first table structure of the first database where the current test case is located and the second table structure of the second database where the preset test data is located are consistent, the method further includes:
and if the first table structure of the first database where the current test case is located is not consistent with the second table structure of the second database where the preset test data is located, stopping calling the preset test data.
Optionally, the determining whether the first table structure of the first database where the current test case is located and the second table structure of the second database where the preset test data is located are consistent includes:
respectively generating first identification information corresponding to the first table structure and second identification information corresponding to the second table structure, wherein the first identification at least comprises a password hash function of the first table structure, and the second identification information at least comprises a password hash function of the second table structure;
judging whether the first identification information is consistent with the second identification information;
and if so, determining that the first table structure of the first database where the current test case is located is consistent with the second table structure of the second database where the preset test data is located.
Optionally, after the determining whether the first identification information and the second identification information are consistent, the method further includes:
and if the first identification information is inconsistent with the second identification information, determining that a first table structure of a first database where the current test case is located is inconsistent with a second table structure of a second database where the preset test data is located.
Optionally, after determining that the table structure of the database in which the current test case is located and the table structure of the database in which the preset test data is located are not consistent, the method further includes:
identifying the current test case;
and when the current test case is successfully executed in the subsequent process, automatically backing up the output data corresponding to the current test case.
Optionally, after the determining whether the current test case has the input data, the method further includes:
if the input data exist in the current test case, acquiring preset test data with a mapping relation with the current test case according to the preset mapping relation, wherein the preset test data is data with the mapping relation with the current test case in the preset mapping relation;
judging whether the input data of the current test case is the preset test data or not;
if not, deleting the input data of the current test case, and calling the preset test data of the current test case.
In a second aspect, an embodiment of the present application provides an apparatus for recovering a test breakpoint, which includes a determining module and a calling module, where:
the judging module is used for judging whether input data exist in the current test case or not;
and if not, calling preset test data as input data of the current test case, wherein the preset test data is data which has a mapping relation with the current test case in a preset mapping relation.
Optionally, the apparatus provided in the present application further includes a backup module, configured to:
determining data having a mapping relation with the current test case according to the preset mapping relation;
and backing up the data which has the mapping relation with the current test case to be used as the preset test data.
Optionally, the apparatus provided in this application further includes a table structure determining module, configured to:
judging whether a first table structure of a first database where the current test case is located is consistent with a second table structure of a second database where the preset test data is located;
if so, calling the preset test data as the input data of the current test case;
if not, stopping calling the preset test data.
Judging whether a first table structure of a first database where the current test case is located and a second table structure of a second database where the preset test data is located are consistent or not, wherein the judging comprises the following steps:
respectively generating first identification information corresponding to the first table structure and second identification information corresponding to the second table structure, wherein the first identification at least comprises a password hash function of the first table structure, and the second identification information at least comprises a password hash function of the second table structure;
judging whether the first identification information is consistent with the second identification information;
if so, determining that a first table structure of a first database where the current test case is located is consistent with a second table structure of a second database where the preset test data is located;
if not, determining that the first table structure of the first database where the current test case is located is inconsistent with the second table structure of the second database where the preset test data is located.
Optionally, in this embodiment of the present application, the apparatus further includes an identification module and a backup module, and each module has the following functions:
the identification module is used for identifying the current test case;
and the backup module is used for automatically backing up the output data corresponding to the current test case when the current test case is successfully executed in the subsequent process.
Optionally, in an embodiment of the present application, the apparatus further includes an obtaining module, a preset data determining module, and a deleting module, where the functions of the modules are as follows:
the obtaining module is used for obtaining preset test data with a mapping relation with the current test case according to the preset mapping relation if the input data exists in the current test case, wherein the preset test data is data with the mapping relation with the current test case in the preset mapping relation;
the preset data judgment module is used for judging whether the data to be backed up of the current test case is preset test data or not;
and the deleting module is used for deleting the input data of the current test case and calling the preset test data of the current test case if the input data of the current test case is not deleted.
In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program when executed by the processor implementing the steps of the method of restoring a test breakpoint as described above.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when executed by a processor, the computer program implements the steps of the method for restoring a test breakpoint as described above.
According to the method provided by the embodiment of the application, in the automatic test process, if the current test case has no input data, the data with the mapping relation with the current test case can be automatically called according to the preset mapping relation to be used as the input data of the current test case so as to recover the breakpoint test, and all data in the database do not need to be processed, so that the test efficiency of the automatic test process is improved, and the consumption of storage resources is reduced.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart illustrating an implementation flow of a method for recovering a test breakpoint according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation of a method for recovering a test breakpoint according to an embodiment of the present application;
fig. 3 is a schematic flowchart illustrating an implementation flow of a method for recovering a test breakpoint according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of an apparatus for recovering a test breakpoint according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Example 1
The embodiment 1 of the application provides a method for recovering a test breakpoint. The execution main body of the method can be terminal equipment or a server, wherein the terminal equipment can be equipment such as a personal computer and the like, and also can be terminal equipment such as a mobile phone, a tablet personal computer and the like, and the server can be an independent server or a server cluster consisting of a plurality of servers.
Referring to fig. 1, a flowchart of a specific implementation of a method for recovering a test breakpoint according to an embodiment of the present application is provided, where the flowchart includes the following steps:
and 11, judging whether the current test case has input data or not.
The test case includes test input, execution conditions, and expected results, and is used to test whether a certain program path meets a specific requirement, for example, the test case may be, but is not limited to, a Structured Query Language (SQL) test statement, various data definition Language test statements, or a data manipulation Language test statement.
In the embodiment of the application, whether input data exists in the current test case can be directly judged, or whether input data exists in the current test case can be further judged by judging whether the previous test case adjacent to the current test case is successfully executed or whether output data exists, and specifically, if the previous test case adjacent to the current test case is successfully executed, the input data exists in the current test case is determined; and if the previous test case adjacent to the current test case fails to execute, determining that the current test case has no input data.
And step 12, if not, calling preset test data as input data of the current test case, wherein the preset test data is data which has a mapping relation with the current test case in a preset mapping relation.
The preset mapping relation is used for describing the corresponding relation between the preset test data and the test cases, so that different test cases can have different test data, and the test data corresponding to the test cases can be backed up in a targeted manner when the test data needs to be prepared for the test cases, thereby avoiding the simultaneous backup of all data in the database.
The preset mapping relationship may include a test case name, a test case number, and a feature identifier of preset test data.
The characteristic identification of the preset test data is used for uniquely identifying one type of test data; alternatively, the feature identifier may be a keyword string of the test data, or an item type field of the test data, for example, if the test data is full table data of a database, the feature identifier of the test data may also be a primary key of the database table or an index of the database table.
The test case name is used for uniquely identifying the test case, and the test case label can be used for describing the relative position of the test case in the test case cluster.
After step 11 is executed, if it is determined that the current test case does not have test data, in order to avoid a problem that the test case cannot normally run due to the test case does not have test data/input data, thereby causing an interruption of an automated test flow, in the embodiment per se, preset test data may be called as input data of the current test case.
It should be noted that, in order to avoid that all data in the database need to be processed simultaneously when the preset test data is called, in the embodiment of the present application, the test data corresponding to the test case may be called in a targeted manner according to the preset mapping relationship, so as to improve the test efficiency of the automated test process and reduce the consumption of storage resources.
In this embodiment of the present application, before calling the preset test data as the input data of the current test case, the method further includes: determining data having a mapping relation with the current test case according to a preset mapping relation; and backing up the data which has a mapping relation with the current test case to be used as preset test data.
Optionally, after determining data having a mapping relationship with the current test case according to the preset mapping relationship and backing up the data to obtain preset test data, for convenience of management, the preset test data may be stored in a data backup file, where the data backup file may be a file in an SQL script format.
It should be noted that, in the process of backing up the preset data, since there may be an association relationship between the preset test data, if a plurality of preset test data are backed up at the same time, data collision may be caused. In order to avoid the problem of data collision, in the embodiment of the present application, a processing sequence of preset test data may be added to the preset mapping relationship, and when data having a mapping relationship with the current test case needs to be backed up, the data may be backed up according to the processing sequence of the preset test data.
Alternatively, for example, the processing order of the preset test data may be determined by numbering, wherein the smaller the number value of the preset number is, the higher the priority is for processing, for example, the processing order of the preset test data numbered 1 is prior to the processing order of the preset test data numbered 3.
In addition, in the present application, since a method of deleting and then inserting is usually adopted when backing up the preset test data, in order to completely backup the preset test data having a mapping relationship with the test case and avoid deleting the preset test data having the mapping relationship by mistake, in the embodiment of the present application, when determining the processing sequence of the preset test data, it is further required to consider whether the preset test data has a main foreign key relationship or other constraint relationships.
For example, if the preset test data has a main foreign key relationship or other constraint relationship, the processing order of the preset test data during backup is prior to the processing order of the preset test data without the main foreign key relationship or other constraint relationship, and the related data having the main foreign key relationship or other constraint relationship with the preset test data also needs to be backed up.
Or, the processing order of the preset test data without the main foreign key relationship or other constraint relationships may be set to 0, and for the remaining preset test data with the main foreign key relationship or other constraint relationships, the backup order of the preset test data may be determined by a method in which the processing order of the main table is 1 and the processing order of the additional table is sequentially added by 1.
By adopting the method provided by the embodiment of the application, in the automatic test process, if the current test case has no input data, only the data with the mapping relation with the current test case can be called according to the preset mapping relation and used as the input data of the current test case to recover the breakpoint test, so that the problem that all data in a database need to be processed in the prior art is solved, the test efficiency of the automatic test process is improved, and the consumption of storage resources is reduced.
Example 2
As shown in fig. 2, in order to solve the problems of relatively high resource consumption and relatively low testing efficiency in the existing automated testing technology, an embodiment of the present application provides a method for recovering a test breakpoint, where an execution subject of the method may be a server or a server cluster formed by multiple servers, and the method may include the following steps:
step 201, judging whether the current test case has input data.
Step 201 is similar to the implementation manner of step 11 in embodiment 1, and the detailed description may refer to step 11, and for avoiding redundancy, detailed description is not repeated here.
And 203, if not, calling preset test data as input data of the current test case, wherein the preset test data is data which has a mapping relation with the current test case in the preset mapping relation.
In the embodiment of the present application, the specific implementation manner of step 203 may refer to step 12 of embodiment 1, and details are not described here.
In order to avoid that the structure of the database where the preset test data is stored or the database where the test case is located is changed, which results in the failure of calling the data in step 203, in this embodiment of the present application, before calling the preset test data as the input data of the current test case, the following step 202 is further included:
step 202, judging whether a first table structure of a first database where a current test case is located is consistent with a second table structure of a second database where preset test data is located;
specifically, if the first table structure of the first database where the current test case is located is consistent with the second table structure of the second database where the preset test data is located, step 203 is executed. Alternatively, the first and second electrodes may be,
and if the first table structure of the first database where the current test case is located is not consistent with the second table structure of the second database where the preset test data is located, stopping calling the preset test data.
Optionally, if the first table structure of the first database where the current test case is located and the second table structure of the second database where the preset test data is located are not consistent, an alarm message may be sent to prompt that the preset test data calling operation fails.
In the embodiment of the application, the form of sending the alarm information is not limited, and for example, the alarm information may be an infrared alarm or a sound prompt alarm lamp.
Because the identification information of the table structures of the databases in which different test cases are located are different, and the table structures of the databases in which the test cases are located and the table structures of the databases in which the preset test data having the mapping relationship are located are the same, in step 202, when determining whether the first table structure of the first database in which the current test case is located and the second table structure of the second database in which the preset test data is located are consistent, the following method may be adopted:
respectively generating first identification information corresponding to a first table structure and second identification information corresponding to a second table structure, wherein the first identification at least comprises a password hash function of the first table structure, and the second identification information at least comprises a password hash function of the second table structure;
in this embodiment of the present application, for example, the corresponding first identification information may be generated according to a field order, a field type, and a field length of the first table structure. Similarly, the second identification information may be generated according to the field sequence, the field type, and the field length of the second table structure.
Judging whether the first identification information is consistent with the second identification information;
in this embodiment of the application, for example, whether the value of the password hash function MD5 in the first identification information is consistent with the value of the password hash function MD5 in the second identification information may be determined.
And if the first identification information is consistent with the second identification information, determining that the first table structure of the first database where the current test case is located is consistent with the second table structure of the second database where the preset test data is located.
If the first table structure of the first database where the current test case is located is determined to be consistent with the second table structure of the second database where the preset test data is located, the preset test data can be called as input data of the current test case to recover the automatic test process.
By adopting the method provided by the embodiment of the application, in the automatic test process, if the current test case has no input data, only the data with the mapping relation with the current test case can be called according to the preset mapping relation and used as the input data of the current test case to recover the breakpoint test, so that the problem that all data in a database need to be processed in the prior art is solved, the test efficiency of the automatic test process is improved, and the consumption of storage resources is reduced.
In addition, by adopting the method provided by the embodiment of the application, before the preset test data is called as the input data of the current test case, whether the first table structure of the first database where the current test case is located and the second table structure of the second database where the preset test data is located are consistent or not can be judged in advance, and the preset test data is called under the condition that the table structures are consistent, so that the success rate of calling operation of the preset test data can be ensured.
Or, if it is determined that the first table structure of the first database where the current test case is located and the second table structure of the second database where the preset test data is located are not consistent, the method for recovering the test breakpoint further includes: identifying the current test case; and when the current test case is successfully executed in the subsequent process, automatically backing up the output data corresponding to the current test case.
By adopting the method provided by the embodiment of the application, even if the first database structure and/or the second database structure are/is changed, the preset test data can be automatically backed up again when the next test case is successfully executed, so that the preset test data can be called without manual intervention.
Example 3
As shown in fig. 3, an embodiment of the present application provides a method for recovering a test breakpoint, where an execution subject of the method may be a server or a server cluster composed of multiple servers, and the method is used to solve the problems of high resource consumption and low test efficiency in the existing automation test technology, and may include the following steps:
step 301, judging whether the current test case has input data.
Step 302, if it is determined that the current test case has input data, acquiring preset test data of the current test case according to a preset mapping relationship, where the preset test data is data in the preset mapping relationship and has a mapping relationship with the current test case.
Bak, the other names are the same as the names of the files storing the preset test data, so if the backup file is mistaken for the preset test data, an exception may occur during calling, which results in failure of the automatic test.
In order to avoid the above problem, in the embodiment of the present application, after determining that the input data exists in the current test case, the following step 303 is further performed to further determine whether the input data of the current test case is the preset test data, and if not, the input data of the current test case is deleted, so as to prevent the automated test from failing.
Step 303, judging whether the data to be backed up of the current test case is preset test data.
And 304, if not, deleting the input data of the current test case, and calling the preset test data of the current test case.
By adopting the method provided by the embodiment of the application, on one hand, the automatic test failure caused by abnormity when the preset test data is called can be avoided; on the other hand, by changing the input data of the current test case, after the automatic flow test is executed, a set of new preset test data can be generated quickly, data backup is realized, the workload is low, and the data is reliable.
Example 4
Based on the same idea, the method for restoring a test breakpoint provided in the embodiment of the present application further provides a device for restoring a test breakpoint, as shown in fig. 4.
The device for restoring the test breakpoint comprises: a judging module 401 and a calling module 402, wherein:
the determining module 401 is configured to determine whether there is input data in the current test case. The calling module 402 is configured to, when there is no input data in the current test case, call preset test data as the input data of the current test case, where the preset test data is data in a preset mapping relationship and has a mapping relationship with the current test case. The calling module 402 is configured to determine, according to a preset mapping relationship, data having a mapping relationship with a current test case, and backup the data having the mapping relationship with the current test case as preset test data.
Optionally, in an embodiment of the present application, the apparatus further includes:
the table structure judging module is used for judging whether a first table structure of a first database where the current test case is located is consistent with a second table structure of a second database where the preset test data is located;
if so, calling the preset test data as the input data of the current test case.
Or if the first table structure of the first database where the current test case is located is not consistent with the second table structure of the second database where the preset test data is located, stopping calling the preset test data.
Optionally, the table structure judging module includes a generating unit, a judging unit, and a determining unit. Wherein, each unit function is as follows:
a generating unit, configured to generate first identification information corresponding to the first table structure and second identification information corresponding to the second table structure, respectively, where the first identification at least includes a cryptographic hash function of the first table structure, and the second identification information at least includes a cryptographic hash function of the second table structure;
a judging unit configured to judge whether the first identification information and the second identification information are consistent;
and if so, determining that the first table structure of the first database where the current test case is located is consistent with the second table structure of the second database where the preset test data is located. Alternatively, the first and second electrodes may be,
and if the first identification information is inconsistent with the second identification information, determining that a first table structure of a first database where the current test case is located is inconsistent with a second table structure of a second database where the preset test data is located.
In an embodiment of the present application, the apparatus further includes:
the identification module is used for identifying the current test case;
and the backup module is used for automatically backing up the output data corresponding to the current test case when the current test case is successfully executed in the subsequent process.
In an embodiment of the present application, the apparatus further includes:
the obtaining module is used for obtaining preset test data of the current test case according to a preset mapping relation if the input data of the current test case is judged to exist, wherein the preset test data is data which has a mapping relation with the current test case in the preset mapping relation;
the preset data judgment module is used for judging whether the data to be backed up of the current test case is preset test data or not;
and the deleting module is used for deleting the input data of the current test case and backing up the output data after the current test case is successfully executed if the test case is not successfully executed.
The device for recovering the test breakpoint provided in the embodiment of the present application can implement each process implemented by the terminal device in the method embodiments of fig. 1 to fig. 4, and is not described here again in order to avoid repetition.
By adopting the device provided by the embodiment of the application, in the automatic test process, if the current test case has no input data, only the data with the mapping relation with the current test case can be called according to the preset mapping relation and used as the input data of the current test case to recover the breakpoint test, so that the problem that all data in a database need to be processed in the prior art is solved, the test efficiency of the automatic test process is improved, and the consumption of storage resources is reduced.
Example 5
Figure 5 is a schematic diagram of a hardware structure of a mobile terminal implementing various embodiments of the present application,
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application. On the hardware level, the electronic device comprises a processor and optionally an internal bus, a network interface and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the data synchronization device on the logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
judging whether the current test case has input data or not;
if not, calling preset test data as input data of the current test case, wherein the preset test data is data which has a mapping relation with the current test case in a preset mapping relation.
Optionally, before the invoking the preset test data as the input data of the current test case, the method further includes:
determining data having a mapping relation with the current test case according to the preset mapping relation;
and backing up the data which has the mapping relation with the current test case to serve as the preset test data.
Optionally, before the calling the preset test data as the input data of the current test case, the method further includes:
judging whether a first table structure of a first database where a current test case is located is consistent with a second table structure of a second database where the preset test data is located;
if so, calling the preset test data as the input data of the current test case.
Optionally, after the determining whether the first table structure of the first database where the current test case is located and the second table structure of the second database where the preset test data is located are consistent, the method further includes:
and if the first table structure of the first database where the current test case is located is not consistent with the second table structure of the second database where the preset test data is located, stopping calling the preset test data.
Optionally, the determining whether the first table structure of the first database where the current test case is located and the second table structure of the second database where the preset test data is located are consistent includes:
respectively generating first identification information corresponding to the first table structure and second identification information corresponding to the second table structure, wherein the first identification at least comprises a password hash function of the first table structure, and the second identification information at least comprises a password hash function of the second table structure;
judging whether the first identification information is consistent with the second identification information;
and if so, determining that the first table structure of the first database where the current test case is located is consistent with the second table structure of the second database where the preset test data is located.
Optionally, after the determining whether the first identification information and the second identification information are consistent, the method further includes:
and if the first identification information is inconsistent with the second identification information, determining that a first table structure of a first database where the current test case is located is inconsistent with a second table structure of a second database where the preset test data is located.
Optionally, after determining that the table structure of the database in which the current test case is located and the table structure of the database in which the preset test data is located are not consistent, the method further includes:
identifying the current test case;
and when the current test case is successfully executed in the subsequent process, automatically backing up the output data corresponding to the current test case.
Optionally, after the determining whether the current test case has the input data, the method further includes:
if the input data of the current test case exists, acquiring preset test data of the current test case according to a preset mapping relation, wherein the preset test data is data which has a mapping relation with the current test case in the preset mapping relation;
judging whether the input data of the current test case is the preset test data or not;
if not, deleting the input data of the current test case, and calling the preset test data of the current test case.
The method for restoring a test breakpoint disclosed in the embodiment of fig. 5 of the present application may be applied to a processor, or may be implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software modules may be located in ram, flash, rom, prom, or eprom, registers, etc. as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
Of course, besides the software implementation, the electronic device of the present application does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
Example 6
The embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above method for recovering a test breakpoint, and can achieve the same technical effect, and in order to avoid repetition, details are not repeated here. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
The embodiment of the application provides a computer-readable storage medium, which is used for judging whether input data exist in a current test case or not; if not, calling preset test data as input data of the current test case, wherein the preset test data is data in a preset mapping relation and has a mapping relation with the current test case, and only backing up the data having the mapping relation with the current test case according to the preset mapping relation when the test data is prepared in advance, so that the problem that all data in a database need to be backed up in the prior art is solved, the test efficiency of the automatic test process is improved, and the consumption of storage resources is reduced.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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 phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises that element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art to which the present application pertains. Any modification, equivalent replacement, improvement or the like made within the spirit and principle of the present application shall be included in the scope of the claims of the present application.

Claims (8)

1. A method for restoring a test breakpoint, comprising:
judging whether input data exist in the current test case or not;
if not, calling preset test data as input data of the current test case, wherein the preset test data is data which has a mapping relation with the current test case in a preset mapping relation;
before the calling the preset test data as the input data of the current test case, the method further comprises the following steps:
judging whether a first table structure of a first database where the current test case is located is consistent with a second table structure of a second database where the preset test data is located;
if so, calling the preset test data as the input data of the current test case;
if the first table structure of the first database where the current test case is located is not consistent with the second table structure of the second database where the preset test data is located, stopping calling the preset test data, and sending alarm information to prompt that calling operation of the preset test data fails;
wherein the determining whether the first table structure of the first database where the current test case is located and the second table structure of the second database where the preset test data is located are consistent includes:
respectively generating first identification information corresponding to the first table structure and second identification information corresponding to the second table structure, wherein the first identification at least comprises a password hash function of the first table structure, and the second identification information at least comprises a password hash function of the second table structure;
judging whether the first identification information is consistent with the second identification information;
if so, determining that a first table structure of a first database where the current test case is located is consistent with a second table structure of a second database where the preset test data is located;
after the determining whether the first identification information is consistent with the second identification information, the method further includes:
and if the first identification information is inconsistent with the second identification information, determining that a first table structure of a first database where the current test case is located is inconsistent with a second table structure of a second database where the preset test data is located.
2. The method of claim 1, prior to said invoking preset test data as input data for a current test case, further comprising:
determining data having a mapping relation with the current test case according to the preset mapping relation;
and backing up the data which has the mapping relation with the current test case to be used as the preset test data.
3. The method as claimed in claim 1, wherein after said determining whether the first table structure of the first database where the current test case is located and the second table structure of the second database where the preset test data is located are consistent, further comprising:
and if the first table structure of the first database where the current test case is located is not consistent with the second table structure of the second database where the preset test data is located, stopping calling the preset test data.
4. The method of claim 3, wherein after the first table structure of the first database in which the current test case is located and the second table structure of the second database in which the predetermined test data is located are inconsistent, the method further comprises:
identifying the current test case;
and when the current test case is successfully executed in the subsequent process, automatically backing up the output data corresponding to the current test case.
5. The method of claim 1, after said determining whether input data exists for the current test case, further comprising:
if the input data of the current test case is judged to exist, acquiring the preset test data which has a mapping relation with the current test case according to the preset mapping relation;
judging whether the input data of the current test case is the preset test data or not;
if not, deleting the input data of the current test case, and calling the preset test data of the current test case.
6. An apparatus for restoring a test breakpoint, comprising:
the judging module is used for judging whether input data exist in the current test case or not;
the test system comprises a calling module, a judging module and a judging module, wherein the calling module is used for calling preset test data as input data of a current test case when the current test case has no input data, and the preset test data is data which has a mapping relation with the current test case in a preset mapping relation;
the device for recovering the test breakpoint further comprises:
the table structure judging module is used for judging whether a first table structure of a first database where the current test case is located and a second table structure of a second database where the preset test data is located are consistent or not before the preset test data is called as input data of the current test case;
the first calling module is used for calling the preset test data as the input data of the current test case if a first table structure of a first database where the current test case is located is consistent with a second table structure of a second database where the preset test data is located;
the second calling module is used for stopping calling the preset test data and sending alarm information to prompt that the calling operation of the preset test data fails if the first table structure of the first database where the current test case is located is inconsistent with the second table structure of the second database where the preset test data is located;
wherein, the table structure judging module is used for:
respectively generating first identification information corresponding to the first table structure and second identification information corresponding to the second table structure, wherein the first identification at least comprises a password hash function of the first table structure, and the second identification information at least comprises a password hash function of the second table structure;
judging whether the first identification information is consistent with the second identification information;
if so, determining that a first table structure of a first database where the current test case is located is consistent with a second table structure of a second database where the preset test data is located;
after the determining whether the first identification information is consistent with the second identification information, further configured to:
and if the first identification information is inconsistent with the second identification information, determining that a first table structure of a first database where the current test case is located is inconsistent with a second table structure of a second database where the preset test data is located.
7. An electronic device, comprising: memory, processor and computer program stored on said memory and executable on said processor, said computer program when executed by said processor implementing the steps of the method of restoring a test breakpoint according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the method of restoring a test breakpoint of any one of claims 1 to 5.
CN201910818516.XA 2019-08-30 2019-08-30 Method and device for restoring test breakpoint and electronic equipment Active CN110647463B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910818516.XA CN110647463B (en) 2019-08-30 2019-08-30 Method and device for restoring test breakpoint and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910818516.XA CN110647463B (en) 2019-08-30 2019-08-30 Method and device for restoring test breakpoint and electronic equipment

Publications (2)

Publication Number Publication Date
CN110647463A CN110647463A (en) 2020-01-03
CN110647463B true CN110647463B (en) 2022-10-18

Family

ID=68991387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910818516.XA Active CN110647463B (en) 2019-08-30 2019-08-30 Method and device for restoring test breakpoint and electronic equipment

Country Status (1)

Country Link
CN (1) CN110647463B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113608089B (en) * 2021-06-18 2023-11-03 苏州浪潮智能科技有限公司 SOA test method, system and device for switching power supply MOS tube and readable storage medium
CN116822424B (en) * 2023-07-11 2023-12-22 北京云枢创新软件技术有限公司 Source file modifying and positioning system and readable storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107948942A (en) * 2017-11-23 2018-04-20 北京百悟科技有限公司 A kind of short message service automated testing method and device
CN109726136A (en) * 2019-01-28 2019-05-07 上海达梦数据库有限公司 Test method, device, equipment and the storage medium of database

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9734214B2 (en) * 2012-06-28 2017-08-15 Entit Software Llc Metadata-based test data generation

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107948942A (en) * 2017-11-23 2018-04-20 北京百悟科技有限公司 A kind of short message service automated testing method and device
CN109726136A (en) * 2019-01-28 2019-05-07 上海达梦数据库有限公司 Test method, device, equipment and the storage medium of database

Also Published As

Publication number Publication date
CN110647463A (en) 2020-01-03

Similar Documents

Publication Publication Date Title
CN109669709B (en) Data migration method and data migration system for block chain upgrading
CN110650036A (en) Alarm processing method and device and electronic equipment
CN109271359B (en) Log information processing method and device, electronic equipment and readable storage medium
CN107066519B (en) Task detection method and device
CN110515795B (en) Big data component monitoring method and device and electronic equipment
CN106897342B (en) Data verification method and equipment
CN111708655A (en) Application crash processing method, device and system
CN110647463B (en) Method and device for restoring test breakpoint and electronic equipment
CN113448862B (en) Software version testing method and device and computer equipment
CN112581018A (en) Process task management method, system, device and storage medium
CN112181830B (en) Memory leak detection method, device, terminal and medium
CN111444208B (en) Data updating method and related equipment
CN114500249B (en) Root cause positioning method and device
CN112988776B (en) Method, device and equipment for updating text parsing rule and readable storage medium
CN105975567B (en) Method and device for processing internal file of application program
CN110688430B (en) Method and device for obtaining data bypass and electronic equipment
CN115617568A (en) Database recovery method, device and system, electronic equipment and storage medium
CN110442467B (en) Data sharing method, terminal and computer readable storage medium
WO2020177495A1 (en) Database connection management method and apparatus, and device
US10102052B2 (en) Dumping resources
CN115221030A (en) Application testing method and device, electronic equipment and storage medium
CN113535470A (en) Configuration backup method and device, electronic equipment and storage medium
CN112416725A (en) Pressure testing method and device
CN114675995A (en) Data backup method and device and electronic equipment
CN112579858A (en) Data crawling method and device

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