Test method, device, storage medium and equipment

By displaying multiple protocol test plug-ins in the test page of the target test tool and testing based on the selected plug-ins, the problem that test tools in the existing technology can only deal with one protocol type, and efficient testing of data of multiple protocol types is achieved.

CN114721929BActive Publication Date: 2025-02-28TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110004641.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-04
Publication Date
2025-02-28
Estimated Expiration
2041-01-04

AI Technical Summary

Technical Problem

In the prior art, each test tool can only test data of one protocol type, resulting in the need to switch different test tools when testing test data of multiple protocol types, which is cumbersome and inefficient.

Method used

Provide a testing method and device. By displaying at least two protocol test plug-ins in the test page of the target testing tool, in response to the selection operation, the selected protocol test plug-in is determined as the target protocol test plug-in, the associated data to be tested and processed according to the target protocol test plug-in to generate test results.

Benefits of technology

It realizes testing of multiple protocol types of data in one target testing tool, improving testing efficiency, simplifying the testing process, and providing convenience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114721929B_ABST
    Figure CN114721929B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a test method, device, storage medium and equipment. The method includes: displaying at least two protocol test plug-ins in a test page corresponding to a target test tool, responding to a selection operation for at least two protocol test plug-ins, determining the protocol test plug-in determined by the selection operation as a target protocol test plug-in, and obtaining the data to be tested associated with the target protocol plug-in. According to the target protocol test plug-in, the data to be tested is tested and processed, and a test result corresponding to the data to be tested is generated. Through the present application, test data of multiple protocol types can be tested in the target test tool, thereby improving test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of testing technology, and in particular to a testing method, device, storage medium and equipment. Background Art

[0002] The test is mainly used to check the data exchange, transmission and control management process, as well as the mutual logical dependencies between systems, etc. Each test tool in the prior art can only test data of one protocol type. When testing test data of multiple protocol types, it is necessary to switch different test tools to test data of different protocol types. The test process is relatively cumbersome, resulting in low test efficiency. Summary of the invention

[0003] The technical problem to be solved by the embodiments of the present application is to provide a testing method, an apparatus, a storage medium and a device, which can test data of various protocol types in a target testing tool and improve the efficiency of the test.

[0004] An embodiment of the present application provides a testing method, including:

[0005] Displaying at least two protocol test plug-ins in a test page corresponding to a target test tool; the at least two protocol test plug-ins are used to test data of different protocol types;

[0006] In response to a selection operation for at least two protocol test plug-ins, the protocol test plug-in determined by the selection operation is determined as a target protocol test plug-in, and to-be-tested data associated with the target protocol plug-in is obtained;

[0007] According to the target protocol test plug-in, the test data is tested and processed to generate the test results corresponding to the test data.

[0008] Wherein, the target test tool includes a plug-in manager, and the above method further includes:

[0009] Obtain functional logic data packets corresponding to at least two protocol test plug-ins respectively;

[0010] According to the plug-in data type corresponding to the plug-in standard interface in the plug-in manager, the functional logic data packet is converted into a standard data packet that satisfies the plug-in data type;

[0011] The standard data packet is imported into the plug-in manager, and a target test tool including at least two protocol test plug-ins is generated according to the plug-in manager including the standard data packet.

[0012] The step of obtaining the test data associated with the target protocol plug-in includes:

[0013] In response to the test data editing operation in the test page, the original test data in the target test tool is displayed;

[0014] In response to a modification operation on the original test data, the original test data is updated to the modified original test data;

[0015] The modified original test data is stored in the target test tool, and the modified original test data is determined as the data to be tested.

[0016] The step of obtaining the test data associated with the target protocol plug-in includes:

[0017] Obtaining a target standard data packet associated with a target protocol plug-in in a target test tool;

[0018] Parse the target standard data packet to obtain the request parameter field and request parameter value range in the target standard data packet;

[0019] Generate a target request parameter associated with the request parameter field within the request parameter value range;

[0020] According to the historical test data corresponding to the target protocol plug-in, the target request parameter is corrected, and the corrected target request parameter is determined as the to-be-tested data associated with the target protocol plug-in.

[0021] Among them, according to the above-mentioned target protocol test plug-in, the test data is tested and processed to generate test results corresponding to the test data, including:

[0022] Encode the test data to generate a test package corresponding to the test data;

[0023] Obtaining a network address corresponding to the object under test, and sending a test packet to the network address corresponding to the object under test, so that the object under test generates a feedback data packet corresponding to the test packet according to the test packet;

[0024] Receive the feedback data packet returned by the object under test, decode the feedback data packet, and generate the test result corresponding to the data to be tested.

[0025] The above method further comprises:

[0026] In response to a trigger operation for adding an entry to a plug-in in a test page, a newly added protocol type determined by the trigger operation is obtained;

[0027] Obtain a new protocol test plug-in corresponding to the new protocol type, and perform data conversion on the new plug-in data packet corresponding to the new protocol test plug-in according to the data type corresponding to the standard interface in the plug-in manager to generate a new standard data packet;

[0028] The newly added standard data packet is imported into the plug-in manager of the target test tool, and the newly added protocol test plug-in successfully imported into the plug-in manager is added to the protocol test plug-in list; the protocol test plug-in list includes the protocol test plug-ins connected to the target test tool.

[0029] The method includes importing a standard data packet into a plug-in manager, and generating a target test tool including at least two protocol test plug-ins according to the plug-in manager including the standard data packet, including:

[0030] Encapsulate the standard data package into the above plug-in standard interface in the plug-in manager;

[0031] Parameter declaration information corresponding to at least two protocol test plug-ins is obtained, a plug-in registration function is called, and a standard data packet containing the parameter declaration information is registered in a plug-in manager to obtain a target test tool.

[0032] An embodiment of the present application provides a testing device, including:

[0033] A display module, which displays at least two protocol test plug-ins in a test page corresponding to a target test tool; the at least two protocol test plug-ins are used to test data of different protocol types;

[0034] A first acquisition module, configured to respond to a selection operation on at least two protocol test plug-ins, determine the protocol test plug-in determined by the selection operation as a target protocol test plug-in, and acquire to-be-tested data associated with the target protocol plug-in;

[0035] The test processing module is used to test the test data according to the target protocol test plug-in and generate test results corresponding to the test data.

[0036] Wherein, the target test tool includes a plug-in manager, and the above device also includes:

[0037] A second acquisition module is used to acquire functional logic data packets corresponding to at least two protocol test plug-ins respectively;

[0038] A conversion module, used to convert the functional logic data packet into a standard data packet satisfying the plug-in data type according to the plug-in data type corresponding to the plug-in standard interface in the plug-in manager;

[0039] The first generating module is used to import the standard data packet into the plug-in manager, and generate a target test tool including at least two protocol test plug-ins according to the plug-in manager including the standard data packet.

[0040] Wherein, the first acquisition module comprises:

[0041] A display unit, used to respond to the test data editing operation in the test page and display the original test data in the target test tool;

[0042] An updating unit, configured to respond to a modification operation on the original test data and update the original test data to the modified original test data;

[0043] The first determining unit is used to store the modified original test data in the target test tool, and determine the modified original test data as the data to be tested.

[0044] The first acquisition module further includes:

[0045] A first acquisition unit, configured to acquire a target standard data packet associated with a target protocol plug-in in a target test tool;

[0046] A parsing unit, used to parse the target standard data packet to obtain the request parameter field and the request parameter value range in the target standard data packet;

[0047] A first generating unit, configured to generate a target request parameter associated with a request parameter field within a request parameter value range;

[0048] The correction unit is used to correct the target request parameter according to the historical test data corresponding to the target protocol plug-in, and determine the corrected target request parameter as the to-be-tested data associated with the target protocol plug-in.

[0049] The test processing module includes:

[0050] The second generating unit is used to encode the test data and generate a test package corresponding to the test data;

[0051] The sending unit is used to obtain the network address corresponding to the object under test, and send the test packet to the network address corresponding to the object under test, so that the object under test generates a feedback data packet corresponding to the test packet according to the test packet;

[0052] The third generating unit is used to receive the feedback data packet returned by the object under test, decode the feedback data packet, and generate the test result corresponding to the data to be tested.

[0053] The above device further comprises:

[0054] A third acquisition module is used to respond to the trigger operation of adding an entry to the plug-in in the test page, and obtain the newly added protocol type determined by the trigger operation;

