CN110069413B - Test data communication, test method, device, equipment and storage medium - Google Patents

Test data communication, test method, device, equipment and storage medium Download PDF

Info

Publication number
CN110069413B
CN110069413B CN201910325025.1A CN201910325025A CN110069413B CN 110069413 B CN110069413 B CN 110069413B CN 201910325025 A CN201910325025 A CN 201910325025A CN 110069413 B CN110069413 B CN 110069413B
Authority
CN
China
Prior art keywords
data
test
communication
target
server
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
CN201910325025.1A
Other languages
Chinese (zh)
Other versions
CN110069413A (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.)
Suzhou Yige Network Technology Co ltd
Original Assignee
Suzhou Yige Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Yige Network Technology Co ltd filed Critical Suzhou Yige Network Technology Co ltd
Priority to CN201910325025.1A priority Critical patent/CN110069413B/en
Publication of CN110069413A publication Critical patent/CN110069413A/en
Application granted granted Critical
Publication of CN110069413B publication Critical patent/CN110069413B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The embodiment of the invention discloses a test data communication method, a test data communication device and a storage medium. The method comprises the following steps: the intermediate equipment modifies the received target communication data to obtain test data; the intermediate device extracts device pointing information from the target communication data and sends the test data to the target device matched with the device pointing information; the test data is used for testing the target equipment, the target equipment comprises a server or a client, and communication between the server and the client is realized through the intermediate equipment. The embodiment of the invention can automatically tamper the test data, simplify the data tampering process and improve the data tampering efficiency, thereby improving the test efficiency.

Description

