CN111782452A - Method, system, device and medium for interface contrast test - Google Patents

Method, system, device and medium for interface contrast test Download PDF

Info

Publication number
CN111782452A
CN111782452A CN202010636076.9A CN202010636076A CN111782452A CN 111782452 A CN111782452 A CN 111782452A CN 202010636076 A CN202010636076 A CN 202010636076A CN 111782452 A CN111782452 A CN 111782452A
Authority
CN
China
Prior art keywords
response message
target interface
interface
request
message
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.)
Pending
Application number
CN202010636076.9A
Other languages
Chinese (zh)
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.)
Ctrip Travel Information Service Shanghai Co Ltd
Original Assignee
Ctrip Travel Information Service Shanghai 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 Ctrip Travel Information Service Shanghai Co Ltd filed Critical Ctrip Travel Information Service Shanghai Co Ltd
Priority to CN202010636076.9A priority Critical patent/CN111782452A/en
Publication of CN111782452A publication Critical patent/CN111782452A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2268Logging of test results
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2289Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing by configuration test

Abstract

The invention discloses a method, a system, equipment and a medium for interface comparison test, which are used for obtaining a request message of a target interface and a request address of the target interface by configuring the target interface; writing the request message of the target interface and the request address of the target interface into a queue table; based on the queue table, requesting a target interface and calling a current response message and a historical response message corresponding to the target interface; the current corresponding message is a response message after the iteration of the target interface, and the historical response message is a response message before the iteration of the target interface; and comparing the current response message with the historical response message to obtain a comparison result and outputting the comparison result. The invention can automatically carry out comparison test on the interface, quickly construct a large batch of request messages to carry out the comparison test on the interface response messages, can quickly find the difference between the current iteration and the previous version, improves the working efficiency, solves the problem of insufficient scenes in the regression test, and increases the covered test scenes.

Description