[0055] The second generation module is used to obtain a new protocol test plug-in corresponding to the new protocol type, and perform data conversion on the new plug-in data packet corresponding to the new protocol test plug-in according to the data type corresponding to the standard interface in the plug-in manager to generate a new standard data packet;

[0056] An adding module is used to import newly added standard data packets into the plug-in manager of the target test tool, and add the newly added protocol test plug-ins successfully imported into the plug-in manager to the protocol test plug-in list; the protocol test plug-in list includes the protocol test plug-ins connected to the target test tool.

[0057] Wherein, the above-mentioned first generation module includes:

[0058] An encapsulation unit, used for encapsulating a standard data packet into a plug-in standard interface in the plug-in manager;

[0059] The registration unit is used to obtain parameter declaration information corresponding to at least two protocol test plug-ins, call the plug-in registration function, register the standard data packet containing the parameter declaration information in the plug-in manager, and obtain the target test tool.

[0060] On one hand, the present application provides a computer device, including: a processor and a memory;

[0061] The memory is used to store the computer program, and the processor is used to call the computer program to perform the following steps:

[0062] Displaying at least two protocol test plug-ins in a test page corresponding to a target test tool; the at least two protocol test plug-ins are used to test data of different protocol types;

[0063] In response to a selection operation for at least two protocol test plug-ins, the protocol test plug-in determined by the selection operation is determined as a target protocol test plug-in, and to-be-tested data associated with the target protocol plug-in is obtained;

[0064] According to the target protocol test plug-in, the test data is tested and processed to generate the test results corresponding to the test data.

[0065] In one aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the following steps are performed:

[0066] Displaying at least two protocol test plug-ins in a test page corresponding to a target test tool; the at least two protocol test plug-ins are used to test data of different protocol types;

[0067] In response to a selection operation for at least two protocol test plug-ins, the protocol test plug-in determined by the selection operation is determined as a target protocol test plug-in, and to-be-tested data associated with the target protocol plug-in is obtained;

[0068] According to the target protocol test plug-in, the test data is tested and processed to generate the test results corresponding to the test data.

[0069] In the embodiment of the present application, at least two protocol test plug-ins are displayed in the test page corresponding to the target test tool, at least two protocol test plug-ins are used to test data of different protocol types, and in response to the selection operation for at least two protocol test plug-ins, the protocol test plug-in determined by the selection operation is determined as the target protocol test plug-in, and the data to be tested associated with the target protocol plug-in is obtained. According to the target protocol test plug-in, the data to be tested is tested and processed, and the test results corresponding to the data to be tested are generated. It can be seen that the target test tool provided by the embodiment of the present application can test data of multiple protocol types, that is, the target protocol test plug-in can be selected in the test page corresponding to the target test tool to test the corresponding data to be tested, without switching the test tools of multiple different protocol types, which provides the convenience of business developers. Through the present application, data of different protocol types can be tested in the target test tool, and then the test efficiency can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0071] Figure 1 It is a schematic diagram of the architecture of a test system provided in an embodiment of the present application;

[0072] Figure 2 It is a flow chart of a testing method provided in an embodiment of the present application;

[0073] Figure 3 It is a schematic diagram of calling a target protocol test plug-in for testing provided by an embodiment of the present application;

[0074] Figure 4 is a schematic diagram of a test page corresponding to a target test tool provided in an embodiment of the present application;

[0075] Figure 5 It is a flowchart of a method for obtaining data to be tested provided in an embodiment of the present application;

[0076] Figure 6 is a schematic diagram of a method for obtaining data to be tested provided in an embodiment of the present application;

[0077] Figure 7 It is a flow chart of a testing method provided by the present application;

[0078] Figure 8 is a schematic diagram of a target test generating tool provided in an embodiment of the present application;

[0079] Fig. 9 is a schematic diagram of a method for importing a standard data packet into a plug-in manager provided by an embodiment of the present application;

[0080] Fig.10 It is a structural diagram of a functional component architecture provided by an embodiment of the present application;

[0081] Fig.11 is a schematic diagram of a data testing method using a target testing tool provided in an embodiment of the present application;

[0082] Fig.12 is a structural schematic diagram of a testing device provided in an embodiment of the present application;

[0083] Fig.13 It is a structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0084] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0085] See also Figure 1 , Figure 1 Schematic diagram of a test system provided in an embodiment of the present application. Figure 1 As shown, the test system may include a server 10 and a user terminal cluster. The user terminal cluster may include one or more user terminals, and the number of user terminals is not limited here. Figure 1 As shown, it may specifically include user terminal 100a, user terminal 100b, user terminal 100c, ..., user terminal 100n. Figure 1 As shown, the user terminal 100a, the user terminal 100b, the user terminal 100c, ..., the user terminal 100n can respectively establish a network connection with the server 10, so that each user terminal can exchange data with the server 10 through the network connection.

[0086] Each user terminal in the user terminal cluster may include: a smart phone, a tablet computer, a laptop computer, a desktop computer, a wearable device, a smart home, a head-mounted device, and other smart terminals with business data processing functions. Figure 1 Each user terminal in the user terminal cluster shown in FIG. 1 may be installed with a target application (i.e., an application client). When the application client runs in each user terminal, it may be respectively connected to the above-mentioned Figure 1 The servers 10 shown here interact with each other.

[0087] Among them, Figure 1 As shown, the server 10 can be used to test the test data according to the target protocol test plug-in to generate the test results corresponding to the test data. The server 10 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0088] For ease of understanding, the embodiments of the present application can be Figure 1 Select one user terminal from the multiple user terminals shown as the target user terminal. For example, the embodiment of the present application can Figure 1 The user terminal 100a shown is used as a target user terminal, and a target application (i.e., an application client) having the business data processing function can be integrated in the target user terminal. At this time, the target user terminal can realize data interaction with the server 10 through the business data platform corresponding to the application client. For example, the target user terminal can display at least two protocol test plug-ins in the test page corresponding to the target test tool, and respond to the selection operation for at least two protocol test plug-ins, determine the protocol test plug-in determined by the selection operation as the target protocol test plug-in, obtain the data to be tested associated with the target protocol plug-in, send the target protocol test plug-in and the data to be tested to the server 10, and the server 10 can perform test processing on the data to be tested according to the target protocol test plug-in, generate a test result corresponding to the data to be tested, and send the test result to the target user terminal.

[0089] See also Figure 2 , Figure 2 is a flow chart of a test method provided by an embodiment of the present application. The method can be executed by a computer device, which can be a server (such as the above-mentioned Figure 1 Server 11 in the example above) or user terminal (as described above) Figure 1Any user terminal in a user terminal cluster), or a system consisting of a server and a user terminal, which is not limited in this application. Figure 2 As shown, the testing method may include steps S101-S103.

[0090] S101, displaying at least two protocol test plug-ins in a test page corresponding to a target test tool.

[0091] Specifically, when a business developer needs to test a target object, it is necessary to determine whether the target object meets the corresponding functionality and security. At this time, the business developer can start the target test tool to test the target object. When there is no problem with the test result of the target object, it can be determined that the target object meets the functionality and security; when there is a problem with the test result of the target object, it can be determined that the target object does not meet the functionality and security. When the business developer starts the target test tool in the computer device, the computer device can respond to the start operation of the target test tool and display the test page corresponding to the target test tool in the terminal screen of the computer device. Among them, the target test tool can include at least two protocol test plug-ins, and different protocol test plug-ins can be used to test data of different protocol types, that is, the target test tool has the function of testing data corresponding to at least two protocol types. In other words, at least two protocol test plug-ins can be displayed in the test side of the target test tool, so that the business developer can select the required protocol test plug-in in the test page corresponding to the target test tool, thereby improving the efficiency of the test.

[0092] Among them, the protocol test plug-in can refer to an interface testing tool, such as an interface testing tool corresponding to the Grpc protocol type (a communication protocol for client and server communication), an interface testing tool corresponding to the Trpc protocol type (a remote call protocol), an interface testing tool corresponding to the Qza protocol type (a communication protocol), etc. Among them, the interface testing tool corresponding to the Grpc protocol type is a high-performance, general open source RPC (a remote call type of inter-process communication) framework, and the interface testing tool corresponding to the Trpc protocol type is the Trpc general client interface testing tool, which can read the user's input in the command line parameters, and then test, and can also read the corresponding JSON format (a data exchange format) test data for testing and result assertion. The interface testing tool corresponding to the Qza protocol type is similar to the interface testing tool corresponding to the Trpc protocol type, and can read the user's input in the command line, and then initiate a test on the service of the Qza protocol, and can also read the corresponding JSON format test data for testing and result assertion. It should be noted that the target testing tool in the embodiment of the present application may also include other testing tools, such as a mock tool (a testing tool that uses virtual objects to create testing), a data generation tool, etc. As long as the plug-in data type corresponding to the standard interface in the plug-in manager in the embodiment of the present application is implemented, it can be connected to the target testing tool and used in the target testing tool, which can improve the applicability of the target testing tool.

