Test method and device, computer equipment and computer readable storage medium

By obtaining historical messages from the end-to-end message flow database and processing them using the virtual system, extracting and matching message key values, the problem of complex test processes and low efficiency during the software system transformation process is solved, and automated testing and efficiency improvement are achieved. .

CN111737133BInactive Publication Date: 2024-10-11BANK OF CHINA
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202010584783.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-24
Publication Date
2024-10-11
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

During the transformation process of the software system, the testing process was complex and the testing efficiency was not high. In particular, the middle-end system had difficulty in coordinating multiple systems on the transaction link and the test cases in different scenarios took a long time.

Method used

By obtaining historical message records from the end-to-end message flow database, the virtual system processes the original request message and response message, uses the pre-configured message format to extract the message key value, and matches the original response message to achieve automation. Test, simplify the testing process and increase efficiency.

Benefits of technology

It realizes end-to-end automated testing of software systems during the transformation process, simplifies the testing process, improves testing efficiency, and can conduct automated testing when external systems or equipment are not available or cannot be obtained in time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111737133B_ABST
    Figure CN111737133B_ABST
Patent Text Reader

Abstract

The present invention discloses a testing method and device, a computer device and a computer-readable storage medium. The testing method comprises: a first system sends an original request message acquired in the previous time to a software system to be tested; a second system receives a first intermediate message obtained after the software system to be tested parses the original request message; the second system extracts the message key value of the first intermediate message according to a message key value extraction method corresponding to a pre-configured message format; the second system returns the original response message matched from a historical message record table to the software system to be tested according to the message key value of the first intermediate message; the first system receives the second intermediate message obtained after the software system to be tested parses the original response message. The present invention uses a virtual system to perform automated testing to improve testing efficiency. The second system matches the original response message according to the message key value, simplifies the test process after the software system to be tested is modified, and improves testing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software testing, and in particular to a testing method and apparatus, a computer device and a computer-readable storage medium. Background Art

[0002] This section is intended to provide a background or context to the embodiments of the invention recited in the claims. No admission is made that the description herein is prior art by inclusion in this section.

[0003] The transformation of software systems often involves compatibility transformation of the platform rather than functional transformation. In order to ensure that the software system functions properly, testers need to test all functional scenarios supported by the software system. For software systems, especially middle-end systems in the complete transaction chain, on the one hand, it is difficult to coordinate and cooperate with the many systems involved in the transaction chain, resulting in a more complicated testing process; on the other hand, it takes a long time to create test cases suitable for different scenarios, resulting in low testing efficiency.

[0004] Therefore, the existing software system has problems of complex testing process and low testing efficiency during the transformation process. Summary of the invention

[0005] An embodiment of the present invention provides a testing method for simplifying the testing process of a software system during transformation and improving testing efficiency. The testing method includes:

[0006] Obtaining a historical message record table within a preset time period from an end-to-end message flow database;

[0007] The first system sends the original request message with a previous time obtained from the historical message record table to the software system to be tested; the original request message in the historical message record table is the original request message sent by the real business system corresponding to the first system to the software system to be tested before the transformation at a previous time; the first system includes one or more upstream systems, and when the first system includes multiple upstream systems, the multiple upstream systems are processed in parallel;

[0008] The second system receives the first intermediate message obtained after the software system to be tested parses the original request message; the second system includes one or more downstream systems, and when the second system includes multiple downstream systems, the multiple downstream systems are processed in parallel; the first system and the second system are respectively connected to the software system to be tested in a communication manner through TCP;

[0009] The second system extracts the message key value of the first intermediate message according to the message key value extraction method corresponding to the pre-configured message format; the message key value extraction method corresponding to the pre-configured message format includes: extracting the requester serial number according to the specified position of the fixed-length format message, combining the identification field value with the transaction time, or combining the identification field value with the transaction party ID as the message key value of the fixed-length format message;

[0010] The second system returns the original response message matched from the historical message record table to the software system to be tested according to the message key value of the first intermediate message, including: extracting all the message key values ​​corresponding to the messages in the historical message record table in advance, and determining the correspondence between the messages and the message key values ​​in the historical message record table; based on the correspondence between the message key values ​​and the messages, directly matching the original response message corresponding to the message key value of the first intermediate message and returning it to the software system to be tested;