Method, system, device and medium for interface contrast test
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method, a system, a device, and a medium for interface comparison testing.
Background
In order to meet increasingly complex and diversified business requirements, besides conventional iteration every week, a large number of projects and emergency release requirements need to be on-line, so that the testing work is heavier and heavier, and the product quality is difficult to ensure by means of simple manual testing.
At present, in the testing pyramid model, the interface testing investment is less, the yield is high, and how to efficiently test the interface is a question to be discussed. In the interface iteration process, except for verifying the change point of the current requirement, the regression change is needed to have no influence on other function points, and the previous function cannot be influenced by the adjustment. The workload of the artificial regression interface is huge, the covered test scenes are limited, the main flow is usually only simply taken, most scenes cannot be covered, and the quality is difficult to ensure.
Disclosure of Invention
The invention provides a method, a system, equipment and a medium for interface comparison test, aiming at overcoming the defects of low working efficiency and limited covered test scenes of an artificial regression interface in the prior art.
The invention solves the technical problems through the following technical scheme:
the invention provides a method for interface comparison test, which comprises the following steps:
configuring a target interface, and acquiring a request message of the target interface and a request address of the target interface;
writing the request message of the target interface and the request address of the target interface into a queue table;
based on the queue table, requesting a target interface and calling a current response message and a historical response message corresponding to the target interface; wherein, the current corresponding message is a response message after the target interface iteration, and the historical response message is a response message before the target interface iteration;
and comparing the current response message with the historical response message to obtain a comparison result and outputting the comparison result.
Preferably, the step of obtaining the request packet of the target interface includes:
acquiring data of the target interface from a database;
writing the data of the target interface into a memory as a global variable;
and replacing fields in the template of the request message with values from the global variables to obtain the request message.
Preferably, the step of writing the request message of the target interface into the queue table includes:
modifying field nodes of the request message of the target interface and data of the nodes of the request message;
and writing the modified request message into a queue list.
Preferably, after the step of writing the request packet of the target interface and the request address of the target interface into the queue table, the method further includes:
and modifying the data of the node of the request message of the target interface.
Preferably, the step of comparing the current response packet with the historical response packet to obtain a comparison result and outputting the comparison result includes the following steps:
judging whether the nodes of the current response message and the historical response message are the same and only one node is the same, if so, automatically matching and mapping the same node to output a comparison result of the current response message and the historical response message; if not, outputting a manual matching mapping signal to prompt manual matching mapping.
Preferably, the interface contrast test method further includes:
writing the comparison result into a database;
acquiring data of the comparison result from the database;
based on the data of the comparison result, counting inconsistent nodes, missing nodes and neglected nodes of the current response message and the historical response message;
and outputting inconsistent nodes, missing nodes and neglected nodes of the current response message and the historical response message.
The invention also provides a system for interface comparison test, which comprises:
the first acquisition module is used for configuring a target interface and acquiring a request message of the target interface and a request address of the target interface;
the first writing module is used for writing the request message of the target interface and the request address of the target interface into a queue table;
the calling module is used for requesting a target interface and calling a current response message and a historical response message corresponding to the target interface based on the queue list; wherein, the current corresponding message is a response message after the target interface iteration, and the historical response message is a response message before the target interface iteration;
and the comparison module is used for comparing the current response message with the historical response message to obtain a comparison result and outputting the comparison result.
Preferably, the first obtaining module includes:
the acquisition unit is used for acquiring the data of the target interface from a database;
the first writing unit is used for writing the data of the target interface into a memory as a global variable;
and the replacing unit is used for replacing fields in the template of the request message by values from the global variables to obtain the request message.
Preferably, the first writing module includes:
the modification unit is used for modifying the field node of the request message of the target interface and the data of the node of the request message;
and the second writing unit is used for writing the modified request message into the queue list.
Preferably, the interface contrast test system further includes:
and the modification module is used for modifying the data of the node of the request message of the target interface.
Preferably, the comparison module is further configured to determine whether the nodes of the current response packet and the historical response packet are the same and only one of the same node is present, and if yes, perform automatic matching mapping on the same node to output a comparison result of the current response packet and the historical response packet; if not, outputting a manual matching mapping signal to prompt manual matching mapping.
Preferably, the interface contrast test system further includes:
the second writing module is used for writing the comparison result into a database;
the second acquisition module is used for acquiring the data of the comparison result from the database;
the statistic module is used for counting inconsistent nodes, missing nodes and neglected nodes of the current response message and the historical response message based on the data of the comparison result;
and the output module is used for outputting the inconsistent nodes, the missing nodes and the neglected nodes of the current response message and the historical response message.
The invention also provides an electronic device, which comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the computer program to realize the interface comparison test method.
The invention also provides a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of interface contrast testing described above.
The positive progress effects of the invention are as follows:
the invention can automatically carry out comparison test on the interface, quickly construct a large batch of request messages to carry out the comparison test on the interface response messages, can quickly find the difference between the current iteration and the previous version, improves the working efficiency, solves the problem of insufficient scenes in the regression test, and increases the covered test scenes.
Drawings
FIG. 1 is a flowchart of a method of comparative interface testing according to example 1 of the present invention;
FIG. 2 is a flowchart of step S101 in embodiment 1 of the present invention;
FIG. 3 is a flowchart of step S102 in embodiment 1 of the present invention;
FIG. 4 is a flowchart of step S105 in embodiment 1 of the present invention;
FIG. 5 is a block diagram of a system for interface contrast test according to embodiment 2 of the present invention;
fig. 6 is a block diagram of a first obtaining module according to embodiment 2 of the present invention;
FIG. 7 is a block diagram of a first write module according to embodiment 2 of the present invention;
fig. 8 is a schematic structural diagram of an electronic device according to embodiment 3 of the present invention.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
Example 1
As shown in fig. 1, the present embodiment discloses a method for interface comparison test, which includes the following steps:
step S101, configuring a target interface, and acquiring a request message of the target interface and a request address of the target interface;
in this embodiment, the request packet of the target interface is obtained in two forms, one is obtained by sql parameters, and the other is obtained by pulling the request packet in the log, specifically, the request packet in the specified time range is pulled according to the log title/tag, the packet is continuously pulled in the valid period, the log is obtained, and then the splicing and intercepting are performed, and the complete and effective request packet is compressed and then dropped. In order to improve the system efficiency, the time range which is already pulled is written into the cache, and the time range which is overlapped is not pulled again. The user selects the two message acquisition modes when newly adding configuration. In this embodiment, a comparison task is triggered before the request packet of the target interface and the request address of the target interface are obtained.
Step S102, writing the request message of the target interface and the request address of the target interface into a queue table;
step S103, modifying the data of the node of the request message of the target interface.
In this embodiment, when a user adds a new configuration, a pre-processing configuration before a request is added, a global variable is fetched and written in a request message through jsonnpath (a tool for retrieving a data exchange format Path) and xpath (XML Path Language), a value is taken from the global variable to perform sql (Structured Query Language) splicing, and the pre-processing sql is executed before a request interface, so that data of a node of the request message of the target interface is modified. Pre-request preprocessing is to modify data of a node of the request packet of the target interface, for example, in an interface test process, test data (such as order data) may need to be modified before reaching a processing condition.
Step S104, based on the queue table, requesting a target interface and calling a current response message and a historical response message corresponding to the target interface; wherein, the current corresponding message is a response message after the target interface iteration, and the historical response message is a response message before the target interface iteration;
in this embodiment, in order to increase the interface contrast speed, an execution machine and a multi-stroke request interface are allocated according to the task ID (Identity document).
And S105, comparing the current response message with the historical response message to obtain a comparison result and outputting the comparison result.
Step S106, writing the comparison result into a database;
in this embodiment, the comparison result is written into an ES (elastic search), which is a Lucene (a search engine) based search server. It provides a distributed multi-user-capable full-text search engine based on restful web (a design of data interface) interface.
Step S107, acquiring data of the comparison result from the database;
step S108, based on the data of the comparison result, counting inconsistent nodes, missing nodes and neglected nodes of the current response message and the historical response message;
and step S109, outputting inconsistent nodes, missing nodes and neglected nodes of the current response message and the historical response message.
As shown in fig. 2, in this embodiment, the step of obtaining the request packet of the target interface in step S101 includes:
step S1011, acquiring the data of the target interface from a database;
step S1012, writing the data of the target interface into a memory as a global variable;
and S1013, replacing fields in the template of the request message with values from the global variables to obtain the request message.
As shown in fig. 3, in this embodiment, the writing the request packet of the target interface into the queue table in step S102 includes the following steps:
step S1021, modifying field nodes of the request message of the target interface and data of the nodes of the request message;
and step S1022, writing the modified request message into the queue list.
In this embodiment, when a user adds a new configuration, a custom processing request configuration is added to implement an extension function, and the user may perform secondary modification on a request packet before an interface is called, for example, the request packet depends on data of other interfaces, or the request packet is not a legal json character string under the condition of being pulled from a log, and needs secondary cleaning, and the like, so as to implement modification on field nodes of the request packet of the target interface and data of nodes of the request packet. And then realizing java interface, binding the implementation class and the comparison configuration, and taking out the instance object of the current configuration for logic processing when executing. The system is expanded based on the low coupling mode to meet different requirements.
As shown in fig. 4, in the present embodiment, step S105 includes the following steps:
step S1051, judging whether the nodes of the current response message and the historical response message are the same and only one node is provided; if yes, go to step S1052; if not, executing step S1053;
step S1052, automatically matching and mapping the same node to output a comparison result of the current response message and the historical response message;
and step S1053, outputting a manual matching mapping signal to prompt manual matching mapping.
In this embodiment, by obtaining a contract of an interface, nodes with the same path and the same name are automatically matched, a mapping relationship of a json path is stored, and values of two versions of a current response packet and a historical response packet are taken out for comparison according to the mapping relationship during subsequent comparison.
The database table designed in this embodiment includes: interface _ monitor _ config database table, interface _ monitor _ batch database table, and interface _ monitor _ result database table. The interface _ monitor _ config is used for storing the configuration of two acquisition request messages in the flow chart. And if the mode is the sql parameter transmission mode, storing the sql, the request message template and the like. If the request message is acquired from the log system, the configuration of pulling the log is mainly stored. And the interface _ monitor _ batch triggers a task writing table each time and is used for recording report receivers of the current batch, compared statistical results and the like. interface _ monitor _ result mainly stores A, B two versions of request url (uniform resource locator ) of each comparison task, a request message, and a response message after comparison is completed.
The following specifically shows the interface _ monitor _ config database table (as shown in table one below), the interface _ monitor _ batch database table (as shown in table two below), and the interface _ monitor _ result database table (as shown in table three below). The following three database tables are merely an example and are not limited thereto.
Watch 1
Figure BDA0002568017770000081
Figure BDA0002568017770000091
Watch two
Figure BDA0002568017770000101
Figure BDA0002568017770000111
Watch III
Figure BDA0002568017770000112
Figure BDA0002568017770000121
Figure BDA0002568017770000131
Figure BDA0002568017770000141
The embodiment discloses a method for interface comparison test, which comprises the steps of obtaining a request message of a target interface and a request address of the target interface by configuring the target interface; writing the request message of the target interface and the request address of the target interface into a queue table; based on the queue table, requesting a target interface and calling a current response message and a historical response message corresponding to the target interface; wherein, the current corresponding message is a response message after the target interface iteration, and the historical response message is a response message before the target interface iteration; and comparing the current response message with the historical response message to obtain a comparison result and outputting the comparison result. Compared with the prior art, the method and the device can automatically perform comparison test on the interface, quickly construct a large batch of request messages to perform interface response message comparison test, quickly find the difference between the current iteration and the previous version, improve the working efficiency, solve the problem of insufficient scenes in the regression test, and increase the covered test scenes.
Example 2
As shown in fig. 5, the present embodiment discloses a system for interface contrast test, which includes:
a first obtaining module 1, configured to configure a target interface, and obtain a request packet of the target interface and a request address of the target interface;
in this embodiment, the request packet of the target interface is obtained in two forms, one is obtained by sql parameters, and the other is obtained by pulling the request packet in the log, specifically, the request packet in the specified time range is pulled according to the log title/tag, the packet is continuously pulled in the valid period, the log is obtained, and then the splicing and intercepting are performed, and the complete and effective request packet is compressed and then dropped. In order to improve the system efficiency, the time range which is already pulled is written into the cache, and the time range which is overlapped is not pulled again. The user selects the two message acquisition modes when newly adding configuration. In this embodiment, a comparison task is triggered before the request packet of the target interface and the request address of the target interface are obtained.
A first write-in module 2, configured to write the request packet of the target interface and the request address of the target interface into a queue table;
and the modification module 3 is used for modifying the data of the node of the request message of the target interface.
In this embodiment, when a user adds a new configuration, the pre-processing configuration before request is added, a global variable is written in from a request message by taking a value through jsonnpath and xpath, the value is taken from the global variable, and the sql is executed by splicing, and the pre-processing sql is executed before a request interface, so that data of a node of the request message of the target interface is modified. Pre-request preprocessing is to modify data of a node of the request packet of the target interface, for example, in an interface test process, test data (such as order data) may need to be modified before reaching a processing condition.
The calling module 4 is used for requesting a target interface and calling a current response message and a historical response message corresponding to the target interface based on the queue table; wherein, the current corresponding message is a response message after the target interface iteration, and the historical response message is a response message before the target interface iteration;
in this embodiment, to increase the interface contrast speed, an execution machine and a multi-trip request interface are allocated according to the task ID redundancy.
And the comparison module 5 is used for comparing the current response message with the historical response message to obtain a comparison result and outputting the comparison result.
The comparison module 5 is further configured to determine whether the nodes of the current response packet and the historical response packet are the same and only one of the same node is present, and if yes, perform automatic matching mapping on the same node to output a comparison result of the current response packet and the historical response packet; if not, outputting a manual matching mapping signal to prompt manual matching mapping.
The second writing module 6 is used for writing the comparison result into a database;
in this embodiment, the comparison result is written into ES (elastic search), which is a Lucene-based search server. It provides a distributed multi-user capable full-text search engine based on RESTful web interface.
A second obtaining module 7, configured to obtain data of the comparison result from the database;
a statistic module 8, configured to count inconsistent nodes, missing nodes, and ignoring nodes of the current response packet and the historical response packet based on the data of the comparison result;
and the output module 9 is used for outputting inconsistent nodes, missing nodes and neglected nodes of the current response message and the historical response message.
As shown in fig. 6, the first obtaining module 1 in this embodiment includes:
an obtaining unit 11, configured to obtain data of the target interface from a database;
a first write unit 12, configured to write data of the target interface into a memory as a global variable;
and a replacing unit 13, configured to replace a field in the template of the request packet with a value from the global variable, so as to obtain the request packet.
As shown in fig. 7, the first writing module 2 in this embodiment includes:
a modifying unit 21, configured to modify a field node of a request packet of the target interface and data of the node of the request packet;
and a second writing unit 22, configured to write the modified request packet into the queue table.
In this embodiment, when a user adds a new configuration, a custom processing request configuration is added to implement an extension function, and the user may perform secondary modification on a request packet before an interface is called, for example, the request packet depends on data of other interfaces, or the request packet is not a legal json character string under the condition of being pulled from a log, and needs secondary cleaning, and the like, so as to implement modification on field nodes of the request packet of the target interface and data of nodes of the request packet. And then implementing java interface, binding the implementation class with the comparison configuration, and taking out the instance object of the current configuration for logic processing when executing. The system is expanded based on the low coupling mode to meet different requirements.
In this embodiment, by obtaining a contract of an interface, nodes with the same path and the same name are automatically matched, a mapping relationship of a json path is stored, and values of two versions of a current response packet and a historical response packet are taken out for comparison according to the mapping relationship during subsequent comparison.
The database table designed in this embodiment includes: interface _ monitor _ config database table, interface _ monitor _ batch database table, interface _ monitor _ result database table. The interface _ monitor _ config is used for storing the configuration of two acquisition request messages in the flow chart. And if the mode is the sql parameter transmission mode, storing the sql, the request message template and the like. If the request message is acquired from the log system, the configuration of pulling the log is mainly stored. And the interface _ monitor _ batch triggers a task writing table each time and is used for recording report receivers of the current batch, compared statistical results and the like. interface _ monitor _ result mainly stores A, B two versions of request url, request message and response message after comparison of each comparison task.
The following specifically shows the interface _ monitor _ config database table (as shown in table one below), the interface _ monitor _ batch database table (as shown in table two below), and the interface _ monitor _ result database table (as shown in table three below). The following three database tables are merely an example and are not limited thereto.
Watch 1
Figure BDA0002568017770000171
Figure BDA0002568017770000181
Watch two
Figure BDA0002568017770000191
Figure BDA0002568017770000201
Watch III
Figure BDA0002568017770000202
Figure BDA0002568017770000211
Figure BDA0002568017770000221
Figure BDA0002568017770000231
The embodiment discloses a system for interface comparison test, which acquires a request message of a target interface and a request address of the target interface by configuring the target interface; writing the request message of the target interface and the request address of the target interface into a queue table; based on the queue table, requesting a target interface and calling a current response message and a historical response message corresponding to the target interface; wherein, the current corresponding message is a response message after the target interface iteration, and the historical response message is a response message before the target interface iteration; and comparing the current response message with the historical response message to obtain a comparison result and outputting the comparison result. Compared with the prior art, the method and the device can automatically perform comparison test on the interface, quickly construct a large batch of request messages to perform interface response message comparison test, quickly find the difference between the current iteration and the previous version, improve the working efficiency, solve the problem of insufficient scenes in the regression test, and increase the covered test scenes.
Example 3
Fig. 8 is a schematic structural diagram of an electronic device according to embodiment 3 of the present invention. The electronic device comprises a memory, a processor and a computer program stored on the memory and capable of running on the processor, wherein the processor executes the program to realize the interface contrast test method provided by embodiment 1. The electronic device 30 shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 8, the electronic device 30 may be embodied in the form of a general purpose computing device, which may be, for example, a server device. The components of the electronic device 30 may include, but are not limited to: the at least one processor 31, the at least one memory 32, and a bus 33 connecting the various system components (including the memory 32 and the processor 31).
The bus 33 includes a data bus, an address bus, and a control bus.
The memory 32 may include volatile memory, such as Random Access Memory (RAM)321 and/or cache memory 322, and may further include Read Only Memory (ROM) 323.
Memory 32 may also include a program/utility 325 having a set (at least one) of program modules 324, such program modules 324 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The processor 31 executes various functional applications and data processing, such as the method of the interface comparison test provided in embodiment 1 of the present invention, by running the computer program stored in the memory 32.
The electronic device 30 may also communicate with one or more external devices 34 (e.g., keyboard, pointing device, etc.). Such communication may be through input/output (I/O) interfaces 35. Also, model-generating device 30 may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the Internet) via network adapter 36. As shown, network adapter 36 communicates with the other modules of model-generating device 30 via bus 33. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the model-generating device 30, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
It should be noted that although in the above detailed description several units/modules or sub-units/modules of the electronic device are mentioned, such a division is merely exemplary and not mandatory. Indeed, the features and functionality of two or more of the units/modules described above may be embodied in one unit/module according to embodiments of the invention. Conversely, the features and functions of one unit/module described above may be further divided into embodiments by a plurality of units/modules.
Example 4
The present embodiment provides a computer-readable storage medium on which a computer program is stored, which when executed by a processor implements the steps of the method of interface contrast testing provided in embodiment 1.
More specific examples, among others, that the readable storage medium may employ may include, but are not limited to: a portable disk, a hard disk, random access memory, read only memory, erasable programmable read only memory, optical storage device, magnetic storage device, or any suitable combination of the foregoing.
In a possible implementation, the invention may also be implemented in the form of a program product comprising program code for causing a terminal device to perform the steps of the method for implementing the interface contrast test provided in example 1, when the program product is run on the terminal device.
Where program code for carrying out the invention is written in any combination of one or more programming languages, the program code may be executed entirely on the user device, partly on the user device, as a stand-alone software package, partly on the user device and partly on a remote device or entirely on the remote device.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that this is by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.