[0093] S102, in response to a selection operation on at least two protocol test plug-ins, determining the protocol test plug-in determined by the selection operation as a target protocol test plug-in, and acquiring to-be-tested data associated with the target protocol plug-in.

[0094] Specifically, when the user selects the required protocol test plug-in from at least two protocol test plug-ins displayed on the test page corresponding to the target test tool, the computer device can respond to the selection operation for at least two protocol test plug-ins, determine the protocol test plug-in determined by the user's corresponding selection operation as the target protocol test plug-in, and obtain the data to be tested associated with the target protocol test plug-in. The data to be tested can be the original test data in the target test tool, or can be the test data randomly generated in the target test tool, or can be the test data modified and adjusted according to actual needs to the original test data or the randomly generated test data.

[0095] Optionally, when the data to be tested is the original test data provided in the target test tool, after the protocol test plug-in determined by the user's corresponding selection operation is determined as the target protocol test plug-in, the target standard data packet corresponding to the target test plug-in is called from the target test tool. At least two protocol test plug-ins connected to the target test tool have corresponding standard data packets (i.e., functional logic data packets) for implementing the target protocol test plug-in to test the associated test data. The target standard data packet is parsed to obtain the existing test cases in the target standard data packet, and the existing test cases are directly determined as the data to be tested associated with the target protocol plug-in.

[0096] Optionally, when the data to be tested is test data randomly generated in the target test tool (i.e., test data automatically generated in the target test tool), the computing device can obtain the target standard data packet associated with the target protocol plug-in in the target test tool, parse the target standard data packet, and obtain the request parameter field and the request parameter value range in the target standard data packet. Generate a target request parameter associated with the request parameter field within the request parameter value range, modify the target request parameter according to the historical test data corresponding to the target protocol plug-in, and determine the modified target request parameter as the data to be tested associated with the target protocol plug-in.

[0097] Specifically, after the protocol test plug-in determined by the user's corresponding selection operation is determined as the target protocol test plug-in, the target standard data packet associated with the target protocol plug-in can be obtained from the target test tool. The computer device can parse the target standard data packet to obtain the interface information in the standard data packet corresponding to the target protocol test plug-in, and the interface information includes relevant information of the request parameter, such as the request parameter field (i.e., the request parameter identifier) ​​and the request parameter value range information. The target request parameter associated with the request parameter field is generated within the request parameter value range, that is, the target request parameter associated with the request parameter field is randomly generated within the request parameter value range corresponding to each request parameter field. At the same time, the target request parameter can be corrected and supplemented according to the historical test data corresponding to the target protocol test plug-in (the historical test data here can be understood as the data that has been tested in the target protocol plug-in), and the corrected and supplemented target request parameter is determined as the data to be tested associated with the target protocol plug-in, which can provide the accuracy of the target request parameter. Since the request parameter fields are numerous and complex, it is time-consuming and laborious for business developers to fill them out one by one, and users sometimes do not know what to fill in. Therefore, the test data corresponding to the target protocol test plug-in can be automatically generated in the target test tool, saving the time spent by business developers on testing and improving testing efficiency.

[0098] S103, performing test processing on the data to be tested according to the target protocol test plug-in, and generating test results corresponding to the data to be tested.

[0099] Specifically, after determining the target protocol test plug-in and obtaining the data to be tested associated with the target protocol test plug-in, the computer device can call the target protocol test plug-in in the target test tool, perform test processing on the data to be tested, and generate test results corresponding to the data to be tested. Among them, the target protocol test plug-in can be a protocol test plug-in used to process the above-mentioned data to be tested in at least two protocol test plug-ins. In the embodiment of the present application, the target protocol test plug-in is determined in the target test tool, the data to be tested associated with the target protocol test plug-in is tested and processed, and the test results corresponding to the data to be tested are generated, without converting to the protocol test tool corresponding to the different protocol types, thereby improving the efficiency of the test.

[0100] Optionally, the computer device may also store the standard data packets corresponding to each protocol test plug-in in the cloud server, and store the address information of the cloud server in the local database. When the target test tool needs to call the standard data packet corresponding to the target protocol test plug-in, the standard data packet corresponding to the target protocol test plug-in can be obtained through the address information of the corresponding cloud server. Optionally, the computer device may store the standard data packets corresponding to each protocol test plug-in in the local database. When calling the target protocol test plug-in in the target test tool to test the test data, the standard data packet corresponding to the target protocol test plug-in can be called from the local database, and the test data can be tested according to the standard data packet corresponding to the target protocol test plug-in. For example, when a business developer is in the development stage and it is inconvenient to upload the standard data corresponding to each protocol test plug-in to the cloud server, the standard data packets corresponding to each protocol test plug-in can be stored in the local database of the computer device.

[0101] Optionally, the specific process of testing the test data may include: the computer device may call the target protocol test tool in the target test tool, encode the test data in the target protocol test plug-in, and generate a test packet corresponding to the test data. Obtain the network address corresponding to the object under test, send the test packet to the network address corresponding to the object under test, so that the object under test generates a feedback data packet corresponding to the test packet according to the test packet, receive the feedback data packet returned by the object under test, decode the feedback data packet, and generate a test result corresponding to the data under test.

[0102] Specifically, when the computer device calls the standard data packet corresponding to the target protocol test plug-in to test the data to be tested, it can encode the data to be tested and generate a test packet corresponding to the data to be tested. The network address corresponding to the object to be tested is obtained, and the test packet is sent to the network address corresponding to the object to be tested. The test packet can be parsed in the network address to obtain the data to be tested contained in the test packet, and the object to be tested is tested according to the data to be tested to generate the test result data corresponding to the object to be tested. The test result data can be encapsulated in the network address to obtain a feedback data packet, and the object to be tested returns the feedback data packet to the computer device. When the computer device receives the feedback data packet returned by the object to be tested, it can decode the feedback data packet and generate the test result corresponding to the data to be tested. Among them, the object to be tested refers to the object to be tested. For example, when performing an interface test corresponding to the switch of a lighting lamp, the corresponding lighting lamp is the object to be tested.

[0103] For details, refer to the specific test process of calling the target protocol test plug-in to test the test data. Figure 3 ,like Figure 3 As shown, Figure 3 A schematic diagram of calling a target protocol test plug-in for testing provided in an embodiment of the present application, such as Figure 3As shown, the target protocol test plug-in includes a parsing module, an encoding module, a decoding module, an assertion verification module, an output module, etc. Among them, the parsing module is used to parse the protocol file (i.e., standard data packet) corresponding to the target protocol test plug-in, and the interface information (including interface name, request parameter structure, response structure, etc.) in the protocol file can be parsed. After obtaining the interface information in the protocol file, the interface information in the protocol file can be automatically organized into test code with a fixed template, such as Json (JavaScript Object Notation, JS object notation, a computer programming language) code, Python (a computer programming language) code, golang (a static strong type, compiled language) code, that is, automatically generate test code information. At the same time, the test data is parsed to obtain test case information, including case name, tested interface name, test request data, assertion rules, etc. The encoding module is used to encode the request parameter data of the test case in the test data, and encapsulate the test code information such as the request target address and interface name to obtain the test package corresponding to the test data, and send the test package to the object under test, so that the object under test is tested according to the test package to obtain a feedback data packet. The decoding module is used to decode the feedback data packet returned by the object under test to obtain specific response data. The assertion check is used to perform assertion check on the feedback data packet returned by the object under test, that is, to check the data in the feedback data packet and generate a test result. The output module is used to output the obtained test results, as well as the request body or response body. After determining the target protocol test plug-in corresponding to the target protocol type, the standard data packet corresponding to the target protocol test plug-in, that is, the functional logic data packet corresponding to the target protocol test plug-in, and the data to be tested are called. The standard data packet corresponding to the target protocol test plug-in and the data to be tested are parsed, and then the encoding module is used to encode, and the test packet obtained after parsing and encoding is sent to the object under test, so that the object under test generates a feedback data packet according to the test packet. After receiving the feedback data packet returned by the object under test, the decoding module is used to decode the feedback data packet, and the assertion check module is used to perform assertion check on the decoded feedback data packet to obtain the test result and the request body or response body. Finally, the output module outputs the obtained test result (successful or unsuccessful) and the request body or response body.

