A test packet processing method, device and equipment and readable storage medium
By acquiring application test messages and matching them with a legitimate message database, and outputting abnormal risk information, this solves the problem of efficiently locating application test anomalies in existing technologies, and achieves the effect of quickly finding and fixing abnormal code.
Patent Information
- Application Number
- CN202211266015.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-17
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2042-10-17
AI Technical Summary
In existing technologies, it is difficult to efficiently locate the cause of anomalies after application testing, resulting in a large amount of test result data and making it difficult to quickly find and fix abnormal code.
By acquiring the application's test messages and their characteristic information, matching the test messages using a legitimate message library, outputting risk test message information of anomalies, and providing interface information associated with the test messages to help users analyze the causes of anomalies.
It reduces the number of messages analyzed by users, improves testing efficiency, and enables efficient and accurate location and repair of testing issues.
Smart Images

Figure CN115604007B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer, more particularly, to a test message processing method, device and equipment and readable storage medium. BACKGROUND
[0002] With the rapid development of information technology, intelligent electronic devices have become an essential tool in people's lives. The types of applications that can be installed in intelligent electronic devices are increasing.
[0003] Before the application is released, it needs to be tested and adjusted several times. At present, the commonly used way to test the application is to test the application according to the test case, and feed back the test result in the form of a report to the developer, and the developer modifies the application according to the test result in view of the vulnerabilities or running errors of the application. However, according to the test result, the data amount is large, it is difficult to determine the abnormal reason causing the abnormality in the application, and it is impossible to locate the code causing the abnormality in the application and modify it. SUMMARY
[0004] Therefore, the present application provides a test message processing method, device, equipment and readable storage medium, which can help users quickly find test problems in the test process, save time for finding test problems, and improve test efficiency.
[0005] In order to achieve the above purpose, the present scheme is as follows:
[0006] A test message processing method comprises:
[0007] Obtaining at least one test message of an application and feature information of the test message, the test message being a test message input or output by an interface of the application in a test process of the application, and the feature information including information of an interface associated with the test message;
[0008] For each test message, obtaining a legal message corresponding to the interface associated with the test message from a legal message library, the legal message in the legal message library being a normal message obtained through application testing;
[0009] If the test message does not match the legal message or the legal message library does not have a legal message corresponding to the interface associated with the test message, outputting the test message and the feature information of the test message as risk test message information with abnormal risk, so that a user determines an abnormal test message with abnormality based on the risk test message information.
[0010] Preferably, before the at least one test message collected in the application test process, the method further comprises:
[0011] adding a capture function to an interface to be tested in the application, wherein the capture function of the interface is used to capture at least one of the input message and the output message of the interface;
[0012] the at least one test message collected in the application test process, comprising:
[0013] In the process of testing the application, the interface-related message of the interface to be tested in the application is obtained through the corresponding capture function of the interface, and the obtained message is used as the test message associated with the interface. The interface-related message includes at least one of the input message and the output message of the interface.
[0014] Preferably, before the at least one test message collected in the application test process, further comprising:
[0015] In the process of testing the application through the test control program, the interface-related message of the application is collected by the test monitoring control program. The interface-related message includes at least one of the input message and the output message of the interface.
[0016] Preferably, after the matching of the test message and the legal message, further comprising:
[0017] If the test message matches the legal message, it is confirmed that the test message is a legal message.
[0018] Preferably, further comprising:
[0019] The repair test message of the application test is obtained. The repair test message is a message obtained after the user repairs the abnormal test message;
[0020] If the repair test message does not match the interface legal message or there is no interface legal message associated with the repair test message in the legal message library, the repair test message is determined as a message with abnormal risk and is outputted, so that the user judges the legality of the repair test message. The interface legal message is the interface legal message corresponding to the interface associated with the repair test message obtained from the legal message library;
[0021] If the legal indication of the user for the repair test message is received, the repair test message is stored in the legal message library. The legal indication indicates that the user confirms that the repair test message is a legal message.
[0022] Preferably, the characteristic information of the test message further comprises: message attribute of the test message, the message attribute being used to represent that the test message is an input message or an output message of the interface associated with the test message.
[0023] In another aspect, a test message processing apparatus comprises:
[0024] a test message obtaining unit, configured to obtain at least one test message of an application and characteristic information of the test message, the test message being a test message inputted or outputted by the interface of the application during testing of the application, and the characteristic information comprising information of the interface associated with the test message;
[0025] a legal message obtaining unit, configured to obtain, for each test message, a legal message corresponding to the interface of the test message from a legal message library, the legal message in the legal message library being a normal message obtained through application testing;
[0026] a test message output unit, configured to output, if the test message does not match the legal message or the legal message library does not have a legal message corresponding to the interface associated with the test message, the test message and the characteristic information of the test message as risk test message information of abnormal risk, so that a user determines an abnormal test message based on the risk test message information.
[0027] Preferably, the apparatus further comprises:
[0028] a capture function adding unit, configured to add a capture function for an interface to be tested in the application before the test message obtaining unit obtains at least one test message collected during the testing of the application, wherein the capture function of the interface is used to capture at least one of an input message and an output message of the interface;
[0029] the test message obtaining unit comprises:
[0030] a message capturing unit, configured to obtain, during testing of the application, an interface-related message of the interface to be tested in the application through a capture function corresponding to the interface, and take the obtained message as a test message associated with the interface, wherein the interface-related message comprises at least one of an input message and an output message of the interface.
[0031] In another aspect, a computer device comprises a memory and a processor.
[0032] the memory is configured to store a program;
[0033] the processor is configured to execute the program to implement the test message processing method according to any one of the preceding aspects.
[0034] In another aspect, a readable storage medium having a computer program stored thereon, the computer program, when executed by a processor, implements the test packet processing method according to any one of the preceding aspects.
[0035] In the present application, after obtaining at least one test packet of an application and the characteristic information of the test packet, a legal packet corresponding to the interface associated with the test packet is obtained from a legal packet library. When the legal packet does not match the test packet or there is no corresponding legal packet of the interface associated with the test packet in the legal packet library, it can be indicated that the test packet is a packet that may have abnormal risks. In this case, the present application outputs the test packet and the characteristic information thereof as risk test packet information, so as to further analyze by a user whether the test packet has an abnormality. In this way, some legal packets can be screened out, and only some packets that may have abnormalities are output to the user for analysis, so that the number of packets that need to be analyzed by the user is reduced, the workload of the user in analyzing the packets is reduced, and the working efficiency of analyzing abnormal packets is improved.
[0036] Moreover, in the present application, the interface associated with the test packet is determined at the same time when the test packet is obtained. In the case where it is determined that the test packet may have abnormal risks, the present application outputs the information of the interface associated with the test packet at the same time when the test packet is output, so that the user can more specifically determine the abnormal reason causing the test packet to be abnormal according to the information of the interface associated with the test packet, thereby more efficiently and accurately locating the test problem, and saving the time for determining the abnormality in the application. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or the prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings.
[0038] Figure 1 A flowchart of a test packet processing provided by an embodiment of the present application;
[0039] Figure 2 Another flowchart of a test packet processing provided by an embodiment of the present application;
[0040] Figure 3 A structure diagram of a test packet processing device disclosed by an embodiment of the present application;
[0041] Figure 4 A hardware structure block diagram of a computer device disclosed by an embodiment of the present application. Detailed Implementation
[0042] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0043] The following describes a test message processing method provided by an embodiment of this application.
[0044] like Figure 1 This illustration shows a flowchart of a test message processing method provided in an embodiment of this application. This application can be applied to computer devices that need to perform application testing, without limitation.
[0045] The method in this embodiment includes:
[0046] Step S100: Obtain at least one test message from the application and the characteristic information of the test message.
[0047] Test messages are test messages obtained during application testing, representing the input or output of the application's interfaces. Key information includes the interface information associated with the test message.
[0048] A message is a data unit exchanged and transmitted over a network; it's the data a station sends at one time. It can be understood as the information exchanged between systems during requests and responses, and it must adhere to a predefined format. A message contains complete data information, and its length is unlimited and can vary. In addition to the data to be transmitted, a message also includes additional information such as the destination port, source port, and destination IP address.
[0049] For example, when a station wants to send a message, it will attach a destination IP address to the message. The network nodes will then send the message to the next node based on the destination IP address in the message, and so on, until the message is transmitted to the destination node one node at a time.
[0050] Understandably, since messages have different uses and functions, they are classified according to their different uses and functions. Messages can be divided into data messages, transaction messages, test messages, and so on.
[0051] In the present application, the test message is a message inputted or outputted by an interface of an application in a process of testing the application. The test message is used to test whether the application has errors. The process of testing can be that a user initiates a test by using the test message, and a computer device receives the test message and completes corresponding work according to information in the test message.
[0052] Further, when the test message of the application is acquired, the characteristic information of the test message is also acquired. The characteristic information includes information of an interface associated with the test message. The interface associated with the test message is an interface inputting or outputting the test message in the process of testing the application. The information of the interface associated with the test message includes a message attribute of the test message, and the message attribute is used to represent that the test message is at least one of a message inputted by the interface associated with the test message or a message outputted by the interface.
[0053] The characteristic information can be used to find a test problem in the process of testing. When the test message is abnormal, the user can find the application interface corresponding to the test message according to the test message and the characteristic information, and then analyze the test problem.
[0054] In order to acquire the test message of the application and the characteristic information of the test message, the present application can configure a message collection configuration for triggering message collection for the application by a user. The user can configure the message collection configuration for the application by modifying a message collection configuration command in a program. The start or stop of the message collection can be controlled by modifying a configuration command in the program.
[0055] The method of acquiring the test message of the test application is various, which is not limited in the present application.
[0056] In an optional method, a capture function can be added to an interface to be tested in the application. The capture function is a function code added to the application, which is used to detect the interface of the application and obtain data inputted or outputted by the interface. The capture function can capture at least one of a message inputted by the interface to be tested or a message outputted by the interface. In the process of testing the application, the added capture function is used to capture at least one of the message inputted by the interface to be tested or the message outputted by the interface, and the acquired message is taken as a test message related to the interface.
[0057] Alternatively, test messages can be obtained through a test monitoring program. A test monitoring program is a program that monitors the application and acquires input or output data from its interfaces during application testing. This program provides a test environment for the application; therefore, the application is tested within this environment. During application testing, the test monitoring program can collect at least one type of input or output message from different application interfaces, using these collected messages as test messages associated with the corresponding interfaces.
[0058] Step S110: For each test message, retrieve the valid message corresponding to the interface of the test message from the valid message database.
[0059] Among them, the legitimate messages in the legitimate message library are normal messages obtained through application testing.
[0060] The valid message library is a message library that stores valid messages. This valid message library is created by the user, who needs to analyze the messages beforehand. If a message is a valid message, it can be stored in the valid message library.
[0061] Specifically, legitimate messages in the legitimate message database can be categorized according to different rules to find messages with similar characteristics, such as categorization based on application interfaces, message testing functions, etc. In this application, the classification method of "same application interface" is used to retrieve legitimate messages corresponding to the interface of the test message from the legitimate message database.
[0062] Step S120: If the test message does not match the legitimate message or the legitimate message library does not contain a legitimate message corresponding to the interface associated with the test message, output the test message and the feature information of the test message as risk test message information with abnormal risks.
[0063] Test messages are primarily used to detect imperfections in the application. Therefore, by matching test messages with legitimate messages, test messages that do not match the legitimate messages are filtered out.
[0064] If a valid message corresponding to the interface associated with the test message does not exist in the valid message library, it means that the test message is not stored in the valid message library and needs to be output to the user so that the user can judge the test message.
[0065] When a valid message corresponding to the interface associated with the test message exists in the valid message database, it must be compared with the test message. If the test message matches the valid message, it indicates that the test message is valid, and therefore, the test message can be deleted or cached on disk. This application does not restrict the processing method for valid messages.
[0066] Correspondingly, when the test message does not match the legal message, it indicates that the test message does not belong to the legal message pre-stored in the legal message library, and the test message may have the risk of being an abnormal test message.
[0067] Further, when the test message does not match the legal message, the test message and the characteristic information of the test message are outputted, and the risk test message information of the abnormal risk is outputted.
[0068] The risk test message information can help the user to determine whether the output test message is legal. The user can determine whether the test message is legal based on the business requirements of the application, such as whether the function of the application is implemented, whether the result output by the application is correct, and the like. When the test message meets the business requirements of the application, it indicates that the test message belongs to the legal message, and the test message is stored in the legal message library. When the test message does not meet the business requirements of the application, it indicates that the test message belongs to the illegal message, and the user needs to analyze the test message.
[0069] For example, the user tests whether the search function of the application has an abnormality. The user inputs "today's weather" in the search interface of the application, and the application jump interface displays information about tourism. At this time, the test message is "today's weather" information. If the test message does not match the legal message associated with the test message interface or does not exist, the user determines that the search function of the application has an abnormality according to the business requirements of the application, and the test message is an illegal message.
[0070] Further, the user can evaluate the illegal message based on the source of the message, defects, and the like. When the illegal message is an illegal attack, it indicates that the test message is an illegal message, and the test message can be deleted, the source address of the test message is recorded, and the illegal message is recorded. When the illegal message is a message with defects or problems, the user can find the interface associated with the test according to the test message and the characteristic information of the test message, and then find the test problem, and repair the defects or problems of the test message.
[0071] In the present application, after obtaining at least one test message of an application and the characteristic information of the test message, the legal message corresponding to the interface associated with the test message is obtained from the legal message library. When the legal message does not match the test message or the corresponding legal message of the interface associated with the test message does not exist in the legal message library, it can be indicated that the test message is a message that may have abnormal risks. In this case, the present application outputs the test message and its characteristic information as risk test message information for further analysis by the user on whether the test message has an abnormality. In this way, some legal messages can be screened out, and only some messages that may have abnormalities are output to the user for analysis, so that the number of messages that the user needs to analyze is reduced, the workload of the user in analyzing the messages is reduced, and the work efficiency can be improved.
[0072] Moreover, in the present application, the interface associated with the test message is determined at the same time as the test message is obtained. In the case where it is determined that the test message may have abnormal risks, the present application outputs the information of the interface associated with the test message at the same time as the test message is output, so that the user can more specifically determine the abnormal reason causing the test message to be abnormal according to the information of the interface associated with the test message, thereby more efficiently and accurately locating the test problem, and saving the time for determining the abnormality in the application.
[0073] In the present application, considering that the test message with defects or problems is repaired, it is impossible for a person to determine whether the repaired test message belongs to a legal message. Therefore, in order to determine whether the test message belongs to a legal message and whether the code of the application is modified, it is necessary to reacquire the repaired test message for comparison and verification. The following describes another implementation manner of the test message processing in the present application. Figure 2 Fig. 2 shows another flowchart of a test message processing method in the present application, which includes the following steps:
[0074] Step S200: obtaining at least one test message of an application and the characteristic information of the test message through a test control program or a capture function of an application interface.
[0075] Step S210: for each test message, comparing the test message with the legal message corresponding to the interface of the test message obtained from the legal message library.
[0076] Steps S200-210 correspond to steps S100-110 of the foregoing embodiment, and are described in detail in the foregoing description, which will not be described herein.
[0077] Step S220, if the test message does not match the legal message or the legal message library does not have the interface corresponding legal message associated with the test message, output the test message and the characteristic information of the test message, so that the user determines the legality of the test message based on the business needs of the application.
[0078] Step S230, if the test message belongs to illegal message, output the test message and the characteristic information of the test message as risk test message information with abnormal risk, so that the user determines the test message with defects or problems based on the risk test message information and repairs the test message.
[0079] Among them, steps S220-230 are similar to the content of the foregoing embodiment step S120, and the foregoing detailed description of step S120 can be referred to, and will not be repeated here.
[0080] Step S240, obtaining the repair test message of the application test and the characteristic information of the repair test message.
[0081] Among them, the user determines the test message with defects or problems based on the risk test message information and repairs the test message, and obtains the repair test message. The user replays the repair test message, that is, uses the repaired test message to test the application.
[0082] It can be understood that since the repair test message is replayed, the computer device can obtain the repair test message of the application test and the characteristic information of the repair test message through the test control program or the capture function of the application interface.
[0083] Among them, the test control program and the capture function have been described in detail in the foregoing, and will not be repeated here.
[0084] Step S250, if the repair test message does not match the interface legal message or the legal message library does not have the interface corresponding legal message associated with the repair test message, output the repair test message and the characteristic information of the repair test message, so that the user determines the legality of the repair test message according to the business needs.
[0085] Among them, when the legal message library does not have the interface corresponding legal message associated with the repair test message, it means that the repair test message is not stored in the legal message library, and then needs to be output to the user for judgment.
[0086] Among them, the repair test message is the same as the test message, and both need to be compared with the legal message of the message corresponding interface.
[0087] Specifically, when the repair test packet matches the interface legal packet, it indicates that the repair test packet is a legal packet and has been stored in the legal packet library. When the test packet does not match the legal packet, it indicates that the test packet is not stored in the legal packet library. Further, the user needs to further evaluate the repair test packet based on the feature information of the repair test packet.
[0088] Step S260, if the user's legal indication is received, the repair test packet is stored in the legal packet library.
[0089] Wherein, the user judges whether the repair test packet meets the business requirements of the application based on the repair test packet and the feature information of the repair test packet. The legal indication indicates that the user confirms that the repair test packet is a legal packet.
[0090] Specifically, if the repair test packet meets the business requirements of the application, the packet belongs to a legal packet, and therefore the repair test packet is stored in the legal packet library for management. If the repair test packet does not meet the business requirements of the application, the user needs to further evaluate the repair test packet.
[0091] It can be understood that since the repair test packet is repaired manually by the user, it may cause modification of the legal packet in the legal packet library. Therefore, in order to verify whether the legal packet is modified, the regression verification method can be used to verify the packet in the legal packet library. Regression verification is to replay the legal packet to verify the legality of the packet. This method corresponds to the step of verifying the repair test packet, which will not be described here.
[0092] In this application, the legality of the repair test packet is verified by replaying the repair test packet, and then the legal repair test packet is stored, which increases the legal packets in the legal packet library. The method realizes the collection of test packets and improves the completeness of test packets. At the same time, the regression test is performed on the packets in the legal packet library to detect whether the packet is modified, which ensures that the packets in the legal packet library are normal.
[0093] The test packet processing device provided by the embodiment of the application will be described below. The test packet processing device described below can be referred to the test packet processing method described above.
[0094] As shown in Figure 3 , a structure schematic diagram of the test packet processing device in the application is shown, which includes:
[0095] The test message obtaining unit 300 is configured to obtain at least one test message of an application and feature information of the test message, the test message being a test message input or output by an interface of the application during testing of the application, and the feature information including information of an interface associated with the test message.
[0096] The legal message obtaining unit 310 is configured to obtain, for each test message, a legal message corresponding to the interface of the test message from a legal message library, the legal message in the legal message library being a normal message obtained through testing of the application.
[0097] The test message output unit 320 is configured to output the test message and the feature information of the test message as risk test message information of an abnormal risk if the test message does not match the legal message or the legal message library does not have a legal message corresponding to the interface associated with the test message, so that a user determines an abnormal test message with an abnormality based on the risk test message information.
[0098] Optionally, the test message processing apparatus further includes:
[0099] The capture function adding unit is configured to add a capture function for an interface to be tested in the application before the test message obtaining unit obtains at least one test message collected during testing, wherein the capture function of the interface is configured to capture at least one of a message input by the interface and a message output by the interface.
[0100] The test message obtaining unit includes:
[0101] The message capturing unit is configured to obtain a message related to the interface through a capture function corresponding to the interface to be tested in the application during testing of the application, and take the obtained message as a test message associated with the interface, the message related to the interface including at least one of a message input by the interface and a message output by the interface.
[0102] Optionally, the test message processing apparatus further includes:
[0103] The test control program collecting unit is configured to collect messages related to different interfaces in the application by using a test control program during testing of the application by the test control program, the messages related to the interfaces including at least one of a message input by the interface and a message output by the interface.
[0104] The test message processing apparatus provided by the embodiment of the application can be applied to a computer device. Figure 4 FIG. 1 shows a hardware structure block diagram of a computer device, and Figure 4 The computer device can include at least one processor 1, at least one communication interface 2, at least one memory 3 and at least one communication bus 4.
[0105] In the embodiments of the present application, the number of the processor 1, the communication interface 2, the memory 3 and the communication bus 4 is at least one, and the processor 1, the communication interface 2 and the memory 3 complete the communication with each other through the communication bus 4;
[0106] The processor 1 can be a central processing unit CPU, or an application specific integrated circuit ASIC, or one or more integrated circuits configured to implement the embodiments of the present application, etc.
[0107] The memory 3 can include a high-speed RAM memory, and can also include a non-volatile memory, such as at least one disk memory, etc.
[0108] The memory stores a program, and the processor can invoke the program stored in the memory, and the program is used to implement the test packet processing method mentioned in any one of the above embodiments.
[0109] The embodiments of the present application also provide a storage medium which can store a program suitable for the processor to execute, and the program is used to implement the test packet processing method mentioned in any one of the above embodiments.
[0110] Finally, it should be noted that in this document, the relationship terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or equipment. Without more limitations, the element defined by the statement "including a" does not exclude the presence of another identical element in the process, method, article or equipment including the element.
[0111] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts between various embodiments can be referred to each other.
[0112] The foregoing description of the disclosed embodiments enables a person skilled in the art to make or use the application. Modifications of these embodiments will occur to persons of skill in the art, and that the generic principles defined herein can be applied to other embodiments without departing from the spirit or scope of the application. Therefore, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for testing packet processing, the method comprising: The method comprises the following steps: obtaining at least one test message of an application and feature information of the test message, the test message being a test message inputted or outputted by an interface of the application during testing of the application, and the feature information comprising information of an interface associated with the test message; for each test message, obtaining a legal message corresponding to the interface associated with the test message from a legal message library, the legal message in the legal message library being a normal message obtained through application testing; if the test message does not match the legal message or the legal message library does not contain a legal message corresponding to the interface associated with the test message, outputting the test message and the feature information of the test message as risk test message information of abnormal risk, so that a user determines an abnormal test message based on the risk test message information. The method further comprises the following steps: obtaining a repair test message of the application through repair test message replay, the repair test message being a message obtained after the user repairs an abnormal test message; if the repair test message does not match an interface legal message or the legal message library does not contain an interface legal message corresponding to the interface associated with the repair test message, determining the repair test message as a message of abnormal risk and outputting the repair test message, so that the user judges the legality of the repair test message, the interface legal message being an interface legal message corresponding to the interface associated with the repair test message and obtained from the legal message library; if a legal indication of the user for the repair test message is received, storing the repair test message in the legal message library, the legal indication indicating that the user confirms that the repair test message is a legal message.
2. The method of claim 1, wherein, Before the at least one test message collected during the application testing process, the method further comprises the following steps: adding a capture function to an interface to be tested in the application, wherein the capture function of the interface is used to capture at least one of a message inputted by the interface and a message outputted by the interface; the at least one test message collected during the application testing process comprises the following steps: during testing of the application, obtaining a message related to the interface through the capture function corresponding to the interface to be tested in the application, and taking the obtained message as a test message associated with the interface, the message related to the interface comprising at least one of a message inputted by the interface and a message outputted by the interface.
3. The method of claim 1, wherein, Before the at least one test message collected during the application testing process, the method further comprises the following steps: testing the application through a test control program, and collecting a message related to different interfaces in the application through a test monitoring control program during testing of the application, the message related to the interface comprising at least one of a message inputted by the interface and a message outputted by the interface.
4. The method of claim 1, wherein, After the matching of the legal message with the test message, the method further comprises the following steps: if the test message matches the legal message, confirming that the test message is a legal message.
5. The method of claim 1, wherein, The characteristic information of the test message further includes: message attribute of the test message, the message attribute being used to represent whether the test message is an input message or an output message of the interface associated with the test message.
6. A test packet processing apparatus, characterized by, Comprise: a test message obtaining unit, configured to obtain at least one test message of an application and characteristic information of the test message, the test message being a test message inputted or outputted by the interface associated with the test message during testing of the application, and the characteristic information including information of the interface associated with the test message; a legal message obtaining unit, configured to obtain, for each test message, a legal message corresponding to the interface of the test message from a legal message library, the legal message in the legal message library being a normal message obtained through application testing; a test message output unit, configured to output the test message and the characteristic information of the test message as risk test message information of abnormal risk if the test message does not match the legal message or the legal message library does not have a legal message corresponding to the interface associated with the test message, so that a user determines abnormal test message based on the risk test message information; the test message obtaining unit is further configured to obtain a repair test message of application testing through repair test message replay, the repair test message being a message obtained after the user repairs the abnormal test message; if the repair test message does not match the interface legal message or the legal message library does not have an interface legal message corresponding to the interface associated with the repair test message, the repair test message is determined as a message of abnormal risk and is outputted, so that the user judges the legality of the repair test message, the interface legal message being an interface legal message corresponding to the interface associated with the repair test message and obtained from the legal message library; if a legal indication of the user for the repair test message is received, the repair test message is stored in the legal message library, the legal indication indicating that the user confirms that the repair test message is a legal message.
7. The apparatus of claim 6, wherein, Further comprise: a capture function adding unit, configured to add a capture function for an interface to be tested in an application before the test message obtaining unit obtains at least one test message collected during the test process, wherein the capture function of the interface is used to capture at least one of an input message and an output message of the interface; the test message obtaining unit comprises: a message capturing unit, configured to obtain an interface-related message through a capture function corresponding to an interface to be tested in an application during testing of the application, and take the obtained message as a test message associated with the interface, the interface-related message including at least one of an input message and an output message of the interface.
8. A computer device, comprising: comprise a memory and a processor; the memory is used to store a program; the processor is used to execute the program, and realize the test message processing method in any one of claims 1-5.
9. A readable storage medium, having stored thereon a computer program, characterized in that, The computer program is executed by the processor, and realizes the test message processing method in any one of claims 1-5. The computer program is executed by the processor, and realizes the test message processing method in any one of claims 1-5.
Citation Information
Patent Citations
Test method and device and front-end computer
CN107688537A
Abnormal message detection method and device, electronic equipment and medium
CN113132331A