[0011] The first system receives a second intermediate message obtained after the software system to be tested parses the original response message;

[0012] Among them, the first system and the second system are both virtual systems; the value of the message key value of the original request message and the second intermediate message is consistent, and the value of the message key value of the intermediate message and the original response message is the same.

[0013] The embodiment of the present invention further provides a testing device for simplifying the testing process of the software system during the transformation process and improving the testing efficiency. The testing device includes:

[0014] The first system and the second system; wherein the first system and the second system are both virtual systems; the first system includes one or more upstream systems, and when the first system includes multiple upstream systems, the multiple upstream systems are processed in parallel; the second system includes one or more downstream systems, and when the second system includes multiple downstream systems, the multiple downstream systems are processed in parallel; the first system and the second system are respectively connected to the software system to be tested in a communication manner via TCP;

[0015] The first system is used to obtain a historical message record table within a preset time period from an end-to-end message flow database; send an original request message with a previous time obtained from the historical message record table to the software system to be tested; the original request message in the historical message record table is an original request message sent by a real business system corresponding to the first system to the software system to be tested before the transformation at a previous time;

[0016] The second system is used to receive a first intermediate message obtained after the software system to be tested parses the original request message;

[0017] The second system is further used to extract the message key value of the first intermediate message according to the message key value extraction method corresponding to the pre-configured message format; the message key value extraction method corresponding to the pre-configured message format includes: extracting the requester serial number according to the specified position of the fixed-length format message, combining the identification field value with the transaction time, or combining the identification field value with the transaction party ID as the message key value of the fixed-length format message;

[0018] The second system is also used to return the original response message matched from the historical message record table to the software system to be tested according to the message key value of the first intermediate message, including: extracting all the message key values ​​corresponding to the messages in the historical message record table in advance, and determining the corresponding relationship between the messages and the message key values ​​in the historical message record table;

[0019] Based on the correspondence between the message key value and the message, directly matching the original response message corresponding to the message key value of the first intermediate message is returned to the software system to be tested;

[0020] The first system is also used to receive a second intermediate message obtained after the software system to be tested parses the original response message; the message key values ​​of the original request message and the second intermediate message are consistent, and the message key values ​​of the intermediate message and the original response message are the same.

[0021] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned test method when executing the computer program.

[0022] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and the computer program implements the above-mentioned test method when executed by a processor.

[0023] In the embodiment of the present invention, when the external system or external device does not have or cannot be obtained in time, the virtual first system and the second system are used to process the original request message and the original response message, which can directly separate from the external system or the external device for automated testing, thereby improving the testing efficiency. In addition, the second system extracts the message key value of the first intermediate message based on the pre-configured message key value extraction method, and matches the original response message from the historical message record table according to the message key value, which can simplify the testing process of the software system to be tested after the transformation, improve the testing efficiency, and realize the end-to-end automated testing of the first system and the software system to be tested, and realize the end-to-end automated testing of the software system to be tested and the second system. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0025] Figure 1 A flowchart for implementing the testing method provided in the embodiment of the present invention;

[0026] Figure 2 Another implementation flow chart of the testing method provided by the embodiment of the present invention;

[0027] Figure 3 A flowchart for implementing a method for extracting message key values ​​corresponding to a message format pre-configured in a test method provided in an embodiment of the present invention;

[0028] Figure 4 A partial implementation flow chart of another testing method provided by an embodiment of the present invention;

[0029] Figure 5 A partial implementation flow chart of another testing method provided by an embodiment of the present invention;

[0030] Figure 6 A functional module diagram of a test device provided by an embodiment of the present invention;

[0031] Figure 7 Another functional module diagram of the testing device provided by the embodiment of the present invention;

[0032] Figure 8 A diagram of some functional modules in the test device provided in an embodiment of the present invention;

[0033] Fig. 9 A partial functional module diagram of another test device provided by an embodiment of the present invention;