[0104] Specifically, Figure 4 As shown, Figure 4 A schematic diagram of a test page corresponding to a target test tool provided in an embodiment of the present application, such as Figure 4As shown, after starting the target test tool, the protocol test tools corresponding to the various protocol types currently connected to the target test tool will be displayed on the left side of the test page corresponding to the target test tool, as well as the plug-in addition entry for adding new protocol test plug-ins. The right side provides the protocol test plug-ins for adding the corresponding protocol type to the target test tool, that is, the protocol test plug-ins that can be used when each protocol test tool is connected to the target test tool, such as protocol test plug-in 1 for adding protocol test tool 1 to the target test tool. The right side also provides the command line parameters corresponding to protocol test plug-in 1. When protocol test plug-in 1 is registered in the target test tool, the command line parameters corresponding to protocol test plug-in 1 can be defined by yourself. A window for searching specific parameters in the command line parameters is also set. You can enter parameter identification information in this window to find the specific parameters you need. When you need to add a configuration, you can obtain the corresponding configuration information through the Get Configuration interface. Click the Send touch key to complete the configuration addition operation, or click the Remove Configuration touch key to remove the configuration that needs to be removed.

[0105] In the embodiment of the present application, at least two protocol test plug-ins are displayed in the test page corresponding to the target test tool, and the selection operation for at least two protocol test plug-ins is responded to, and the protocol test plug-in determined by the selection operation is determined as the target protocol test plug-in, and the data to be tested associated with the target protocol plug-in is obtained. According to the target protocol test plug-in, the test data to be tested is tested and processed, and the test results corresponding to the data to be tested are generated. In this way, the target test tool can be used to test data of multiple protocol types, that is, the corresponding protocol test plug-in is called in the target test tool to test the data of the corresponding protocol type without switching multiple test tools of different protocol types, which provides convenience for business developers. Through this application, data of different protocol types can be tested, the test efficiency and the accuracy of the test results can be improved. In addition, the embodiment of the present application provides a test page corresponding to the target test tool by visualizing the target test tool. The business developer can test on the test page corresponding to the target test tool by filling in the corresponding value of the response in the corresponding parameter to obtain the test result, avoiding low-level errors such as missing parameters and wrong name input, and improving the accuracy and efficiency of the test. At the same time, it also avoids the situation where the input of parameters increases the cost of data testing for business development when there are many parameters. Business developers may also fail to remember the specific command parameter instructions, which leads to frequent errors in the use of tools and less accurate test results.

[0106] Furthermore, if Figure 5 As shown, Figure 5 A flow chart of a method for obtaining test data provided in an embodiment of the present application is provided. The embodiment of the present application is a flow chart of a method for obtaining test data provided in an embodiment of the present application. Figure 2Further description of step S101 in the corresponding embodiment. Figure 5 As shown, the process of acquiring the data to be tested can be implemented through the following steps S21-S23.

[0107] S21, in response to the test data editing operation in the test page, displaying the original test data in the target test tool.

[0108] Specifically, when the data to be tested is the modified original test data, the business developer can edit the original test data in the target test tool or the data to be tested corresponding to the target protocol test plug-in automatically generated by the target test tool, that is, trigger the operation of editing the original test data in the test page corresponding to the target test tool. The computer device in this embodiment can respond to the test data editing operation in the target test tool and display the original test data in the target test tool on the test page, so that the business developer can modify the original test data that needs to be modified.

[0109] S22, in response to the modification operation on the original test data, updating the original test data to the modified original test data.

[0110] S23, storing the modified original test data in the target test tool, and determining the modified original test data as the data to be tested.

[0111] After the computer device displays the original test data in the target test tool on the test page, the business developer can edit the original test data and change the numerical value corresponding to the original test data. After the business developer changes the original test data and clicks the save touch key, the computer device in the embodiment of the present application can respond to the modification operation on the original test data and update the original test data to the modified original test data. And store the modified original test data in the target test tool, and determine the modified original data as the data to be tested. For example, in the test page corresponding to the target test tool, fill in the specific response value in the corresponding parameter, and you can get the data to be tested. After the data to be tested corresponding to the target protocol test plug-in is automatically generated in the target test tool, the business developer can also modify the automatically generated data to be tested corresponding to the target protocol test plug-in according to specific needs.

[0112] Optionally, when the data to be tested is test data obtained by editing the data to be tested corresponding to the target protocol test plug-in automatically generated in the target test tool by the user, when the computer device receives an editing instruction from a business developer to edit the original test data corresponding to the target protocol test plug-in (i.e., the data to be tested automatically generated in advance), in response to the editing operation on the data to be tested automatically generated corresponding to the target protocol test plug-in, the business developer can modify the original test data (i.e., the data to be tested automatically generated in advance) in the test page corresponding to the target test tool according to actual needs, and use the modified original test data as the data to be tested.

[0113] like Figure 6 As shown, Figure 6 A schematic diagram of a method for obtaining test data provided in an embodiment of the present application, such as Figure 6 As shown, when the business developer selects the original test data that needs to be modified by the target protocol test plug-in in the target test tool, that is, the target parameter c4, it can be determined whether the target parameter c4 can be edited, such as Figure 6 As shown, the target parameter c4 can be edited. Click the edit touch key corresponding to the target parameter c4 to see the specific parameter information in the target parameter c4, and edit the specific parameter information. After editing, click Save to save. For example, the specific parameters of the target parameter c4 show that the name of the test instance in the current protocol test plug-in is "Hello", the protocol type is "Trpc (a kind of inter-process communication protocol)", and the cost of running is "5000", etc. In the test page corresponding to the target test tool, you can fill in the value to be modified in the specific parameter information, and click Send to get the test result. The target test tool will display the obtained test results in the corresponding window for business developers to view. At the same time, the computer device will store the test cases obtained after the business developers edit the original data for subsequent use. By testing on the test page corresponding to the target test tool, and only filling in the corresponding parameter with the corresponding value to test and get the test result, low-level errors such as missing parameters and wrong names are avoided, and the accuracy and efficiency of the test are improved. At the same time, it also avoids the situation where the input of parameters increases the cost of data testing for business development when there are many parameters. Business developers may also fail to remember the specific command parameter instructions, which leads to frequent errors in the use of tools and less accurate test results.

[0114] In the embodiment of the present application, the original test data in the target test tool can be displayed by responding to the test data editing operation in the target test tool, and the original test data can be updated to the modified original test data in response to the modification operation on the original test data. The modified original test data is stored in the target test tool, and the modified original test data is determined as the data to be tested, so that the business developer can modify the original test data in the target test tool in the test page corresponding to the target test tool to obtain the data to be tested without rewriting the test data, which can improve the convenience and efficiency of data testing.

[0115] like Figure 7 As shown, Figure 7 A schematic diagram of a test method provided in an embodiment of the present application, the method can be executed by a computer device, the method can be executed by a computer device, and the computer device can be a server (such as the above Figure 1 Server 11 in the example above) or user terminal (as described above) Figure 1 Any user terminal in a user terminal cluster), or a system consisting of a server and a user terminal, which is not limited in this application. Figure 7 The steps of the test method include S201-206.

[0116] S201, obtaining functional logic data packets corresponding to at least two protocol test plug-ins respectively.

[0117] Specifically, the computer device may obtain functional logic data packets corresponding to at least two protocol test plug-ins respectively, and the functional logic data packets include code information required for the protocol test plug-in to perform data testing, that is, the protocol files corresponding to each protocol test plug-in.

[0118] S202: According to the plug-in data type corresponding to the plug-in standard interface in the plug-in manager, convert the functional logic data packet into a standard data packet that satisfies the plug-in data type.

[0119] Specifically, after the computer device obtains the functional logic data packets corresponding to at least two protocol test plug-ins, the functional logic data packets can be converted into standard data packets that meet the plug-in data type according to the plug-in data type corresponding to the plug-in standard interface in the plug-in manager. The plug-in manager defines a set of plug-in standard interfaces, and through the plug-in data types corresponding to the plug-in standard interfaces, the functional logic data packets corresponding to the multiple protocol test plug-ins are converted into standard data packets that meet the plug-in data types corresponding to the plug-in standard interfaces.