Claims (14)

1. A method for interface contrast test, the method comprising:
configuring a target interface, and acquiring a request message of the target interface and a request address of the target interface;
writing the request message of the target interface and the request address of the target interface into a queue table;
based on the queue table, requesting a target interface and calling a current response message and a historical response message corresponding to the target interface; wherein, the current corresponding message is a response message after the target interface iteration, and the historical response message is a response message before the target interface iteration;
and comparing the current response message with the historical response message to obtain a comparison result and outputting the comparison result.
2. The method for interface contrast test according to claim 1, wherein the step of obtaining the request message of the target interface comprises:
acquiring data of the target interface from a database;
writing the data of the target interface into a memory as a global variable;
and replacing fields in the template of the request message with values from the global variables to obtain the request message.
3. The method for interface contrast test according to claim 1, wherein the step of writing the request message of the target interface into a queue table comprises:
modifying field nodes of the request message of the target interface and data of the nodes of the request message;
and writing the modified request message into a queue list.
4. The method for interface contrast test according to claim 1, wherein the step of writing the request packet of the target interface and the request address of the target interface into a queue table further comprises:
and modifying the data of the node of the request message of the target interface.
5. The method for interface comparison test according to claim 1, wherein the step of comparing the current response packet with the historical response packet to obtain a comparison result and outputting the comparison result comprises the steps of:
judging whether the nodes of the current response message and the historical response message are the same and only one node is the same, if so, automatically matching and mapping the same node to output a comparison result of the current response message and the historical response message; if not, outputting a manual matching mapping signal to prompt manual matching mapping.
6. The method of interface contrast testing of claim 1, further comprising:
writing the comparison result into a database;
acquiring data of the comparison result from the database;
based on the data of the comparison result, counting inconsistent nodes, missing nodes and neglected nodes of the current response message and the historical response message;
and outputting inconsistent nodes, missing nodes and neglected nodes of the current response message and the historical response message.
7. A system for interface contrast testing, the system comprising:
the first acquisition module is used for configuring a target interface and acquiring a request message of the target interface and a request address of the target interface;
the first writing module is used for writing the request message of the target interface and the request address of the target interface into a queue table;
the calling module is used for requesting a target interface and calling a current response message and a historical response message corresponding to the target interface based on the queue list; wherein, the current corresponding message is a response message after the target interface iteration, and the historical response message is a response message before the target interface iteration;
and the comparison module is used for comparing the current response message with the historical response message to obtain a comparison result and outputting the comparison result.
8. The system for interface contrast testing of claim 7, wherein the first obtaining module comprises:
the acquisition unit is used for acquiring the data of the target interface from a database;
the first writing unit is used for writing the data of the target interface into a memory as a global variable;
and the replacing unit is used for replacing fields in the template of the request message by values from the global variables to obtain the request message.
9. The system for interface contrast testing of claim 7, wherein the first write module comprises:
the modification unit is used for modifying the field node of the request message of the target interface and the data of the node of the request message;
and the second writing unit is used for writing the modified request message into the queue list.
10. The system for interface contrast testing of claim 7, wherein said system for interface contrast testing further comprises:
and the modification module is used for modifying the data of the node of the request message of the target interface.
11. The system for interface contrast testing of claim 7, wherein the contrast module is further operable to,
judging whether the nodes of the current response message and the historical response message are the same and only one node is the same, if so, automatically matching and mapping the same node to output a comparison result of the current response message and the historical response message; if not, outputting a manual matching mapping signal to prompt manual matching mapping.
12. The system for interface contrast testing of claim 7, further comprising:
the second writing module is used for writing the comparison result into a database;
the second acquisition module is used for acquiring the data of the comparison result from the database;
the statistic module is used for counting inconsistent nodes, missing nodes and neglected nodes of the current response message and the historical response message based on the data of the comparison result;
and the output module is used for outputting the inconsistent nodes, the missing nodes and the neglected nodes of the current response message and the historical response message.
13. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of interface contrast testing according to any one of claims 1 to 6 when executing the computer program.
14. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of interface contrast testing according to any one of claims 1 to 6.
CN202010636076.9A 2020-07-03 2020-07-03 Method, system, device and medium for interface contrast test Pending CN111782452A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010636076.9A CN111782452A (en) 2020-07-03 2020-07-03 Method, system, device and medium for interface contrast test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010636076.9A CN111782452A (en) 2020-07-03 2020-07-03 Method, system, device and medium for interface contrast test