[0034] Fig.10 A partial functional module diagram of yet another testing device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0035] To make the purpose, technical solution and advantages of the embodiments of the present invention more clear, the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings. Here, the exemplary embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0036] Figure 1 The implementation process of the test method provided by the embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0037] like Figure 1 As shown, the test method comprises:

[0038] Step 101, the first system 601 sends the original request message with an earlier time obtained from the historical message record table to the software system to be tested;

[0039] Step 102, the second system 602 receives a first intermediate message obtained after the software system to be tested parses the original request message;

[0040] Step 103, the second system 602 extracts the message key value of the first intermediate message according to the message key value extraction method corresponding to the pre-configured message format;

[0041] Step 104, the second system 602 returns the original response message matched from the historical message record table to the software system to be tested according to the message key value of the first intermediate message;

[0042] Step 105, the first system 601 receives a second intermediate message obtained after the software system to be tested parses the original response message;

[0043] The first system 601 and the second system 602 are virtual systems.

[0044] In the embodiment of the present invention, the first system and the second system are respectively connected to the software system to be tested for communication. Specifically, for example, the first system and the second system are respectively connected to the software system to be tested for communication via TCP.

[0045] When testing the software system to be tested, the first system 601 first obtains the original request message with the previous time from the historical message record table according to the chronological order. The original request message in the historical message record table is the original request message sent by the real business system corresponding to the first system 601 to the software system to be tested before the transformation at the previous time.

[0046] After the first system 601 obtains the original record message with an earlier time from the historical message record table, the first system 601 sends the original request message with an earlier time to the software system to be tested. After receiving the original request message sent by the first system 601, the software system to be tested further parses the original request message sent by the first system 601 to obtain the first intermediate message.

[0047] The software system to be tested sends the first intermediate message obtained by parsing the original request message to the second system 602. After receiving the first intermediate message sent by the software system to be tested, the second system 602 identifies and analyzes the message format of the first intermediate message, and then extracts the message key value of the first intermediate message based on the message key value extraction method corresponding to the pre-configured message format. The message key value refers to the key value msgkey that matches the message.

[0048] After extracting the message key value of the first intermediate message, the second system 602 performs a match in the historical message record table based on the message key value of the first intermediate message, and returns the matched original response message to the software system to be tested. The value of the message key value of the first intermediate message is the same as the value of the message key value of the original response message, so the original response message can be matched based on the message key value of the first intermediate message.

[0049] In order to improve the message matching efficiency and thus improve the testing efficiency, based on the above method steps, the testing method further includes:

[0050] The message key value corresponding to the message in the historical message record table is extracted according to the message key value extraction method corresponding to the pre-configured message format.

[0051] That is, when the second system 602 matches the original response message in the historical message record table according to the message key value of the first intermediate message, all the message key values ​​corresponding to the message in the historical message record table can be extracted in advance to determine the correspondence between the message and the message key value in the historical message record table. In this way, when the second system 602 matches the original response message in the historical message record table according to the message key value of the first intermediate message, it can directly match the original response message corresponding to the message key value of the first intermediate message based on the correspondence between the message key value and the message, thereby improving the message matching efficiency and further improving the test efficiency. The original response message in the historical message record table is the original response message that the real business system corresponding to the second system 602 returned to the software system to be tested before the transformation at a previous time.

[0052] After matching the original response message, the second system 602 returns the matched original response message to the software system to be tested. After receiving the original response message returned by the second system 602, the software system to be tested parses the original response message to obtain the second intermediate message, and then the software system to be tested returns the second intermediate message obtained by parsing the original response message to the first system 601. It can be understood that the message key value of the message between the end-to-end in the same transaction process is consistent, that is, the message key value of the original request message is consistent with the message key value of the second intermediate message, and the message key value of the intermediate message and the original response message is the same. At this point, the automated testing of the first system 601 and the software system to be tested, and the automated testing of the second system 602 and the software system to be tested are realized.