[0120] S203, importing the standard data packet into the plug-in manager, and generating a target test tool including at least two protocol test plug-ins according to the plug-in manager including the standard data packet.

[0121] Specifically, after obtaining the standard data packets corresponding to each protocol test plug-in, the computer device can import the standard data packets corresponding to each protocol test plug-in into the plug-in manager to generate a target test tool containing at least two protocol test plug-ins. The target test tool can be used to test data of multiple protocol types, so that business developers can test data of multiple protocol types on one test tool without switching multiple test tools of different protocol types, which provides convenience for business developers.

[0122] like Figure 8 As shown, Figure 8 A schematic diagram of a target test tool for generating a target test provided in an embodiment of the present application is shown in FIG. Figure 8As shown, the target test tool mainly includes three parts: functional component architecture, protocol test plug-ins of various protocol types, and test pages. Among them, a plug-in manager is abstracted in the functional component architecture, and the plug-in manager defines a set of standard plug-in interfaces. After each protocol test plug-in implements the plug-in standard interface, it can be registered and connected to the plug-in manager, so that the target test tool has the test capabilities of each protocol test plug-in. At the same time, a network server (webserver) is also created in the functional component architecture to provide access paths (i.e., http interfaces) corresponding to each protocol test plug-in in the target test tool, and interact with the test page of the front end, that is, in the test page, through the access paths corresponding to each protocol test plug-in, the corresponding protocol test plug-in can be called. Among them, the access paths corresponding to at least two protocol types can refer to http (HyperText Transfer Protocol, Hypertext Transfer Protocol) interfaces, which are based on TCP (Transmission Control Protocol, Transmission Control Protocol) protocols. When the target protocol type is determined, a connection channel to the server in the target test tool will be established through TCP, and the target protocol test plug-in in the target test tool can be tested through the http interface. The test page (i.e., web interface) is the front end of the target test tool, and communicates with the back end of the target test tool through the access paths corresponding to the various protocol test plug-ins provided by the target test tool. In the test page, users can visually select various protocol test plug-ins, load the standard data packets corresponding to each protocol test plug-in, edit the original test data in the target test tool, send test requests, view test results and other functions. Different protocol test plug-ins can perform decoding / encoding, packet sending / receiving, assertion and other tests on the data to be tested of the associated protocol type. In this way, the target test tool can be used to test data of multiple protocol types, that is, call various protocol types to test the associated protocol test plug-ins, without switching different protocol test tools to test data of different protocol types, thereby improving the efficiency and convenience of the test. In addition, the newly added protocol test tool in the target test tool can be connected to the target test tool as long as the defined plug-in standard interface is implemented, which greatly reduces the access cost and improves the convenience of testing for business developers.

[0123] Optionally, in the process of generating a target test tool including at least two protocol test plug-ins, the computer device may encapsulate a standard data packet into a plug-in standard interface in a plug-in manager, obtain parameter declaration information corresponding to at least two protocol test plug-ins, call a plug-in registration function, and register the standard data packet containing the parameter declaration information in the plug-in manager to obtain the target test tool.

[0124] Specifically, a plug-in standard interface is defined in the plug-in manager, and multiple protocol test plug-ins convert the corresponding functional logic data packet into a standard data packet that meets the plug-in data type according to the plug-in data type corresponding to the plug-in standard interface, and encapsulate the standard data packet into the plug-in standard interface in the plug-in manager. At the same time, the parameter declaration information corresponding to each protocol test plug-in in at least two protocol test plug-ins is obtained, such as the parameters required for each protocol test plug-in, and whether the required parameters are required (can be defined with the IsRequired function), and whether they can be edited (can be defined with the NeedLoad function). The plug-in registration function is called to register the standard data packet containing the parameter declaration information, that is, to register each protocol test plug-in to obtain the target test tool. In this way, the parameter information corresponding to at least two protocol test plug-ins can be displayed in the test page corresponding to the target test tool, so that users can view the parameters in each protocol test plug-in, and improve the convenience of business developers in performing data testing.

[0125] Wherein, when registering a standard data packet containing parameter declaration information, a plug-in standard interface corresponding to each protocol test plug-in in multiple protocol test plug-ins can be created according to the plug-in base class in the target test data, and the plug-in standard interface corresponding to each protocol test plug-in instantiates the corresponding standard data packet, obtains the protocol test plug-in instance corresponding to the corresponding plug-in standard interface (i.e., the object corresponding to the protocol test plug-in), and defines the parameter declaration information required in each protocol test plug-in instance. And register the protocol test plug-in instance defining the parameter declaration information in the plug-in manager to obtain the target test tool. Wherein, when each protocol test plug-in in at least two protocol test plug-ins implements the protocol test plug-in instance of the corresponding plug-in standard interface, the reading path of the configuration file corresponding to each protocol test plug-in can be added to the specific test processing logic layer, so that when performing data testing, the corresponding configuration file is obtained through the reading path in the specific test processing logic layer for data testing, and the parameter declaration information required for each protocol test plug-in to implement data testing is defined. When it is necessary to read the configuration file of the protocol test plug-in, it can be implemented by the WithConfig function (a kind of adding configuration function). Specifically, the corresponding functional logic data packet can be converted into a standard data packet that meets the plug-in standard interface corresponding to each protocol test tool through the run function (a kind of providing a message loop function for the test page thread). If the result of the assignment needs to be corrected in the process of implementing the standard data packet corresponding to each protocol test plug-in through the run function, it can be implemented through the GetString function (a function that obtains the value of the current specified column of an object) and the GetByte function (a function that converts a string into bytes). Among them, when the test page corresponding to the target test tool is generated through the network server, the parameter names of each protocol test plug-in that needs to be displayed in the test page should be consistent with the parameter names in the standard data packet corresponding to each protocol test plug-in.

[0126] like Fig. 9 As shown, Fig. 9 A schematic diagram of a method for importing a standard data package into a plug-in manager provided in an embodiment of the present application, such as Fig. 9As shown, when the standard data packet containing parameter declaration information is registered in the plug-in manager, the initialization function (init function) can be called through the go runtime mechanism for initialization processing, and then the registration (Register) function is called. According to the plug-in standard interface defined by the plug-in manager, each protocol test plug-in instance is registered in the plug-in manager of the plug-in manager, and a global storage manager storing multiple protocol test plug-ins is obtained. According to the network server, the logical functions in the global storage manager are visualized and the target test tool is generated, so that various business processing of the target test tool can be realized, such as obtaining all protocol test plug-ins, running to obtain test results, and so on.

[0127] Among them, Fig.10 As shown, Fig.10 A schematic diagram of a functional component architecture provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the functional component architecture includes an API (application programming interface) interface layer, a logic layer, a plug-in abstraction layer, and a plug-in implementation layer. Among them, the API interface layer in the functional component architecture is provided with an acquisition interface and a modification interface for the configuration corresponding to each protocol test plug-in, through which the configuration in each protocol test plug-in can be acquired and modified. The API interface layer is also provided with an acquisition interface and a modification interface for the data in the standard data packet corresponding to each protocol test plug-in, through which the data acquisition interface and the modification interface can be used to acquire and modify the data in each protocol test plug-in. The API interface layer is also provided with a call interface corresponding to each protocol test plug-in and a parameter acquisition interface corresponding to each protocol test plug-in, as well as an interface for interacting with front-end static resources. The logic layer in the functional component architecture implements the business logic processing of each interface in the API interface layer. The plug-in abstraction layer in the functional component architecture stores the standard data packets corresponding to each protocol test plug-in, and manages and stores configurations and files (i.e., the standard data packets corresponding to each protocol test plug-in). The plug-in implementation layer in the functional component architecture is used to define the plug-in standard interface corresponding to each protocol test plug-in and the registration of each protocol test plug-in. For example, define the plug-in standard interface corresponding to protocol test plug-in A, the plug-in standard interface corresponding to protocol test plug-in B, the plug-in standard interface corresponding to protocol test plug-in C, and the plug-in standard interface corresponding to protocol test plug-in D.