Publications (1)

Publication Number Publication Date
CN111782452A true CN111782452A (en) 2020-10-16

Family

ID=72759522

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010636076.9A Pending CN111782452A (en) 2020-07-03 2020-07-03 Method, system, device and medium for interface contrast test

Country Status (1)

Country Link
CN (1) CN111782452A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463625A (en) * 2020-12-09 2021-03-09 苏州浪潮智能科技有限公司 Functional regression verification method and device based on application program interface and storage medium
CN112910855A (en) * 2021-01-18 2021-06-04 中国民航信息网络股份有限公司 Sample message processing method and device
CN113076134A (en) * 2021-04-08 2021-07-06 广州虎牙科技有限公司 API change monitoring method, system, client and electronic equipment
CN116627973A (en) * 2023-05-25 2023-08-22 成都融见软件科技有限公司 Data positioning system

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852178A (en) * 2005-11-16 2006-10-25 华为技术有限公司 Protocol testing apparatus and method thereof
CN108023787A (en) * 2017-11-24 2018-05-11 烽火通信科技股份有限公司 Ethernet service test device and method based on FPGA
CN108984355A (en) * 2018-07-10 2018-12-11 郑州云海信息技术有限公司 A kind of automated testing method of interface testing
CN109117375A (en) * 2018-08-30 2019-01-01 上海携程金融信息服务有限公司 Database interface test method, system, equipment and storage medium
CN109474488A (en) * 2018-10-31 2019-03-15 中国银行股份有限公司 Interface test method, device and computer equipment
CN110188036A (en) * 2019-05-10 2019-08-30 深圳前海微众银行股份有限公司 A kind of method for testing software and device
CN110427331A (en) * 2019-09-03 2019-11-08 四川长虹电器股份有限公司 The method for automatically generating performance test script based on interface testing tool
CN110543428A (en) * 2019-09-09 2019-12-06 中国工商银行股份有限公司 Application system testing method and device
US20200065228A1 (en) * 2018-08-23 2020-02-27 International Business Machines Corporation Function-message oriented test case generation for supporting continuous globalization verification testing
CN111010316A (en) * 2019-12-17 2020-04-14 广州唯品会信息科技有限公司 Flow playback method, device and system
CN111159049A (en) * 2019-12-31 2020-05-15 中国银行股份有限公司 Automatic interface testing method and system

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1852178A (en) * 2005-11-16 2006-10-25 华为技术有限公司 Protocol testing apparatus and method thereof
WO2007056921A1 (en) * 2005-11-16 2007-05-24 Huawei Technologies Co., Ltd. A protocol testing device and the protocol testing method thereof
CN108023787A (en) * 2017-11-24 2018-05-11 烽火通信科技股份有限公司 Ethernet service test device and method based on FPGA
CN108984355A (en) * 2018-07-10 2018-12-11 郑州云海信息技术有限公司 A kind of automated testing method of interface testing
US20200065228A1 (en) * 2018-08-23 2020-02-27 International Business Machines Corporation Function-message oriented test case generation for supporting continuous globalization verification testing
CN109117375A (en) * 2018-08-30 2019-01-01 上海携程金融信息服务有限公司 Database interface test method, system, equipment and storage medium
CN109474488A (en) * 2018-10-31 2019-03-15 中国银行股份有限公司 Interface test method, device and computer equipment
CN110188036A (en) * 2019-05-10 2019-08-30 深圳前海微众银行股份有限公司 A kind of method for testing software and device
CN110427331A (en) * 2019-09-03 2019-11-08 四川长虹电器股份有限公司 The method for automatically generating performance test script based on interface testing tool
CN110543428A (en) * 2019-09-09 2019-12-06 中国工商银行股份有限公司 Application system testing method and device
CN111010316A (en) * 2019-12-17 2020-04-14 广州唯品会信息科技有限公司 Flow playback method, device and system
CN111159049A (en) * 2019-12-31 2020-05-15 中国银行股份有限公司 Automatic interface testing method and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
林连进等: "《软件测试技术》", 31 August 2018, 北京:北京理工大学出版社, pages: 78 - 79 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112463625A (en) * 2020-12-09 2021-03-09 苏州浪潮智能科技有限公司 Functional regression verification method and device based on application program interface and storage medium
CN112463625B (en) * 2020-12-09 2022-12-02 苏州浪潮智能科技有限公司 Functional regression verification method and device based on application program interface and storage medium
CN112910855A (en) * 2021-01-18 2021-06-04 中国民航信息网络股份有限公司 Sample message processing method and device
CN112910855B (en) * 2021-01-18 2023-04-07 中国民航信息网络股份有限公司 Sample message processing method and device
CN113076134A (en) * 2021-04-08 2021-07-06 广州虎牙科技有限公司 API change monitoring method, system, client and electronic equipment
CN116627973A (en) * 2023-05-25 2023-08-22 成都融见软件科技有限公司 Data positioning system
CN116627973B (en) * 2023-05-25 2024-02-09 成都融见软件科技有限公司 Data positioning system