[0053] In the embodiment of the present invention, when the external system or external device is not available or cannot be obtained in time, the virtual first system 601 and the second system 602 are used to process the original request message and the original response message, and the automatic test can be directly separated from the external system or the external device, thereby improving the test efficiency. In addition, the second system 602 extracts the message key value of the first intermediate message based on the pre-configured message key value extraction method, and matches the original response message from the historical message record table according to the message key value, which can simplify the test process of the software system to be tested after the transformation, improve the test efficiency, realize the end-to-end automatic test of the first system 601 and the software system to be tested, and realize the end-to-end automatic test of the software system to be tested and the second system 602.

[0054] In the embodiment of the present invention, the first system 601 includes one or more upstream systems. In order to further improve the test efficiency, when the first system 601 includes multiple upstream systems, the multiple upstream systems are processed in parallel.

[0055] In the embodiment of the present invention, the second system 602 includes one or more downstream systems. In order to further improve the test efficiency, when the second system 602 includes multiple downstream systems, the multiple downstream systems are processed in parallel.

[0056] Figure 2 Another implementation process of the test method provided by the embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0057] In one embodiment of the present invention, in order to further improve the test efficiency, Figure 2 As shown, based on the above method steps, the testing method also includes:

[0058] Step 201, obtaining a historical message record table within a preset time period from an end-to-end message flow database.

[0059] When obtaining the historical message record table, it can be obtained from the end-to-end message flow database. Specifically, the historical message record table within a preset time period can be obtained from the end-to-end message flow database. For example, the historical message record table within a week from the current moment, or the historical message record table within a day from the current moment, etc. can be obtained from the end-to-end message flow database.

[0060] In the embodiment of the present invention, the historical message record table within a preset time period is obtained from the end-to-end message flow database, which can further improve the test efficiency.

[0061] Figure 3 The implementation process of the message key value extraction method corresponding to the pre-configured message format in the test method provided in the embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0062] In one embodiment of the present invention, in order to further improve the test efficiency, Figure 3 As shown, the message key value extraction method corresponding to the pre-configured message format includes:

[0063] Step 301, determining a message key value of a fixed-length format message according to an identification field value in the fixed-length format message; the identification field value uniquely identifies different fixed-length format messages; and / or

[0064] Step 302, extracting the message key value of the 8583 format message according to the field domain of the 8583 format message; and / or

[0065] Step 303: extract the message key value of the json format message or the xml format message according to the field or label at the predetermined position of the json format message or the xml format message.

[0066] When extracting the message key value corresponding to the message, the message key value may be extracted based on the message format. Specifically, at least the following three situations may be included:

[0067] (1) When the format message is a fixed-length format message:

[0068] Generally, the transaction requester will ensure the uniqueness of the requester serial number within a period of time. Therefore, when the format message is a fixed-length format message, the requester serial number can be extracted according to the specified position of the fixed-length format message as the message key value of the fixed-length format message. In addition, it can be understood that the fixed-length format message may also include other identification field values ​​in addition to the above-mentioned requester serial number. The identification field value can uniquely identify different transactions (i.e., the fixed-length format message corresponding to the transaction) within a period of time. Therefore, the identification field value can also be used as the message key value of the fixed-length format message, or the identification field value can be processed in some form (for example, the combination of the identification field value and the transaction time, or the combination of the identification field value and the transaction party ID, etc.) as the message key value of the fixed-length format message.

[0069] (2) When the format message is 8583 format message:

[0070] The 8583 format message can be processed and extracted according to the MTI field, 2 field, 3 field, 7 field, 11 field, 32 field and 33 field to extract the message key value of the 8583 format message.

[0071] (3) JSON format message or XML format message:

[0072] When the format message is a json format message or an xml format message, the message key value may be extracted from a field or a tag at a predetermined position of the json format message or the xml format message.

[0073] It will be understood by those skilled in the art that when the format message is a message of another format, the message key value of the message of another format can be extracted based on the corresponding method, and it is only necessary to ensure that the message key value of the same end-to-end format message in the same transaction process is consistent.

[0074] In an embodiment of the present invention, the message key value of a fixed-length format message is determined according to the identification field value in the fixed-length format message, the message key value of an 8583 format message is extracted according to the field domain of the 8583 format message, and the message key value of a json format message or an xml format message is extracted from a domain or tag at a predetermined position of the json format message or the xml format message. Extracting message key values ​​of messages of different formats based on different extraction methods can further improve testing efficiency.