Test data communication, test method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of software testing, in particular to a test data communication and test method, a test device, test equipment and a storage medium.
Background
The test is an essential link in the software development process and is used for judging whether each function of the software achieves the expected effect.
Generally, testing whether software functions achieve a desired goal in the field of communications requires multiple devices to be cooperatively implemented. When a device under test is tested, communication data sent by a device in communication connection with the device under test needs to be adjusted, and whether the device under test has a certain function is verified by observing the reaction of the device under test receiving the test data. Illustratively, the robustness test (robustness test) is to test the processing capability of a certain device on abnormal data sent by other devices, and the abnormal data refers to data which does not meet the requirement of the device specification; penetration testing is the testing of a device's ability to process maliciously injected penetration code.
At present, the above test needs to ensure that the device receives data tampered according to the test requirements, and the data is usually tampered by directly forging and modifying the data manually or modifying the data manually by using an agent packet capturing tool. The existing data tampering method is completed manually, the modification operation is complex and is easy to make mistakes, the modified data is not necessary to be the tampered data required by a user, and even the modified data is repeatedly modified for many times to achieve the desired effect, so that the tampering efficiency is low. And the data that needs to be tampered is generally source data, under the condition that the system or the architecture is complex, the difficulty of inquiring and modifying the source data is large, and meanwhile, if the source data is provided by a third party, the source data cannot be directly modified.
Disclosure of Invention
The embodiment of the invention provides a test data communication method, a test data communication device and a storage medium, which can automatically tamper test data, simplify the data tampering process and improve the data tampering efficiency, thereby improving the test efficiency.
In a first aspect, an embodiment of the present invention provides a test data communication method, including:
the intermediate equipment modifies the received target communication data to obtain test data;
the intermediate device extracts device pointing information from the target communication data and sends the test data to the target device matched with the device pointing information;
the test data is used for testing the target equipment, the target equipment comprises a server or a client, and communication between the server and the client is realized through the intermediate equipment.
In a second aspect, an embodiment of the present invention provides a testing method, including:
the client sends request data to the intermediate equipment so that the intermediate equipment forwards the request data to a target server;
the client receives the test data which is forwarded by the intermediate device and matched with the request data, and responds;
and when an abnormal response event occurs, the client acquires the problem information of the abnormal response event and reports the problem information.
In a third aspect, an embodiment of the present invention provides a testing method, including:
the server receives test data sent by the intermediate equipment;
the server acquires feedback data matched with the test data and sends the feedback data to the intermediate equipment so that the intermediate equipment forwards the feedback data to a target client;
when an abnormal response event occurs, the server collects the problem information of the abnormal response event and displays the problem information to a test user;
and when receiving a test instruction input by the test user, the server executes the test operation matched with the test instruction to obtain a test result and displays the test result to the test user.
In a fourth aspect, an embodiment of the present invention further provides a test data communication method apparatus, including:
the communication data modification module is used for modifying the received target communication data to obtain test data;
the test data forwarding module is used for extracting equipment pointing information from the target communication data and sending the test data to target equipment matched with the equipment pointing information; the test data is used for testing the target equipment, the target equipment comprises a server or a client, and communication between the server and the client is realized through the intermediate equipment.
In a fifth aspect, an embodiment of the present invention further provides a testing apparatus, including:
the request data sending module is used for sending request data to the intermediate equipment so that the intermediate equipment forwards the request data to the target server;
the test data receiving and responding module is used for receiving the test data which is forwarded by the intermediate equipment and matched with the request data, and responding;
and the problem information reporting module is used for collecting and reporting the problem information of the abnormal response event when the abnormal response event occurs.
In a sixth aspect, an embodiment of the present invention further provides a testing apparatus, including:
the test data receiving module is used for receiving test data sent by the intermediate equipment;
the feedback data sending module is used for acquiring feedback data matched with the test data and sending the feedback data to the intermediate equipment so that the intermediate equipment can forward the feedback data to a target client;
the problem information acquisition module is used for acquiring the problem information of the abnormal response event when the abnormal response event occurs and displaying the problem information to a test user;
and the test module is used for executing the test operation matched with the test instruction when receiving the test instruction input by the test user to obtain a test result and displaying the test result to the test user.
In a seventh aspect, an embodiment of the present invention further provides an apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the test data communication method or the test method according to any one of the embodiments of the present invention.
In an eighth aspect, the embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, and the computer program, when executed by a processor, implements the test data communication method or the test method according to any one of the embodiments of the present invention.
According to the embodiment of the invention, the intermediate device is arranged in the communication link between the server and the client, so that the communication data between the server and the client are forwarded through the intermediate device, the received communication device is modified through the intermediate device, the obtained test data is sent to the pointed target device, the communication data is automatically tampered in the communication process, the test data is formed, the robustness test is carried out on the target device, the problems of high labor cost, high difficulty and low efficiency in obtaining the tampered data required by the test in the prior art are solved, the automatic data tampering is realized, the diversity of the tampered data is increased, the data tampering process is simplified, the data tampering difficulty is reduced, the data tampering efficiency is improved, and the test efficiency and the test effect are improved.
Drawings
FIG. 1a is a flowchart of a test data communication method according to a first embodiment of the present invention;
FIG. 1b is a functional block diagram of an intermediate device according to a first embodiment of the present invention;
FIG. 1c is a diagram illustrating a specific application scenario according to a first embodiment of the present invention;
FIG. 2 is a flow chart of a testing method according to a second embodiment of the present invention;
FIG. 3 is a flow chart of a testing method according to a third embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a test data communication device according to a fourth embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a testing apparatus according to a fifth embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a testing apparatus according to a sixth embodiment of the present invention;
fig. 7 is a schematic structural diagram of an apparatus in a seventh embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1a is a flowchart of a test data communication method in one embodiment of the present invention, which is applicable to a case where communication data for a robustness test is generated and transmitted, and the method can be executed by a test data communication apparatus provided in an embodiment of the present invention, and the apparatus can be implemented in software and/or hardware, and can be generally integrated into an electronic device providing a communication function, for example, a computer device or the like. As shown in fig. 1a, the method of this embodiment specifically includes:
s110, the intermediate device modifies the received target communication data to obtain test data.
The intermediate device is used as a communication transfer device between the client and the server, and communication data between the client and the server need to be forwarded through the intermediate device. Specifically, as shown in fig. 1b, the communication process between the client 141 and the server 143 specifically includes: the client 141 sends the communication data to the intermediate device 142, and the communication data is forwarded to the server 143 by the intermediate device 142; the server 143 transmits the communication data to the intermediate device 142, and the intermediate device 142 forwards the communication data to the client 141. The intermediate device may be disposed in the server or the client, or may be disposed in a computer device other than the server and the client. Numerical value
The target communication data may refer to communication data of a test requirement, and may include request data sent by the client and directed to a server or feedback data sent by the server and directed to the client. Further, the target communication data and the test data may be JSON data. It should be noted that, part of the communication data may be directly forwarded through the intermediate device without being tampered.
Specifically, both the client and the server can perform robustness testing, and the intermediate device can tamper communication data sent by the server before the communication data reaches the client according to testing requirements, so that the client obtains the tampered data to obtain the response condition of the client to abnormal data, and the fault tolerance capability of the client to the abnormal data is analyzed to obtain the robustness testing result of the client. In addition, the intermediate device can also tamper the communication data sent by the client according to the test requirement before the communication data reaches the server, so that the server obtains the tampered data to obtain the response condition of the server to the abnormal data, and the fault-tolerant capability of the server to the abnormal data is analyzed to obtain the robustness test result of the server.
Optionally, the modifying, by the intermediate device, the received target communication data to obtain the test data may include: the intermediate equipment inputs the target communication data into a pre-trained data recognition model to obtain the labeling data of the labeling type label output by the data recognition model; modifying the marked data according to the type label and a preset tampering rule to obtain test data; the data recognition model is obtained by training according to a plurality of training samples of communication data with data types labeled in advance.
The data identification model is used for analyzing each data element included in the target communication data and determining the data type of each data element. The annotation type tag is used to determine the type of communication data of the annotation data, and to analyze the type of each data element included in the communication data and annotate (e.g., annotate a location). The type of the communication data may specifically include request data sent by the client or feedback data sent by the server; the type of the data element may specifically include at least one of an object, a numerical value, a boolean value, an array, a character, a parameter, a form, and the like. A type tag for the communication data may be generated based on the type of communication data and the type of data element. And modifying the labels of different types according to the matched tampering rules.
For example, the type tag of the communication data is feedback data sent by the server; modifying the marked data according to a preset tampering rule to obtain test data, wherein the specific steps are as follows: determining the position of each data element and the data type of each data element from the communication data; selecting a matched tampering rule according to the data type to respectively modify each data element, and taking the modified communication data as abnormal data matched with the communication data; illustratively, the tamper rule includes at least one of: deleting a data object, assigning the data object to null, increasing or decreasing a numerical value, setting the numerical value to a positive or negative number, increasing or decreasing characters in a character string, negating a boolean value, and increasing or decreasing array elements within an array.
In one specific example, the target communication data includes a string, the string "abcdef", and the corresponding test data includes a string that may be modified to "af".
Illustratively, the type tag of the communication data is request data sent by the client; modifying the feedback data according to a preset tampering rule to obtain abnormal data matched with the communication data, specifically: extracting the transmission parameters, the forms and the limitation information of the server pointed by the request data, which are included in the communication data, as target modification information; and selecting a matched tampering rule based on the target modification information to respectively modify each data element. Illustratively, the tamper rule includes at least one of: modify the referrals, inject the pervasive code in the form, and modify the data and/or file format to a front-end limited format type.
The data type analysis is carried out on the target communication data through the pre-trained data recognition model to obtain the labeled data, the data is modified according to the preset tampering rule according to the type label and the matching degree, and the test data is generated.
Optionally, when the intermediate device modifies the received target communication data to obtain the test data, the method further includes: the intermediate device stores the target communication data and the test data as a test data pair, and generates identification information of the test data pair according to attribute information of the test data pair; adding the identification information to a message header in the test data; wherein the identification information is used for searching the test data pair.
The identification information may be information pointing to a test data pair, and is used for the intermediate device to find the test data pair. The message header is used to inform the target device of the role of the test data, and may specifically refer to a message header or a response header. Illustratively, the client sends a request to the server, and the header of the request includes information such as the method of the request, a uniform resource Locator (URI), a protocol version, a request modifier, and customer information.
Specifically, the identification information is added to the response header in the test data, so that when the test data is sent to the client for testing, a test user can extract the identification information from the response header of the test data received by the client, and obtain a test data pair, namely the original data which is not tampered and the tampered data, according to the identification information through the intermediate device, so as to compare the difference between the two data, thereby positioning and solving the problem.
The identification information is generated for the target communication data and the test data and is added to the message header to be sent to the client, so that a user of the client can obtain the identification information, the target communication data and the test data are inquired in the intermediate equipment based on the identification information, the target communication data and the test data are obtained, a tester is helped to quickly locate the test problem, and the speed of finding and solving the test problem is improved.
S120, the intermediate device extracts device pointing information from the target communication data and sends the test data to the target device matched with the device pointing information; the test data is used for testing the target equipment, the target equipment comprises a server or a client, and communication between the server and the client is realized through the intermediate equipment.
The device pointing information may refer to identification information of a device that receives target communication data, and may refer to destination address information of the target device. The target device may refer to a device that receives the target communication data.
In a specific example, as shown in fig. 1c, the target communication data is communication data sent by the server to the client, and the target device is the client. And the target communication data is used as original data to perform data type identification of each data element through a data identification model, each data element in the data is automatically tampered according to a preset tampering rule to form tampered data, and the tampered data is sent to a client as test data.
According to the embodiment of the invention, the intermediate device is arranged in the communication link between the server and the client, so that the communication data between the server and the client are forwarded through the intermediate device, the received communication device is modified through the intermediate device, the obtained test data is sent to the pointed target device, the communication data is automatically tampered in the communication process, the test data is formed, the robustness test is carried out on the target device, the problems of high labor cost, high difficulty and low efficiency in obtaining the tampered data required by the test in the prior art are solved, the automatic data tampering is realized, the diversity of the tampered data is increased, the data tampering process is simplified, the data tampering difficulty is reduced, the data tampering efficiency is improved, and the test efficiency and the test effect are improved.
Example two
Fig. 2 is a flowchart of a testing method in the second embodiment of the present invention, where this embodiment is applicable to a case of performing software testing based on received communication data, and the method may be executed by a testing apparatus provided in the second embodiment of the present invention, where the testing apparatus may be implemented in a software and/or hardware manner, and may be generally integrated in a client of an electronic device, for example, a client of a mobile terminal. As shown in fig. 2, the method of this embodiment specifically includes:
s210, the client sends request data to the intermediate device, so that the intermediate device forwards the request data to the target server.
The intermediate device and the test data in this embodiment may refer to the description of the above embodiments. The request data may refer to data sent by the client to the server to obtain the service.
S220, the client receives the test data which is sent by the target server and forwarded by the intermediate equipment and is matched with the request data, and responds.
The client receives the tampered communication data, responds, judges whether the problems of logic errors, interface display abnormity or client flash backing and the like occur according to the responded result, if the problems occur, the test associated with the test data does not pass, and needs to be improved, so that the fault tolerance of the client is improved.
Illustratively, when the communication data is page data to be displayed, the corresponding response mode may be to generate a display page according to the page data, and determine whether the display page has an abnormal display problem.
And S230, when an abnormal response event occurs, the client acquires the problem information of the abnormal response event and reports the problem information.
An exception response event may refer to an event that occurs at the client that does not meet the expected effect when responding to test data. The problem information may refer to information associated with the abnormal response event for a tester to determine the cause and location of the abnormal response event. The problem information may include identification information of a test data pair formed by the target communication data and the test data, and the identification information is used for searching the test data pair in the intermediate device so as to enable the test user to quickly locate and solve the abnormal response event. And the report is used for displaying the abnormal response event and the problem information to a test user so that the test user can locate the position of the abnormal response event and solve the abnormal response event based on the reason of the abnormal response event.
Specifically, the problem information of the abnormal response event can be reported to the electronic device of the test user by calling the collection service interface, so that the electronic device can be displayed to the test user.
The embodiment of the invention receives the tampered test data in the normal communication process of the client and the server, collects the problem information of the abnormal response event during response, and reports the problem information to the test user, thereby realizing automatic execution of software test and improving the efficiency of software test.
EXAMPLE III
Fig. 3 is a flowchart of a testing method in a third embodiment of the present invention, where this embodiment is applicable to a case of performing software testing based on received communication data, and the method may be executed by a testing apparatus provided in the third embodiment of the present invention, where the testing apparatus may be implemented in a software and/or hardware manner, and may be generally integrated in a server or the like. As shown in fig. 3, the method of this embodiment specifically includes:
s310, the server receives the test data sent by the intermediate device.
The intermediate device and the test data in this embodiment may refer to the description of the above embodiments.
S320, the server acquires feedback data matched with the test data and sends the feedback data to the intermediate equipment, so that the intermediate equipment forwards the feedback data to a target client and the server tests the test data.
The feedback data may refer to data that the server responds to based on the test data. For example, the test data is a request for a presentation page, and the feedback data may be data for the client to generate the presentation page.
S330, when an abnormal response event occurs, the server collects the problem information of the abnormal response event and displays the problem information to a test user.
An exception response event may refer to an event that occurs while responding to test data that does not meet an expected effect. The problem information may refer to information associated with the abnormal response event for a tester to determine the cause and location of the abnormal response event. The problem information may include identification information of a test data pair formed by the target communication data and the test data, and the identification information is used for searching the test data pair in the intermediate device so as to enable the test user to quickly locate and solve the abnormal response event. And displaying the abnormal response event and the problem information to a test user so that the test user locates the position of the abnormal response event and solves the abnormal response event based on the reason of the abnormal response event.
Specifically, the problem information of the abnormal response event can be reported to the electronic device of the test user by calling the collection service interface, so that the electronic device can be displayed to the test user.
For example, when the server receives test data of which the front end cannot identify the data type, the server may generate an event requesting an error, and at this time, problem information of the event is collected and displayed to the test user, for example, identification information of the test data, the data type of the test data, and the like.
S340, when receiving the test instruction input by the test user, the server executes the test operation matched with the test instruction to obtain a test result and displays the test result to the test user.
The test instruction is used for executing test operation and testing the server. Specifically, the test instruction is associated with test data, for example, the test data is formed by injecting the penetration code in a form, and the test instruction may be an instruction for executing a specific penetration test associated with the penetration code. The test operation may include a test program, or call a test interface, and the test result may be directly obtained after the test is completed.
The embodiment of the invention receives the tampered test data in the normal communication process of the client and the server, collects the problem information of the abnormal response event during response, and displays the problem information to the test user, thereby realizing automatic execution of the robustness test and improving the efficiency of the robustness test.
Example four
Fig. 4 is a schematic diagram of a test data communication device in a fourth embodiment of the present invention. The fourth embodiment is a corresponding device for implementing the test data communication method provided by the above embodiment of the present invention. The apparatus may be implemented in software and/or hardware, and may be generally integrated into an electronic device providing communication functions, such as a computer device. Accordingly, the apparatus of the present embodiment may include:
a communication data modification module 410, configured to modify the received target communication data to obtain test data;
a test data forwarding module 420, configured to extract device pointing information from the target communication data, and send the test data to a target device matched with the device pointing information; the test data is used for testing the target equipment, the target equipment comprises a server or a client, and communication between the server and the client is realized through the intermediate equipment.
According to the embodiment of the invention, the intermediate device is arranged in the communication link between the server and the client, so that the communication data between the server and the client are forwarded through the intermediate device, the received communication device is modified through the intermediate device, the obtained test data is sent to the pointed target device, the communication data is automatically tampered in the communication process, the test data is formed, the robustness test is carried out on the target device, the problems of high labor cost, high difficulty and low efficiency in obtaining the tampered data required by the test in the prior art are solved, the automatic data tampering is realized, the diversity of the tampered data is increased, the data tampering process is simplified, the data tampering difficulty is reduced, the data tampering efficiency is improved, and the test efficiency and the test effect are improved.
Further, the communication data modification module 410 is specifically configured to: the intermediate equipment inputs the target communication data into a pre-trained data recognition model to obtain the labeling data of a labeling type label output by the data recognition model; modifying the marked data according to the type label and a preset tampering rule to obtain test data; the data recognition model is obtained by training according to a plurality of training samples of communication data with data types labeled in advance.
Further, the communication data modification module 410 is specifically configured to: the intermediate equipment modifies the received target communication data to obtain test data, stores the target communication data and the test data as a test data pair, and generates identification information of the test data pair according to attribute information of the test data pair; adding the identification information to a message header in the test data; wherein the identification information is used for searching the test data pair.
The test data communication device can execute the test data communication method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executed test data communication method.
EXAMPLE five
Fig. 5 is a schematic diagram of a test data communication device according to a fifth embodiment of the present invention. The fifth embodiment of the present invention is a corresponding apparatus for implementing the test data communication method provided in the foregoing embodiments of the present invention. The apparatus may be implemented in software and/or hardware, and may be generally integrated in a client of an electronic device, for example, a client of a mobile terminal. Accordingly, the apparatus of the present embodiment may include:
a request data sending module 510, configured to send request data to an intermediate device, so that the intermediate device forwards the request data to a target server;
the test data receiving and responding module is used for receiving the test data which is forwarded by the intermediate equipment and matched with the request data, and responding;
a problem information reporting module 520, configured to, when an abnormal response event occurs, collect and report problem information of the abnormal response event.
The embodiment of the invention receives the tampered test data in the normal communication process of the client and the server, collects the problem information of the abnormal response event during response, and reports the problem information to the test user, thereby realizing automatic execution of software test and improving the efficiency of software test.
The testing device can execute the testing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executed testing method.
EXAMPLE six
Fig. 6 is a schematic diagram of a test data communication device according to a sixth embodiment of the present invention. The sixth embodiment is a corresponding device for implementing the test data communication method provided by the above-mentioned embodiments of the present invention. The apparatus may be implemented in software and/or hardware, and may be generally integrated in a server or the like. Accordingly, the apparatus of the present embodiment may include:
a test data receiving module 610, configured to receive test data sent by the intermediate device;
a feedback data sending module 620, configured to obtain feedback data matched with the test data, and send the feedback data to the intermediate device, so that the intermediate device forwards the feedback data to a target client;
a question information collecting module 630, configured to collect, when an abnormal response event occurs, question information of the abnormal response event, and display the question information to a test user;
and the test module 640 is configured to, when receiving a test instruction input by the test user, execute a test operation matched with the test instruction to obtain a test result and display the test result to the test user.
The embodiment of the invention receives the tampered test data in the normal communication process of the client and the server, collects the problem information of the abnormal response event during response, and displays the problem information to the test user, thereby realizing automatic execution of the robustness test and improving the efficiency of the robustness test.
The testing device can execute the testing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the executed testing method.
EXAMPLE seven
Fig. 7 is a schematic structural diagram of an apparatus according to a seventh embodiment of the present invention. Fig. 7 illustrates a block diagram of an exemplary device 701 suitable for use in implementing embodiments of the present invention. The device 701 shown in fig. 7 is only an example and should not bring any limitation to the function and the scope of use of the embodiments of the present invention. Illustratively, the device 701 is a client, server, or other electronic device.
As shown in fig. 7, device 701 is in the form of a general purpose computing device. The components of device 701 may include, but are not limited to: one or more processors or processing units 702, a system memory 703, and a bus 704 that couples the various system components including the system memory 703 and the processing unit 702.
Bus 704 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MCA) bus, an enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
Device 701 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by device 701 and includes both volatile and nonvolatile media, removable and non-removable media.
The system Memory 703 may include computer system readable media in the form of volatile Memory, such as Random Access Memory (RAM) 705 and/or cache Memory 706. The device 701 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, the storage system 707 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 7, and commonly referred to as a "hard disk drive"). Although not shown in FIG. 7, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a Compact disk Read-Only Memory (CD-ROM), Digital Video disk (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 704 by one or more data media interfaces. The system memory 703 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 709 having a set (at least one) of program modules 708 may be stored, for instance, in system memory 703, such program modules 708 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 708 generally perform the functions and/or methodologies of embodiments of the invention as described herein.
Device 701 may also communicate with one or more external devices 710 (e.g., keyboard, pointing device, etc.), with one or more devices that enable a user to interact with device 701, and/or with any devices (e.g., network card, modem, etc.) that enable device 701 to communicate with one or more other computing devices. Such communication may be through an Input/Output (I/O) interface 712. Also, device 701 may communicate with one or more networks (e.g., a Local Area Network (LAN), Wide Area Network (WAN), and/or a public Network, such as the internet) via Network adapter 713. As shown, the network adapter 713 communicates with the other modules of the device 701 over a bus 704. It should be appreciated that although not shown in FIG. 7, other hardware and/or software modules may be used in conjunction with device 701, including but not limited to: microcode, device drivers, Redundant processing units, external disk drive Arrays, disk array (RAID) systems, tape drives, and data backup storage systems, to name a few.
The processing unit 702 executes various functional applications and data processing by executing programs stored in the system memory 703, for example, to implement a test data communication method or a test method provided by an embodiment of the present invention.
Practice eight
An eighth embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the test data communication method provided in all the embodiments of the present invention:
that is, the program when executed by the processor implements: the intermediate equipment modifies the received target communication data to obtain test data; the intermediate device extracts device pointing information from the target communication data and sends the test data to the target device matched with the device pointing information; the test data is used for testing the target equipment, the target equipment comprises a server or a client, and communication between the server and the client is realized through the intermediate equipment.
Or, the test method provided in the embodiment of the present invention when the program is executed by the processor, that is, the program implements: the client sends request data to the intermediate equipment so that the intermediate equipment forwards the request data to a target server; the client receives the test data which is forwarded by the intermediate device and matched with the request data, and responds; and when an abnormal response event occurs, the client acquires the problem information of the abnormal response event and reports the problem information.
Or, the test method provided in the embodiment of the present invention when the program is executed by the processor, that is, the program implements: the server receives test data sent by the intermediate equipment; the server acquires feedback data matched with the test data and sends the feedback data to the intermediate equipment so that the intermediate equipment forwards the feedback data to a target client; when an abnormal response event occurs, the server collects the problem information of the abnormal response event and displays the problem information to a test user; and when receiving a test instruction input by the test user, the server executes the test operation matched with the test instruction to obtain a test result and displays the test result to the test user.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a RAM, a Read-Only Memory (ROM), an Erasable Programmable Read-Only Memory (EPROM), a flash Memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a LAN or a WAN, or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (9)

1. A method of testing data communication, comprising:
the intermediate equipment modifies the received target communication data to obtain test data;
wherein the target communication data comprises: request data which is sent by a client and points to a server or feedback data which is sent by the server and points to the client; the test data includes: robustness test data directed to a server or a client;
the intermediate device extracts device pointing information from the target communication data and sends the test data to the target device matched with the device pointing information;
the test data is used for testing the target equipment, the target equipment comprises a server or a client, and the communication between the server and the client is realized through the intermediate equipment;
the intermediate device modifies the received target communication data to obtain test data, and the method comprises the following steps:
the intermediate equipment inputs the target communication data into a pre-trained data recognition model to obtain the labeling data of the labeling type label output by the data recognition model;
modifying the marked data according to the type label and a preset tampering rule to obtain test data;
the data identification model is obtained by training according to a plurality of training samples of communication data with data types labeled in advance;
modifying the marked data according to the type label and a preset tampering rule to obtain test data, wherein the modifying comprises the following steps:
when the type tag is feedback data sent by a server, determining the position of each data element and the data type of each data element from the communication data; selecting a matched tampering rule according to the data type to respectively modify each data element, and taking the modified communication data as test data matched with the communication data;
wherein the tamper rule comprises at least one of: deleting the data object, assigning the data object as null, increasing or decreasing the numerical value, setting the numerical value as a positive number or a negative number, increasing or decreasing characters in the character string, negating the Boolean value and increasing or decreasing array elements in the array;
when the type tag is request data sent by a client, extracting the transmission parameters, the forms and the limitation information of the server to which the request data points, which are included in the communication data, as target modification information; selecting matched tampering rules based on the target modification information to respectively modify each data element;
wherein the tamper rule comprises at least one of: modify the referrals, inject the pervasive code in the form, and modify the data and/or text format to a front-end limited format type.
2. The method of claim 1, wherein the intermediate device modifies the received target communication data to obtain test data, and further comprising:
the intermediate device stores the target communication data and the test data as a test data pair, and generates identification information of the test data pair according to attribute information of the test data pair;
adding the identification information to a message header in the test data; wherein the identification information is used for searching the test data pair.
3. A method of testing, comprising:
the client sends request data to the intermediate equipment so that the intermediate equipment forwards the request data to a target server;
the client receives the test data which is forwarded by the intermediate device and matched with the request data, and responds;
judging whether logic errors, interface display abnormity or client end flash back problems occur according to the responded result;
if so, the test associated with the test data fails;
when an abnormal response event occurs, the client acquires the problem information of the abnormal response event and reports the problem information;
the problem information comprises identification information of a test data pair formed by target communication data and the test data;
the test data is the labeling data of a labeling type label output by the data recognition model, which is obtained by inputting the request data into a pre-trained data recognition model by the intermediate equipment; modifying the marked data according to the type label and a preset tampering rule to obtain the marked data;
the data identification model is obtained by training according to a plurality of training samples of communication data with data types labeled in advance;
modifying the marked data according to the type label and a preset tampering rule to obtain test data, wherein the modifying comprises the following steps:
extracting the parameters, the forms and the limitation information of the server pointed by the request data, which are included in the request data, as target modification information; selecting matched tampering rules based on the target modification information to respectively modify each data element;
wherein the tamper rule comprises at least one of: modify the referrals, inject the pervasive code in the form, and modify the data and/or text format to a front-end limited format type.
4. A method of testing, comprising:
the server receives test data sent by the intermediate equipment;
the server acquires feedback data matched with the test data and sends the feedback data to the intermediate equipment so that the intermediate equipment forwards the feedback data to a target client;
when an abnormal response event occurs, the server collects the problem information of the abnormal response event and displays the problem information to a test user;
the problem information comprises identification information of a test data pair formed by target communication data and test data;
when a test instruction input by the test user is received, the server executes test operation matched with the test instruction to obtain a test result and displays the test result to the test user;
the test data is the labeling data of the labeling type label output by the data recognition model, which is obtained by inputting the feedback data into a pre-trained data recognition model by the intermediate equipment; modifying the marked data according to the type label and a preset tampering rule to obtain the marked data;
the data identification model is obtained by training according to a plurality of training samples of communication data with data types labeled in advance;
modifying the marked data according to the type label and a preset tampering rule to obtain test data, wherein the modifying comprises the following steps:
determining the position of each data element and the data type of each data element from the feedback data; selecting a matched tampering rule according to the data type to respectively modify each data element, and taking the modified feedback data as test data matched with the feedback data;
wherein the tamper rule comprises at least one of: deleting a data object, assigning the data object to null, increasing or decreasing a numerical value, setting the numerical value to a positive or negative number, increasing or decreasing characters in a character string, negating a boolean value, and increasing or decreasing array elements within an array.
5. A test data communication apparatus, comprising:
the communication data modification module is used for modifying the received target communication data to obtain test data;
wherein the target communication data comprises: request data which is sent by a client and points to a server or feedback data which is sent by the server and points to the client; the test data includes: robustness test data directed to a server or a client;
the test data forwarding module is used for extracting equipment pointing information from the target communication data and sending the test data to target equipment matched with the equipment pointing information; the test data is used for testing the target equipment, the target equipment comprises a server or a client, and communication between the server and the client is realized through intermediate equipment;
the communication data modification module is specifically configured to: the intermediate equipment inputs the target communication data into a pre-trained data recognition model to obtain the labeling data of the labeling type label output by the data recognition model; modifying the marked data according to the type label and a preset tampering rule to obtain test data; the data identification model is obtained by training according to a plurality of training samples of communication data with data types labeled in advance;
modifying the marked data according to the type label and a preset tampering rule to obtain test data, wherein the modifying comprises:
when the type tag is feedback data sent by a server, determining the position of each data element and the data type of each data element from the communication data; selecting a matched tampering rule according to the data type to respectively modify each data element, and taking the modified communication data as test data matched with the communication data;
wherein the tamper rule comprises at least one of: deleting the data object, assigning the data object as null, increasing or decreasing the numerical value, setting the numerical value as a positive number or a negative number, increasing or decreasing characters in the character string, negating the Boolean value and increasing or decreasing array elements in the array;
when the type tag is request data sent by a client, extracting the transmission parameters, the forms and the limitation information of the server to which the request data points, which are included in the communication data, as target modification information; selecting matched tampering rules based on the target modification information to respectively modify each data element;
wherein the tamper rule comprises at least one of: modify the referrals, inject the pervasive code in the form, and modify the data and/or text format to a front-end limited format type.
6. A testing device, which is arranged in a client, comprises:
the request data sending module is used for sending request data to the intermediate equipment so that the intermediate equipment forwards the request data to the target server;
the test data receiving and responding module is used for receiving the test data which is forwarded by the intermediate equipment and matched with the request data, and responding;
the result judging module is used for judging whether logic errors, interface display abnormity or client end flash back problems occur according to the result after response; if so, the test associated with the test data fails;
the problem information reporting module is used for collecting and reporting the problem information of the abnormal response event when the abnormal response event occurs;
the problem information comprises identification information of a test data pair formed by target communication data and the test data;
the test data is the labeling data of a labeling type label output by the data recognition model, which is obtained by inputting the request data into a pre-trained data recognition model by the intermediate equipment; modifying the marked data according to the type label and a preset tampering rule to obtain the marked data;
the data identification model is obtained by training according to a plurality of training samples of communication data with data types labeled in advance;
modifying the marked data according to the type label and a preset tampering rule to obtain test data, wherein the modifying comprises:
extracting the parameters, the forms and the limitation information of the server pointed by the request data, which are included in the request data, as target modification information; selecting matched tampering rules based on the target modification information to respectively modify each data element;
wherein the tamper rule comprises at least one of: modify the referrals, inject the pervasive code in the form, and modify the data and/or text format to a front-end limited format type.
7. A testing device, disposed in a server, comprising:
the test data receiving module is used for receiving test data sent by the intermediate equipment;
the feedback data sending module is used for acquiring feedback data matched with the test data and sending the feedback data to the intermediate equipment so that the intermediate equipment can forward the feedback data to a target client;
the problem information acquisition module is used for acquiring the problem information of the abnormal response event when the abnormal response event occurs and displaying the problem information to a test user;
the problem information comprises identification information of a test data pair formed by target communication data and test data;
the test module is used for executing test operation matched with the test instruction when receiving the test instruction input by the test user to obtain a test result and displaying the test result to the test user;
the test data is the labeling data of the labeling type label output by the data recognition model, which is obtained by inputting the feedback data into a pre-trained data recognition model by the intermediate equipment; modifying the marked data according to the type label and a preset tampering rule to obtain the marked data;
the data identification model is obtained by training according to a plurality of training samples of communication data with data types labeled in advance;
modifying the marked data according to the type label and a preset tampering rule to obtain test data, wherein the modifying comprises the following steps:
determining the position of each data element and the data type of each data element from the feedback data; selecting a matched tampering rule according to the data type to respectively modify each data element, and taking the modified feedback data as test data matched with the feedback data;
wherein the tamper rule comprises at least one of: deleting a data object, assigning the data object to null, increasing or decreasing a numerical value, setting the numerical value to a positive or negative number, increasing or decreasing characters in a character string, negating a boolean value, and increasing or decreasing array elements within an array.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the test data communication method according to any of claims 1-2 or implements the test method according to any of claims 3 or 4 when executing the program.
9. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out a test data communication method according to any one of claims 1-2 or carries out a test method according to any one of claims 3 or 4.
CN201910325025.1A 2019-04-22 2019-04-22 Test data communication, test method, device, equipment and storage medium Active CN110069413B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910325025.1A CN110069413B (en) 2019-04-22 2019-04-22 Test data communication, test method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910325025.1A CN110069413B (en) 2019-04-22 2019-04-22 Test data communication, test method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110069413A CN110069413A (en) 2019-07-30
CN110069413B true CN110069413B (en) 2020-11-24

Family

ID=67368490

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910325025.1A Active CN110069413B (en) 2019-04-22 2019-04-22 Test data communication, test method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110069413B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110730107B (en) * 2019-09-02 2022-07-12 深圳壹账通智能科技有限公司 Test data generation method and device, computer equipment and storage medium
CN112115062A (en) * 2020-09-28 2020-12-22 海尔优家智能科技(北京)有限公司 Method and device for detecting attribute information, storage medium and electronic device
US11610001B2 (en) * 2021-02-23 2023-03-21 Infocyte, Inc. Computer system security scan and response
CN113419968B (en) * 2021-08-20 2022-03-25 北京达佳互联信息技术有限公司 Application testing method and device, electronic equipment and storage medium
CN114726577A (en) * 2022-03-02 2022-07-08 武汉天喻信息产业股份有限公司 Communication system for testing and data tampering method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105608381A (en) * 2015-12-18 2016-05-25 北京奇虎科技有限公司 Application test method and system
US10204035B1 (en) * 2017-08-07 2019-02-12 Appvance Inc. Systems, methods and devices for AI-driven automatic test generation
CN108268375B (en) * 2018-01-12 2021-04-30 深圳壹账通智能科技有限公司 Application program testing method and device, computer equipment and storage medium
CN109542781B (en) * 2018-11-14 2021-11-05 联动优势科技有限公司 Block chain consensus algorithm testing method and device, calculating device and storage medium
CN109634861B (en) * 2018-12-11 2022-06-21 网易(杭州)网络有限公司 Testing method, device, processor and terminal of network game protocol

Also Published As

Publication number Publication date
CN110069413A (en) 2019-07-30

Similar Documents

Publication Publication Date Title
CN110069413B (en) Test data communication, test method, device, equipment and storage medium
CN113987074A (en) Distributed service full-link monitoring method and device, electronic equipment and storage medium
CN111475370A (en) Operation and maintenance monitoring method, device and equipment based on data center and storage medium
CN111209166B (en) Automatic inspection system for B/S architecture service system
CN111061696B (en) Method and device for analyzing transaction message log
CN110659206A (en) Simulation architecture establishing method, device, medium and electronic equipment based on microservice
CN111309505B (en) Page exception handling method and device and electronic equipment
CN111858375A (en) Software testing method, device, electronic equipment and medium
CN113836014A (en) Interface testing method and device, electronic equipment and storage medium
WO2015067171A1 (en) Debug debug method and apparatus
CN111046393B (en) Vulnerability information uploading method and device, terminal equipment and storage medium
CN110489326B (en) IDS-based HTTPAPI debugging method device, medium and equipment
CN114553663B (en) Abnormality detection method, abnormality detection device, abnormality detection equipment and storage medium
CN107317723B (en) Data processing method and server
CN113852610B (en) Message processing method, device, computer equipment and storage medium
CN115203178A (en) Data quality inspection method and device, electronic equipment and storage medium
CN111741046B (en) Data reporting method, data acquisition method, device, equipment and medium
CN114416597A (en) Test case record generation method and device
CN114443480A (en) Test method, test system, readable medium and electronic device
CN111131369B (en) APP use condition transmission method and device, electronic equipment and storage medium
CN112631812A (en) Identification setting method and device, electronic equipment and storage medium
CN108108369B (en) Method and device for processing calling error of common interface library
CN112131611A (en) Data correctness verification method, device, equipment, system and storage medium
CN111258890A (en) Program test method, storage medium, and system
CN114978937B (en) Page data verification 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
CP02 Change in the address of a patent holder

Address after: 215000 17F, friendship time building, No. 68, Qitai Road, Suzhou Industrial Park, Suzhou area, China (Jiangsu) pilot Free Trade Zone, Suzhou, Jiangsu

Patentee after: SUZHOU YIGE NETWORK TECHNOLOGY Co.,Ltd.

Address before: Room 101, Building 22, No. 208, Tongyuan Road, Suzhou Industrial Park, Jiangsu Province 215006

Patentee before: SUZHOU YIGE NETWORK TECHNOLOGY Co.,Ltd.

CP02 Change in the address of a patent holder