[0128] Optionally, after generating the target test tool, a new protocol test plug-in can also be added to the target test tool, such as setting a plug-in addition entry in the visual test page corresponding to the target test tool. When the business developer performs a trigger operation on the plug-in addition entry, the computer device can respond to the trigger operation on the plug-in addition entry in the test page, and obtain the new protocol type determined by the trigger operation. Obtain the new protocol test plug-in corresponding to the new protocol type, and perform data conversion on the new plug-in data packet corresponding to the new protocol test plug-in according to the data type corresponding to the standard interface in the plug-in manager to generate a new standard data packet. Import the new standard data packet into the plug-in manager of the target test tool, and add the new protocol test plug-in successfully imported into the plug-in manager to the protocol test plug-in list. The protocol test plug-in list includes the protocol test plug-ins connected to the target test tool.

[0129] If the business developer needs to add a new protocol test plug-in to the target test tool, the plug-in addition entry corresponding to the target test tool can be triggered. The computer device in the embodiment of the present application can respond to the trigger operation for adding a plug-in entry in the target test tool, and obtain the new protocol type determined by the trigger operation. And obtain the new protocol test plug-in corresponding to the new protocol type, and perform data conversion on the new plug-in data packet corresponding to the new protocol test plug-in according to the data type corresponding to the standard interface in the plug-in manager to generate a new standard data packet. The new standard data packet is imported into the plug-in manager of the target test tool, and the new protocol test plug-in successfully imported into the plug-in manager is added to the protocol test plug-in list, which includes the protocol test plug-ins connected to the target test tool. Among them, after responding to the trigger operation for adding a plug-in entry in the target test tool, it is displayed as follows Figure 4 In the interface shown, business developers can Figure 4 The plug-in addition entry on the right side of the interface is used to add a new protocol test plug-in corresponding to the new protocol type.

[0130] Optionally, if a business developer wants to view which protocol test plug-ins are currently added to the target test tool, the plug-in information acquisition interface in the test page corresponding to the target test tool can be triggered. The computer device in the embodiment of the present application can respond to the trigger operation for viewing the plug-in information in the target test tool, obtain at least two protocol test plug-ins in the currently accessed target test tool, and obtain the parameter information and protocol type information corresponding to the at least two protocol test plug-ins of the currently accessed target test tool, and display the at least two protocol test plug-ins of the currently accessed target test tool and the corresponding parameter information and protocol type information, so that the business developer can clearly know the testing capabilities of the protocol test plug-ins of which protocol types the current target test tool has.

[0131] Optionally, the business developer wants to obtain the target protocol test plug-in corresponding to the target protocol type, and the target protocol test plug-in refers to the target protocol test plug-in that the business developer wants to use to test the data. Then, the trigger operation of the plug-in acquisition entry of the target test tool can be responded to, and the target protocol test plug-in determined by the trigger operation of the plug-in acquisition entry can be obtained. For example, the user can enter the target protocol test plug-in in the protocol test plug-in search window on the test page. After determining the target protocol test plug-in, the parameter information corresponding to the target protocol test plug-in is displayed in the test page corresponding to the target test tool. After obtaining the data to be tested, the target protocol test plug-in is called to test the data to be tested.

[0132] like Fig.11 As shown, Fig.11 A schematic diagram of a data testing method using a target testing tool provided in an embodiment of the present application, such as Fig.11As shown, the target test tool includes a plug-in library, which is used to manage multiple protocol test plug-ins. The plug-in library is provided with a plug-in external interface, which includes a functional abstract interface and a management interface. Among them, the functional abstract interface includes a configuration file setting interface, through which a configuration file can be added or modified, and the functional abstract interface also includes an interface for obtaining character results and an interface for obtaining sub-section results, and an interface for running plug-in functional logic data. Among them, the management interface includes a plug-in registration interface, a plug-in acquisition interface, and a plug-in addition interface. Each protocol test plug-in (such as protocol test plug-in A, protocol test plug-in B, protocol test plug-in C, and protocol test plug-in D) implements the functional abstract interface in the plug-in library, and after being registered in the plug-in manager, the target test tool can use each protocol plug-in. When the standard data packets corresponding to each protocol test plug-in are imported into the plug-in manager, the storage address corresponding to the standard data packets corresponding to each protocol test plug-in can be imported. The functional logic data packets corresponding to each protocol test plug-in are packaged (i.e., encapsulated) into corresponding protocol test plug-in instances through go (a computer programming language), and the protocol test plug-in instances corresponding to each protocol test plug-in are registered in the plug-in manager for storage. That is, the functional logic data packets corresponding to each protocol test plug-in are respectively encapsulated into the standard data packets corresponding to the go data type, and then imported into the plug-in library in the plug-in manager to generate the target test tool. It is also possible to encapsulate at least two protocol test plug-ins into corresponding binary data packets, and load the corresponding binary data packets into the memory for calling. The target test tool includes each protocol test plug-in instance, and the external interface provided to the business developer, which includes obtaining all plug-in information interfaces, adding plug-in interfaces, obtaining plug-in interfaces, plug-in parameter injection interfaces, and configuration injection interfaces. These external interfaces can be displayed on the test page corresponding to the target test tool so that the business developer can view the protocol test plug-in information or add new protocol test plug-ins, etc. For example, the protocol test plug-in currently added to the target test tool can be viewed according to the interface for obtaining all plug-in information, and the newly added protocol test plug-in is added in the target test tool according to the increase of the plug-in interface, so that the target test tool has the data testing ability of the newly added protocol test plug-in. And the required protocol test plug-in can be searched according to the acquisition plug-in interface, the required protocol test plug-in is called for data testing, and the parameters and configuration files are injected according to the plug-in parameter injection interface and the configuration injection interface. At the same time, the target testing tool has a business layer, which can obtain plug-in details and plug-in parameters (i.e., data to be tested), determine the target protocol test plug-in instance according to the obtained plug-in details, and the configuration file of the target protocol test plug-in, and run (call the target protocol test plug-in to perform on the test data) to obtain the test results.Among them, the target testing tool of the embodiment of the present application is not limited to the access of protocol testing tools, but can also access other data processing tools such as mock testing tools (a testing method that uses virtual objects to create tests), data generation tools, etc.

[0133] S204, displaying at least two protocol test plug-ins in a test page corresponding to the target test tool; the at least two protocol test plug-ins are used to test data of different protocol types.

[0134] S205, in response to a selection operation on at least two protocol test plug-ins, determining the protocol test plug-in determined by the selection operation as a target protocol test plug-in, and acquiring to-be-tested data associated with the target protocol plug-in.

[0135] S206, performing test processing on the data to be tested according to the target protocol test plug-in, and generating test results corresponding to the data to be tested.

[0136] The specific implementation of steps S204-S206 in the embodiment of the present application can be found in Figure 2 The description in the corresponding embodiments will not be repeated here in the embodiments of the present application.

[0137] In an embodiment of the present application, at least two protocol test plug-ins are displayed in the test page corresponding to the target test tool, and in response to the selection operation for at least two protocol test plug-ins, the protocol test plug-in determined by the selection operation is determined as the target protocol test plug-in, and the data to be tested associated with the target protocol plug-in is obtained. According to the target protocol test plug-in, the test data to be tested is tested and processed, and the test results corresponding to the data to be tested are generated. In this way, the target test tool can be used to test data of multiple protocol types, that is, the corresponding protocol test plug-in is called in the target test tool to test the data of the corresponding protocol type without switching multiple test tools of different protocol types, which provides convenience for business developers. Through this application, data of different protocol types can be tested, the test efficiency can be improved, and the accuracy of the test results can be improved. In addition, the embodiment of the present application provides a test page corresponding to the target test tool by visualizing the target test tool. Business developers can test on the test page corresponding to the target test tool by filling in the corresponding value of the response in the corresponding parameter to obtain the test result, avoiding low-level errors such as missing parameters and wrong name input, and improving the accuracy and efficiency of the test. At the same time, it also avoids the situation where the input of parameters increases the cost of data testing for business development when there are many parameters. Business developers may also fail to remember the specific command parameter instructions, which leads to frequent errors in the use of tools and less accurate test results.

[0138] See also Fig.12 , Fig.12 : is a schematic diagram of the structure of a test device provided in an embodiment of the present application. The above-mentioned test device can be a computer program (including program code) running in a computer device, for example, the test device is an application software; the device can be used to execute the corresponding steps in the test method provided in an embodiment of the present application. Fig.12 As shown, the test device may include: a display module 11, a first acquisition module 12, a test processing module 13, a second acquisition module 14, a conversion module 15, a first generation module 16, a third acquisition module 17, a second generation module 18, and an adding module 19.