[0075] Figure 4 The following is a partial implementation flow of another test method provided by an embodiment of the present invention. For ease of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0076] In one embodiment of the present invention, in order to facilitate test analysis, Figure 4 As shown, based on the above method steps, the testing method also includes:

[0077] Step 401, the first system 601 records the timestamp of the original request message sent to the software system to be tested; and / or

[0078] Step 402, the first system 601 records the timestamp of receiving the second intermediate message returned by the software system to be tested; and / or

[0079] Step 403, the second system 602 records the timestamp of receiving the first intermediate message sent by the software system to be tested; and / or

[0080] Step 404: the second system 602 records the timestamp of the original response message returned to the software system under test.

[0081] In the embodiment of the present invention, in order to facilitate testing and analysis, the first system 601 and the second system 602 can record the timestamps of message sending and receiving. It is understandable that there is no specific execution order between step 401 and step 404, and steps 401 to 404 can be executed simultaneously after step 105 is executed.

[0082] After executing step 101 in which the first system 601 sends the original request message to the software system to be tested, step 401 is executed, that is, the timestamp of sending the original request message to the software system to be tested is recorded in a timely manner.

[0083] After executing step 102 in which the second system 602 receives the first intermediate message returned by the software system to be tested, step 403 is executed, that is, the second system 602 timely records the timestamp of receiving the first intermediate message sent by the software system to be tested.

[0084] After executing step 104 and the second system 602 returns the original response message to the software system to be tested, step 404 is executed, that is, the second system 602 promptly records the timestamp of the original response message returned to the software system to be tested.

[0085] After executing step 105 in which the first system 601 receives the second intermediate message returned by the software system to be tested, step 402 is executed, that is, the first system 601 timely records the timestamp of receiving the second intermediate message returned by the software system to be tested.

[0086] In an embodiment of the present invention, the first system 601 records the timestamp of the original request message sent to the software system to be tested, the first system 601 records the timestamp of receiving the second intermediate message returned by the software system to be tested, the second system 602 records the timestamp of receiving the first intermediate message sent by the software system to be tested, and the second system 602 records the timestamp of the original response message returned to the software system to be tested, to facilitate test analysis based on timestamps.

[0087] Figure 5 The following is a partial implementation flow of another test method provided by an embodiment of the present invention. For ease of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0088] In one embodiment of the present invention, in order to further improve the test efficiency, Figure 5 As shown, based on the above method steps, the testing method also includes:

[0089] Step 501, configuring the message format of the first system 601 and the message key value extraction method corresponding to the message format according to the received first configuration instruction; and / or

[0090] Step 502: configure the message format of the second system 602 and the message key value extraction method corresponding to the message format according to the received second configuration instruction.

[0091] When configuring the message format and the message key value extraction method corresponding to the message format, the message format and the message key value extraction method corresponding to the message format can be configured based on the received configuration instruction. For example, after receiving the first configuration instruction issued by the configuration user, the message format of the first system 601 and the message key value extraction method corresponding to the message format are configured based on the first configuration instruction; after receiving the second configuration instruction issued by the configuration user, the message format of the second system 602 and the message key value extraction method corresponding to the message format are configured based on the second configuration instruction.

[0092] In an embodiment of the present invention, the message format of the first system 601 and the message key value extraction method corresponding to the message format are configured according to the received first configuration instruction, and the message format of the second system 602 and the message key value extraction method corresponding to the message format are configured according to the received second configuration instruction, which can further improve the testing efficiency.

[0093] The present invention also provides a testing device, as described in the following embodiments. Since the principles of solving the problems by these devices are similar to those of the testing methods, the implementation of these devices can refer to the implementation of the methods, and the repeated parts will not be repeated.

[0094] Figure 6 The functional modules of the test device provided by the embodiment of the present invention are shown. For the convenience of description, only the parts related to the embodiment of the present invention are shown, which are described in detail as follows:

[0095] refer to Figure 6 The modules included in the test device are used to perform Figure 1 For details of each step in the corresponding embodiment, please refer to Figure 1 as well as Figure 1The relevant descriptions in the corresponding embodiments are not repeated here. In the embodiment of the present invention, the test device includes a first system 601 and a second system 602. The first system 601 and the second system 602 are both virtual systems.

[0096] The first system 601 is used to send the original request message with an earlier time obtained from the historical message record table to the software system to be tested.

[0097] The second system 602 is used to receive a first intermediate message obtained after the software system to be tested parses the original request message;

[0098] The second system 602 is further configured to extract the message key value of the first intermediate message according to the message key value extraction method corresponding to the pre-configured message format;

[0099] The second system 602 is further configured to return the original response message matched from the historical message record table to the software system to be tested according to the message key value of the first intermediate message;

[0100] The first system 601 is further configured to receive a second intermediate message obtained after the software system to be tested parses the original response message.

[0101] In the embodiment of the present invention, when the external system or external device is not available or cannot be obtained in time, the virtual first system 601 and the second system 602 are used to process the original request message and the original response message, and the automatic test can be directly separated from the external system or the external device, thereby improving the test efficiency. In addition, the second system 602 extracts the message key value of the first intermediate message based on the pre-configured message key value extraction method, and matches the original response message from the historical message record table according to the message key value, which can simplify the test process of the software system to be tested after the transformation, improve the test efficiency, realize the end-to-end automatic test of the first system 601 and the software system to be tested, and realize the end-to-end automatic test of the software system to be tested and the second system 602.

[0102] In the embodiment of the present invention, the first system 601 includes one or more upstream systems. In order to further improve the test efficiency, when the first system 601 includes multiple upstream systems, the multiple upstream systems are processed in parallel.

[0103] In the embodiment of the present invention, the second system 602 includes one or more downstream systems. In order to further improve the test efficiency, when the second system 602 includes multiple downstream systems, the multiple downstream systems are processed in parallel.

[0104] Figure 7 Another functional module of the test device provided by the embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:

[0105] In one embodiment of the present invention, in order to further improve the test efficiency, reference Figure 7 The modules included in the test device are used to perform Figure 2 For details of each step in the corresponding embodiment, please refer to Figure 2 as well as Figure 2 In the embodiment of the present invention, based on the above module structure, the test device further includes an acquisition module 701 .

[0106] The acquisition module 701 is used to acquire a historical message record table within a preset time period from an end-to-end message flow database.

[0107] In the embodiment of the present invention, the acquisition module 701 acquires the historical message record table within a preset time period from the end-to-end message flow database, which can further improve the test efficiency.

[0108] Figure 8 The following is a schematic diagram of some functional modules in the test device provided by the embodiment of the present invention. For the convenience of explanation, only the parts related to the embodiment of the present invention are shown, which are described in detail as follows:

[0109] In one embodiment of the present invention, in order to further improve the test efficiency, reference Figure 8 The modules included in the test device are used to perform Figure 3 For details of each step in the corresponding embodiment, please refer to Figure 3 as well as Figure 3 In the embodiment of the present invention, based on the above module structure, the test device further includes a first extraction module 801 , a second extraction module 802 and a third extraction module 803 .

[0110] The first extraction module 801 is used to determine the message key value of the fixed-length format message according to the value of the identification field in the fixed-length format message. And / or

[0111] The second extraction module 802 is used to extract the message key value of the 8583 format message according to the field domain of the 8583 format message.

[0112] and / or

[0113] The third extraction module 803 is used to extract the message key value of the json format message or the xml format message according to the field or label at the predetermined position of the json format message or the xml format message.

[0114] In an embodiment of the present invention, the first extraction module 801 determines the message key value of the fixed-length format message according to the identification field value in the fixed-length format message, the second extraction module 802 extracts the message key value of the 8583 format message according to the field domain of the 8583 format message, and the third extraction module 803 extracts the message key value of the json format message or the xml format message according to the field or tag at a predetermined position of the json format message or the xml format message. Extracting message key values ​​of messages of different formats based on different extraction methods can further improve the testing efficiency.

[0115] Fig. 9 Part of the functional modules of another test device provided by an embodiment of the present invention is shown. For ease of description, only the parts related to the embodiment of the present invention are shown, which are described in detail as follows:

[0116] In one embodiment of the present invention, in order to facilitate test analysis, reference is made to Fig. 9 The modules included in the test device are used to perform Figure 4 For details of each step in the corresponding embodiment, please refer to Figure 4 as well as Figure 4 In the embodiment of the present invention, based on the above module structure, the test device further includes a first recording module 901 , a second recording module 902 , a third recording module 903 and a fourth recording module 904 .

[0117] The first recording module 901 is used to record the timestamp of the original request message sent to the software system to be tested. And / or

[0118] The second recording module 902 is used to record the timestamp of receiving the second intermediate message returned by the software system to be tested. And / or

[0119] The third recording module 903 is used to record the timestamp of receiving the first intermediate message sent by the software system to be tested. And / or

[0120] The fourth recording module 904 is used to record the timestamp of the original response message returned to the software system to be tested.

[0121] In an embodiment of the present invention, the first recording module 901 records the timestamp of the original request message sent to the software system to be tested, the second recording module 902 records the timestamp of the second intermediate message returned by the software system to be tested, the third recording module 903 records the timestamp of the first intermediate message sent by the software system to be tested, and the fourth recording module 904 records the timestamp of the original response message returned to the software system to be tested, so as to facilitate test analysis based on timestamps.

[0122] Fig.10Some functional modules of another test device provided by an embodiment of the present invention are shown. For ease of description, only the parts related to the embodiment of the present invention are shown, which are described in detail as follows:

[0123] In one embodiment of the present invention, in order to further improve the test efficiency, reference Fig.10 The modules included in the test device are used to perform Figure 5 For details of each step in the corresponding embodiment, please refer to Figure 5 as well as Figure 5 In the embodiment of the present invention, based on the above module structure, the test device further includes a first configuration module 1001 and a second configuration module 1002 .

[0124] The first configuration module 1001 is used to configure the message format of the first system 601 and the message key value extraction method corresponding to the message format according to the received first configuration instruction. And / or

[0125] The second configuration module 1002 is used to configure the message format of the second system 602 and the message key value extraction method corresponding to the message format according to the received second configuration instruction.

[0126] In an embodiment of the present invention, the first configuration module 1001 configures the message format of the first system 601 and the message key value extraction method corresponding to the message format according to the received first configuration instruction, and the second configuration module 1002 configures the message format of the second system 602 and the message key value extraction method corresponding to the message format according to the received second configuration instruction, which can further improve the testing efficiency.

[0127] An embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-mentioned test method when executing the computer program.

[0128] An embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program for executing the above-mentioned test method.

[0129] In summary, in the embodiment of the present invention, when the external system or external device does not have or cannot be obtained in time, the virtual first system 601 and the second system 602 are used to process the original request message and the original response message, which can directly separate from the external system or the external device for automated testing, thereby improving the testing efficiency. In addition, the second system 602 extracts the message key value of the first intermediate message based on the pre-configured message key value extraction method, and matches the original response message from the historical message record table according to the message key value, which can simplify the testing process of the software system to be tested after the transformation, improve the testing efficiency, realize the end-to-end automated testing of the first system 601 and the software system to be tested, and realize the end-to-end automated testing of the software system to be tested and the second system 602.