Similar Documents

Publication Publication Date Title
CN111782452A (en) Method, system, device and medium for interface contrast test
EP2385472B1 (en) Fine grain synchronization for database replay
US8839107B2 (en) Context based script generation
US10116534B2 (en) Systems and methods for WebSphere MQ performance metrics analysis
US20130104135A1 (en) Data center operation
EP2779044A1 (en) System and method to provide management of test data at various lifecycle stages
CN111125444A (en) Big data task scheduling management method, device, equipment and storage medium
CN110740184B (en) Transaction strategy testing system based on micro-service architecture
US10489266B2 (en) Generating a visualization of a metric at one or multiple levels of execution of a database workload
CN107003931B (en) Decoupling test validation from test execution
US11176169B2 (en) Recommending visual and execution templates to enable automation of control and data exploration across systems
US20160063107A1 (en) Data retrieval via a telecommunication network
CN112052082B (en) Task attribute optimization method, device, server and storage medium
US20140101097A1 (en) Template based database analyzer
US11892976B2 (en) Enhanced search performance using data model summaries stored in a remote data store
CN108268546A (en) A kind of method and device for optimizing database
Wang Stream processing systems benchmark: Streambench
CN115335821A (en) Offloading statistics collection
CN112559525B (en) Data checking system, method, device and server
US10887186B2 (en) Scalable web services execution
CN116578497A (en) Automatic interface testing method, system, computer equipment and storage medium
US10003492B2 (en) Systems and methods for managing data related to network elements from multiple sources
US20220214961A1 (en) Troubleshooting software services based on system calls
CN114047999A (en) Page configuration method, system, electronic equipment and storage medium
US10324819B1 (en) Runtime performance introspection

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