[0139] The display module 11 displays at least two protocol test plug-ins in a test page corresponding to the target test tool; the at least two protocol test plug-ins are used to test data of different protocol types.

[0140] The first acquisition module 12 is used to respond to a selection operation on at least two protocol test plug-ins, determine the protocol test plug-in determined by the selection operation as a target protocol test plug-in, and obtain to-be-tested data associated with the target protocol plug-in.

[0141] The test processing module 13 is used to test the test data according to the target protocol test plug-in and generate test results corresponding to the test data.

[0142] Wherein, the target test tool includes a plug-in manager, and the above device also includes:

[0143] The second acquisition module 14 is used to acquire functional logic data packets corresponding to at least two protocol test plug-ins respectively;

[0144] The conversion module 15 is used to convert the functional logic data packet into a standard data packet that meets the plug-in data type according to the plug-in data type corresponding to the plug-in standard interface in the plug-in manager;

[0145] The first generating module 16 is used to import the standard data packet into the plug-in manager, and generate a target test tool including at least two protocol test plug-ins according to the plug-in manager including the standard data packet.

[0146] The first acquisition module 12 includes:

[0147] The display unit 1201 is used to respond to the test data editing operation in the test page and display the original test data in the target test tool;

[0148] An updating unit 1202, configured to respond to a modification operation on the original test data and update the original test data to modified original test data;

[0149] The first determining unit 1203 is configured to store the modified original test data in the target test tool, and determine the modified original test data as the data to be tested.

[0150] The first acquisition module 12 further includes:

[0151] A first acquisition unit 1204 is used to acquire a target standard data packet associated with a target protocol plug-in in a target test tool;

[0152] The parsing unit 1205 is used to parse the target standard data packet to obtain the request parameter field and the request parameter value range in the target standard data packet;

[0153] The first generating unit 1206 is used to generate a target request parameter associated with the request parameter field within the request parameter value range;

[0154] The correction unit 1207 is used to correct the target request parameter according to the historical test data corresponding to the target protocol plug-in, and determine the corrected target request parameter as the to-be-tested data associated with the target protocol plug-in.

[0155] The test processing module 13 includes:

[0156] The second generating unit 1301 is used to encode the test data to generate a test packet corresponding to the test data;

[0157] The sending unit 1302 is used to obtain the network address corresponding to the object under test, and send the test packet to the network address corresponding to the object under test, so that the object under test generates a feedback data packet corresponding to the test packet according to the test packet;

[0158] The third generating unit 1303 is used to receive the feedback data packet returned by the object under test, decode the feedback data packet, and generate the test result corresponding to the data to be tested.

[0159] The above device further comprises:

[0160] The third acquisition module 17 is used to respond to the trigger operation of adding an entry to the plug-in in the test page and acquire the newly added protocol type determined by the trigger operation;

[0161] The second generating module 18 is used to obtain a new protocol test plug-in corresponding to the new protocol type, and perform data conversion on the new plug-in data packet corresponding to the new protocol test plug-in according to the data type corresponding to the standard interface in the plug-in manager to generate a new standard data packet;

[0162] Adding module 19 is used to import the newly added standard data packet into the plug-in manager of the target test tool, and add the newly added protocol test plug-in successfully imported into the plug-in manager to the protocol test plug-in list; the protocol test plug-in list includes the protocol test plug-ins connected to the target test tool.

[0163] The first generation module 16 includes:

[0164] The encapsulation unit 1601 is used to encapsulate the standard data packet into the plug-in standard interface in the plug-in manager;

[0165] The registration unit 1602 is used to obtain parameter declaration information corresponding to at least two protocol test plug-ins respectively, call the plug-in registration function, register the standard data packet containing the parameter declaration information in the plug-in manager, and obtain the target test tool.

[0166] The specific implementation method in the embodiment of this application can be found in Figure 2 or Figure 7 The description in the corresponding embodiments will not be repeated here in the embodiments of the present application.

[0167] According to one embodiment of the present application, Figure 2 or Figure 7 The steps involved in the test method shown can be Fig.12 The test setup shown is performed by each module. For example, Figure 2 The step S101 shown in FIG. 1 can be performed by Fig.12 The display module 11 is used to execute, Figure 2 The step S102 shown in FIG. 1 can be performed by Fig.12 The first acquisition module 12 is executed; Figure 2 The step S103 shown in FIG. 1 can be performed by Fig.12 The test processing module 13 in is used to execute and so on.

[0168] According to one embodiment of the present application, Fig.12 The various modules in the test device shown can be respectively or all merged into one or several units to constitute, or some of the units (some) can also be split into multiple smaller sub-units in function, and the same operation can be achieved without affecting the realization of the technical effects of the embodiments of the present application. The above modules are divided based on logical functions. In practical applications, the function of a module can also be realized by multiple units, or the function of multiple modules can be realized by one unit. In other embodiments of the present application, the test device can also include other units. In practical applications, these functions can also be assisted by other units to be realized, and can be realized by the collaboration of multiple units.

[0169] According to one embodiment of the present application, the program can be executed by running on a general-purpose computer device such as a computer including a central processing unit (CPU), a random access memory medium (RAM), a read-only memory medium (ROM), and other processing elements and storage elements. Figure 2 or Figure 7 A computer program (including program code) for each step involved in the corresponding method shown in Fig.12 The test device shown in and the test method of the embodiment of the present application are implemented. The above computer program can be recorded on, for example, a computer readable recording medium, and loaded into the above computing device through the computer readable recording medium and run therein.

[0170] In the embodiment of the present application, at least two protocol test plug-ins are displayed in the test page corresponding to the target test tool, and the selection operation for at least two protocol test plug-ins is responded to, and the protocol test plug-in determined by the selection operation is determined as the target protocol test plug-in, and the data to be tested associated with the target protocol plug-in is obtained. According to the target protocol test plug-in, the test data to be tested is tested and processed, and the test results corresponding to the data to be tested are generated. In this way, the target test tool can be used to test data of multiple protocol types, that is, the corresponding protocol test plug-in is called in the target test tool to test the data of the corresponding protocol type without switching multiple test tools of different protocol types, which provides convenience for business developers. Through this application, data of different protocol types can be tested, the test efficiency and the accuracy of the test results can be improved. In addition, the embodiment of the present application provides a test page corresponding to the target test tool by visualizing the target test tool. The business developer can test on the test page corresponding to the target test tool by filling in the corresponding value of the response in the corresponding parameter to obtain the test result, avoiding low-level errors such as missing parameters and wrong name input, and improving the accuracy and efficiency of the test. At the same time, it also avoids the situation where the input of parameters increases the cost of data testing for business development when there are many parameters. Business developers may also fail to remember the specific command parameter instructions, which leads to frequent errors in the use of tools and less accurate test results.

[0171] See also Fig.13 , Fig.13 Schematic diagram of the structure of a computer device provided in an embodiment of the present application. Fig.13As shown, the above-mentioned computer device 1000 may include: a processor 1001, a network interface 1004 and a memory 1005. In addition, the above-mentioned computer device 1000 may also include: a user interface 1003, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory, or it may be a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As Fig.13 As shown, the memory 1005 as a computer-readable storage medium may include an operating system, a network communication module, a user interface module, and a device control application program.

[0172] exist Fig.13 In the computer device 1000 shown, the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve:

[0173] Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005 to implement:

[0174] Displaying at least two protocol test plug-ins in a test page corresponding to a target test tool; the at least two protocol test plug-ins are used to test data of different protocol types;

[0175] In response to a selection operation for at least two protocol test plug-ins, the protocol test plug-in determined by the selection operation is determined as a target protocol test plug-in, and to-be-tested data associated with the target protocol plug-in is obtained;

[0176] According to the target protocol test plug-in, the test data is tested and processed to generate the test results corresponding to the test data.

[0177] Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005 to implement:

[0178] Obtain functional logic data packets corresponding to at least two protocol test plug-ins respectively;

[0179] According to the plug-in data type corresponding to the plug-in standard interface in the plug-in manager, the functional logic data packet is converted into a standard data packet that satisfies the plug-in data type;

[0180] The standard data packet is imported into the plug-in manager, and a target test tool including at least two protocol test plug-ins is generated according to the plug-in manager including the standard data packet.

[0181] Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005 to implement:

[0182] In response to the test data editing operation in the test page, the original test data in the target test tool is displayed;