[0130] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0131] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0132] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0133] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0134] The specific embodiments described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A testing method, characterized in that: include: Obtaining a historical message record table within a preset time period from an end-to-end message flow database; The first system sends an original request message obtained from a historical message record table with a previous time to the software system under test; the original request message in the historical message record table is the original request message sent by the real business system corresponding to the first system to the software system under test before the transformation at a previous time; the first system includes one or more upstream systems, and when the first system includes multiple upstream systems, the multiple upstream systems process in parallel; The second system receives a first intermediate message obtained after the software system under test parses the original request message; the second system includes one or more downstream systems. When the second system includes multiple downstream systems, the multiple downstream systems process in parallel; The first system and the second system are respectively connected to the software system to be tested via TCP; The second system extracts the message key value of the first intermediate message according to the message key value extraction method corresponding to the pre-configured message format; A method for extracting a message key value corresponding to a pre-configured message format includes: extracting the requester serial number from a specified position in a fixed-length format message, using a combination of an identifier field value and a transaction time, or a combination of an identifier field value and a transactor ID as a message key value for the fixed-length format message; The second system returns the original response message matched from the historical message record table to the software system under test based on the message key value of the first intermediate message, including: pre-extracting all message key values ​​corresponding to the messages in the historical message record table, determining the correspondence between the messages and the message key values ​​in the historical message record table; and directly matching the original response message corresponding to the message key value of the first intermediate message based on the correspondence between the message key values ​​and the messages, returning it to the software system under test; The first system receives a second intermediate message obtained after the software system under test parses the original response message; The first system and the second system are both virtual systems; the message key values ​​of the original request message and the second intermediate message are consistent, and the message key values ​​of the intermediate message and the original response message are the same.

2. The testing method according to claim 1, wherein: The message key value extraction method corresponding to the pre-configured message format includes: Determining a message key value of the fixed-length format message according to an identification field value in the fixed-length format message; the identification field value uniquely identifies different fixed-length format messages; and / or Extracting the message key value of the 8583 format message according to the field domain of the 8583 format message; and / or Extract the message key value of the JSON format message or the XML format message according to the field or label at the predetermined position of the JSON format message or the XML format message.

3. The testing method according to claim 1, wherein: Also includes: The first system records the timestamp of the original request message sent to the software system to be tested; and / or The first system records a timestamp of receiving the second intermediate message returned by the software system to be tested; and / or The second system records the timestamp of receiving the first intermediate message sent by the software system to be tested; and / or The second system records the timestamp of the original response message returned to the software system to be tested.

4. The testing method according to claim 1, wherein: Also includes: Configuring a message format of the first system and a message key value extraction method corresponding to the message format according to the received first configuration instruction; and / or The message format of the second system and the message key value extraction method corresponding to the message format are configured according to the received second configuration instruction.

5. A testing device, characterized in that: include: The first system and the second system; wherein the first system and the second system are both virtual systems; the first system includes one or more upstream systems, and when the first system includes multiple upstream systems, the multiple upstream systems are processed in parallel; the second system includes one or more downstream systems, and when the second system includes multiple downstream systems, the multiple downstream systems are processed in parallel; the first system and the second system are respectively connected to the software system to be tested via TCP; The first system is configured to obtain a historical message record table within a preset time period from an end-to-end message flow database; and to send an original request message obtained from the historical message record table with a previous time to the software system to be tested; the original request message in the historical message record table is an original request message sent by a real business system corresponding to the first system to the software system to be tested before the modification at a previous time; The second system is configured to receive a first intermediate message obtained after the software system to be tested parses the original request message; The second system is further configured to extract a message key value from the first intermediate message according to a pre-configured message key value extraction method corresponding to the message format; the pre-configured message key value extraction method corresponding to the message format includes: extracting the requester serial number from a specified position in the fixed-length format message, using a combination of an identifier field value and a transaction time, or a combination of an identifier field value and a transactor ID as the message key value for the fixed-length format message; The second system is further configured to return an original response message matched from the historical message record table to the software system under test based on the message key value of the first intermediate message, including: pre-extracting all message key values ​​corresponding to the messages in the historical message record table, determining a correspondence between the messages and the message key values ​​in the historical message record table; and directly matching an original response message corresponding to the message key value of the first intermediate message based on the correspondence between the message key values ​​and the messages, and returning the original response message to the software system under test; The first system is also used to receive a second intermediate message obtained after the software system to be tested parses the original response message; the message key values ​​of the original request message and the second intermediate message are consistent, and the message key values ​​of the intermediate message and the original response message are the same.

6. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the testing method according to any one of claims 1 to 4 is implemented.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the testing method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Response testing method and device

    CN106487603A

  • Performance test method of computer network application program

    CN107179995A

  • Network request testing method and device, computer equipment and storage medium

    CN108848000A

  • Test data generation method and device, computer equipment and storage medium

    CN110730107A

  • Question and answer system test method and device, computer equipment and storage medium

    CN111124898A