[0183] In response to a modification operation on the original test data, the original test data is updated to the modified original test data;

[0184] The modified original test data is stored in the target test tool, and the modified original test data is determined as the data to be tested.

[0185] Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005 to implement:

[0186] Obtaining a target standard data packet associated with a target protocol plug-in in a target test tool;

[0187] Parse the target standard data packet to obtain the request parameter field and request parameter value range in the target standard data packet;

[0188] Generate a target request parameter associated with the request parameter field within the request parameter value range;

[0189] According to the historical test data corresponding to the target protocol plug-in, the target request parameter is corrected, and the corrected target request parameter is determined as the to-be-tested data associated with the target protocol plug-in.

[0190] Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005 to implement:

[0191] Encode the test data to generate a test package corresponding to the test data;

[0192] Obtaining a network address corresponding to the object under test, and sending a test packet to the network address corresponding to the object under test, so that the object under test generates a feedback data packet corresponding to the test packet according to the test packet;

[0193] Receive the feedback data packet returned by the object under test, decode the feedback data packet, and generate the test result corresponding to the data to be tested.

[0194] Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005 to implement:

[0195] In response to a trigger operation for adding an entry to a plug-in in a test page, a newly added protocol type determined by the trigger operation is obtained;

[0196] Obtain a new protocol test plug-in corresponding to the new protocol type, and perform data conversion on the new plug-in data packet corresponding to the new protocol test plug-in according to the data type corresponding to the standard interface in the plug-in manager to generate a new standard data packet;

[0197] The newly added standard data packet is imported into the plug-in manager of the target test tool, and the newly added protocol test plug-in successfully imported into the plug-in manager is added to the protocol test plug-in list; the protocol test plug-in list includes the protocol test plug-ins connected to the target test tool.

[0198] Optionally, the processor 1001 may be configured to call a device control application stored in the memory 1005 to implement:

[0199] Encapsulate standard data packets into the plug-in standard interface in the plug-in manager;

[0200] Parameter declaration information corresponding to at least two protocol test plug-ins is obtained, a plug-in registration function is called, and a standard data packet containing the parameter declaration information is registered in a plug-in manager to obtain a target test tool.

[0201] The specific implementation method in the embodiment of this application can be found in Figure 2 or Figure 7 The description in the corresponding embodiments will not be repeated here in the embodiments of the present application.

[0202] It should be understood that the computer device 1000 described in the embodiment of the present application can execute the above Figure 2 or Figure 7 The description of the above test method in the corresponding embodiment can also be performed as described above. Fig.12 The description of the above-mentioned testing device in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of adopting the same method will not be repeated here.

[0203] According to one aspect of the present application, a computer program product or a computer program is provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device can execute the above Figure 2 or Figure 7The description of the test method in the corresponding embodiment will not be repeated here. In addition, the description of the beneficial effects of the same method will not be repeated here.

[0204] As an example, the above program instructions may be deployed on a computer device for execution, or deployed on multiple computer devices located at one location for execution, or executed on multiple computer devices distributed at multiple locations and interconnected by a communication network. Multiple computer devices distributed at multiple locations and interconnected by a communication network may constitute a blockchain network.

[0205] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The above-mentioned storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.

[0206] The above disclosure is only the preferred embodiment of the present application, which certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A testing method, characterized in that: include: Obtain functional logic data packets corresponding to at least two protocol test plug-ins respectively; According to the plug-in data type corresponding to the plug-in standard interface in the plug-in manager, convert the functional logic data packet into a standard data packet that satisfies the plug-in data type; Encapsulating the standard data packet into the plug-in standard interface in the plug-in manager; Obtain parameter declaration information corresponding to the at least two protocol test plug-ins respectively, call a plug-in registration function, register a standard data packet containing the parameter declaration information in the plug-in manager, and obtain a target test tool containing the at least two protocol test plug-ins; Displaying at least two protocol test plug-ins in a test page corresponding to the target test tool; The at least two protocol test plug-ins are used to test data of different protocol types; In response to a selection operation on the at least two protocol test plug-ins, determining the protocol test plug-in determined by the selection operation as a target protocol test plug-in; Acquiring a target standard data packet associated with the target protocol test plug-in in a local database of the target test tool; Parsing the target standard data packet to obtain a request parameter field and a request parameter value range in the target standard data packet; Generate a target request parameter associated with the request parameter field within the request parameter value range; According to the historical test data corresponding to the target protocol test plug-in, the target request parameter is modified, and the modified target request parameter is determined as the to-be-tested data associated with the target protocol test plug-in; According to the target protocol test plug-in, the data to be tested is encoded to generate a test packet corresponding to the test data; Acquire a network address corresponding to the object under test, and send the test packet to the network address corresponding to the object under test, so that the object under test generates a feedback data packet corresponding to the test packet according to the test packet; The feedback data packet returned by the object under test is received, the feedback data packet is decoded and processed, and a test result corresponding to the data to be tested is generated.

2. The method according to claim 1, characterized in that The step of obtaining the test data associated with the target protocol test plug-in includes: In response to the test data editing operation in the test page, displaying the original test data in the target test tool; In response to a modification operation on the original test data, updating the original test data to modified original test data; The modified original test data is stored in the target test tool, and the modified original test data is determined as the data to be tested.

3. The method according to claim 1, characterized in that The method further comprises: In response to a trigger operation for adding an entry to the plug-in in the test page, obtaining a newly added protocol type determined by the trigger operation; Obtain a new protocol test plug-in corresponding to the new protocol type, and perform data conversion on a new plug-in data packet corresponding to the new protocol test plug-in according to the data type corresponding to the standard interface in the plug-in manager to generate a new standard data packet; The newly added standard data packet is imported into the plug-in manager of the target test tool, and the newly added protocol test plug-in successfully imported into the plug-in manager is added to the protocol test plug-in list; the protocol test plug-in list includes the protocol test plug-ins connected to the target test tool.

4. A testing device, characterized in that: include: A display module, which displays at least two protocol test plug-ins in a test page corresponding to a target test tool; The at least two protocol test plug-ins are used to test data of different protocol types; A first acquisition module, configured to respond to a selection operation on the at least two protocol test plug-ins, determine the protocol test plug-in determined by the selection operation as a target protocol test plug-in, and acquire to-be-tested data associated with the target protocol test plug-in; The first acquisition module includes: A first acquisition unit, configured to acquire a target standard data packet associated with the target protocol test plug-in in a local database of the target test tool; A parsing unit, configured to parse the target standard data packet to obtain a request parameter field and a request parameter value range in the target standard data packet; A first generating unit, configured to generate a target request parameter associated with the request parameter field within the request parameter value range; A correction unit, configured to correct the target request parameter according to the historical test data corresponding to the target protocol test plug-in, and determine the corrected target request parameter as the to-be-tested data associated with the target protocol test plug-in; A test processing module, used to perform test processing on the data to be tested according to the target protocol test plug-in, and generate a test result corresponding to the data to be tested; A second acquisition module is used to acquire functional logic data packets corresponding to at least two protocol test plug-ins respectively; A conversion module, used to convert the functional logic data packet into a standard data packet satisfying the plug-in data type according to the plug-in data type corresponding to the plug-in standard interface in the plug-in manager; A first generating module, configured to import a standard data packet into a plug-in manager, and generate a target test tool including at least two protocol test plug-ins according to the plug-in manager including the standard data packet; The first generating module comprises: An encapsulation unit, configured to encapsulate the standard data packet into the plug-in standard interface in the plug-in manager; A registration unit, used for obtaining parameter declaration information respectively corresponding to the at least two protocol test plug-ins, calling a plug-in registration function, registering a standard data packet containing the parameter declaration information in the plug-in manager, and obtaining the target test tool; The test processing module comprises: The second generating unit is used to encode the test data and generate a test package corresponding to the test data; A sending unit, used to obtain a network address corresponding to the object under test, and send a test packet to the network address corresponding to the object under test, so that the object under test generates a feedback data packet corresponding to the test packet according to the test packet; The third generating unit is used to receive the feedback data packet returned by the object under test, decode the feedback data packet, and generate the test result corresponding to the data to be tested.

5. A computer device, characterized in that: including memory and processor; The memory is connected to the processor, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 3.

Citation Information

Patent Citations

  • Protocol testing method and device, computer equipment and storage medium

    CN111416756A

  • Extensible service quality diagnosis configuration method and system

    CN112054935A