System testing method, device, equipment and medium

By directly retrieving response messages from transaction logs during system testing, the problem of untested request-response transmission between the system under test and related systems is solved, achieving higher test completeness and accuracy, and improving the efficiency of parallel testing.

CN112084109BActive Publication Date: 2024-11-19CHINA UNIONPAY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010904003.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-09-01
Publication Date
2024-11-19
Estimated Expiration
2040-09-01

AI Technical Summary

Technical Problem

Existing system testing methods fail to fully consider the request-response transmission between the system under test and related systems, resulting in poor completeness and accuracy of test results, especially when related systems affect the response results output by the system under test.

Method used

By extracting request messages from pre-stored transaction logs, the system can directly search for response messages that match the actual request messages in the transaction logs and return them to the system under test. This avoids complex logical operations on the request messages and allows for direct comparison of test records and transaction logs to obtain test results.

Benefits of technology

It improves the completeness and accuracy of system testing, reduces the impact of related systems on test results, enables independent testing, and improves the efficiency and accuracy of parallel testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112084109B_ABST
    Figure CN112084109B_ABST
Patent Text Reader

Abstract

The present application discloses a system testing method, device, equipment and medium, belonging to the field of testing. The method includes: extracting a first request message from a pre-stored first transaction log and sending it to the system under test; receiving a second request message sent by the system under test, the second request message is a message generated by the system under test according to the first request message; obtaining a first response message according to the second request message; the first response message is a response message found from the first transaction log and matching the characteristic data of the second request message; returning the first response message to the system under test; receiving a second response message output by the system under test, the second response message is a message generated by the system under test according to the first response message; comparing the test record with the first transaction log to obtain the test result; the test record includes at least any one of the following: a second request message, a second response message. The present application can improve the accuracy and completeness of the test.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of testing, and specifically relates to a system testing method, device, equipment and medium. Background Art

[0002] When testing the system under test, in many scenarios the system under test needs to interact with the associated system, that is, the system under test sends a request to the associated system and receives a response from the associated system. The system under test then processes the response based on the response from the associated system and outputs the final response result.

[0003] However, in the current testing process, only the requests and responses between the system under test and external organizations are tested, but the requests and responses transmitted between the system under test and the associated systems are not tested, which results in poor test integrity. In addition, the response results output by the system under test are affected by the associated systems, which can easily lead to inaccurate test results. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a system testing method, device, equipment and medium that can solve the problem of poor integrity and accuracy of test results.

[0005] In order to solve the above technical problems, this application is implemented as follows:

[0006] In a first aspect, an embodiment of the present application provides a system testing method, the method comprising:

[0007] Extracting a first request message from a pre-stored first transaction log and sending it to the system under test;

[0008] receiving a second request message sent by the system under test, where the second request message is a message generated by the system under test according to the first request message;

[0009] Obtaining a first response message according to the second request message; the first response message is a response message found from the first transaction log and matching the characteristic data of the second request message;

[0010] Returning the first response message to the system under test;

[0011] receiving a second response message output by the system under test, where the second response message is a message generated by the system under test according to the first response message;

[0012] Compare the test record with the first transaction log to obtain a test result; wherein the test record includes at least any one of the following: the second request message, the second response message.

[0013] In a second aspect, an embodiment of the present application provides a system testing device, the device comprising:

[0014] A request sending module, used for extracting a first request message from a pre-stored first transaction log and sending it to a system under test;

[0015] A request receiving module, used to receive a second request message sent by the system under test, where the second request message is a message generated by the system under test according to the first request message;

[0016] a response acquisition module, configured to acquire a first response message according to the second request message; the first response message is a response message found in the first transaction log and matching the characteristic data of the second request message;

[0017] A response returning module, used for returning the first response message to the system under test;

[0018] A response receiving module, used for receiving a second response message output by the system under test, where the second response message is a message generated by the system under test according to the first response message;

[0019] A comparison module is used to compare the test record with the first transaction log to obtain a test result; wherein the test record includes at least any one of the following: the second request message, the second response message.

[0020] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0021] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0022] In an embodiment of the present application, after sending a first request message in a first transaction log to the system under test, a second request message generated by the system under test based on the first request message can be received, and the second request message is not subsequently logically processed. Instead, a first response message matching the characteristic data of the second request message is directly searched from a pre-stored transaction log and returned to the system under test, and a second response message output by the system under test is received. Finally, the test record is compared with the first transaction log to complete the system test.

[0023] It can be seen that in the embodiment of the present application, the second request message is a request message between the system under test and the associated system during actual production. The present application does not need to perform complex logical operations on the second request message, but directly finds the response message corresponding to the second request message in the pre-stored transaction log based on the characteristic data of the second request message and returns it to the system under test. In this case, if an error occurs in the second request message, the first response message cannot be found, so that the system under test cannot output the second response message normally. By comparing the second request message and any one of the second response messages, the purpose of testing the request response transmitted between the system under test and the associated system can be achieved, thereby improving the integrity of the test. In addition, since the present application does not perform the logical operations that will be performed in the associated system on the second request message, the response result will not be affected by the associated system, and the accuracy of the test result is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0025] Figure 1 It is a schematic diagram of parallel testing in the related art;

[0026] Figure 2 It is a schematic diagram of the interaction between the system under test and the associated system;

[0027] Figure 3 is a schematic diagram of a system testing method provided by an embodiment of the present application;

[0028] Figure 4 is a structural schematic diagram of a system testing device provided by yet another embodiment of the present application;

[0029] Figure 5 It is a structural schematic diagram of an electronic device provided in yet another embodiment of the present application. DETAILED DESCRIPTION

[0030] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only configured to explain the present application and are not configured to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0031] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "include..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0032] Currently, for the testing work of the system to be tested, testers usually write request message styles based on the system requirement documents and other relevant information, and form a large number of test cases. They test the system to be tested through tools such as jmeter. For the continuously iterative versions, regression testing is also required.

[0033] The current regression test mainly uses previous test cases to conduct large-scale regression. In order to supplement the test effect of regression testing, parallel testing will be introduced in the test process, that is, the production transactions are replayed in the test environment, and the quality of the system to be tested is determined by comparing the actual production transaction results with the test results. Since the existing system has become standardized in terms of log printing, the input and output content of the system has become a normal operation that must be printed or written into the system log, so the input and output content in the production transaction is easy to collect through the log, which facilitates subsequent parallel testing.

[0034] Existing parallel testing practices such as Figure 1 As shown, Figure 1 It is a schematic diagram of parallel testing in related technologies. First, a test environment is built, and the system under test 110 and its associated system 120 are deployed in the test environment. If there are fewer associated systems 120 and the transaction ratio involved is low, only the system under test 110 can be deployed separately under certain fault tolerance conditions. Then, the transaction log of the system under test 110 in production is obtained, and the request and response messages are read from the transaction log. A driver is written to resend the request content in the transaction log to the system under test 110, and the response message output by the system under test is captured. Finally, the response message output in the parallel test is compared with the response message in the transaction log, and a result file is generated, which is provided to the tester to identify defects.

[0035] For a relatively independent system under test, the above test method is feasible, but if the system under test 110 has an associated system 120, and the system under test 110 has a strong dependency on the associated system 120, it is necessary to deploy all the associated systems 120 in the parallel test environment, otherwise, the parallel test process cannot be implemented or the parallel test results are inaccurate. In addition, even if all the associated systems 120 are built, the current parallel test usually only considers the message response difference at the entrance of the system under test 110, and lacks the comparison and detection of the system under test 110 and the associated system 120 in the parallel test stage, the integrity of the test is poor, and because the associated system 120 will perform logical processing on the request sent by the system under test 110, the logical operation of the associated system 120 will affect the response message output by the system under test 110, resulting in inaccurate test results.

[0036] For easier understanding, see Figure 2 As shown, Figure 2 It is a schematic diagram of the interaction between the system under test and the associated system. In the parallel test process, first, message 1 will be sent to the system under test 110. Message 1 is the request message input to the system under test 110 in the transaction log; then the system under test 110 performs a logical operation on message 1, generates message 2 and sends it to the associated system 120. Message 2 is the request message between the system under test 110 and the associated system 120; then the associated system 120 performs a logical operation on message 2, generates message 3 and sends it to the system under test 110; message 3 is the response message between the system under test 110 and the associated system 120; the system under test 110 generates message 4 according to message 3 for output, and message 4 is the response message output by the system under test 110.

[0037] Under normal circumstances, message 1 is definitely correct, so it does not need to be tested, while messages 2-4 may be wrong and should be tested. However, since the associated system 120 performs logical operations, the correctness of message 2 cannot be determined based on whether message 3 is correct or not, and the correctness of message 3 cannot be guaranteed, because the error of message 3 does not necessarily mean that message 2 is wrong. In this case, it is not easy to verify the accuracy of messages 2 and 3. In addition, message 3 is wrong due to the influence of the associated system 120, which in turn causes message 4 to be wrong. In this case, it is not easy to determine whether the system under test 110 has a fault based only on the situation of message 4, resulting in poor accuracy of the test result.

[0038] In order to solve the above technical problems, the embodiment of the present application provides a system testing method. The following is a detailed description of the system testing method provided by the embodiment of the present application through specific embodiments and application scenarios in conjunction with the accompanying drawings. Figure 3 , Figure 3 : is a schematic diagram of a system testing method provided by an embodiment of the present application, the method comprising:

[0039] S210: extract a first request message from a pre-stored first transaction log and send it to the system under test.

[0040] That is, the pre-request message (first request message) corresponding to the system under test is read from the first transaction log and resent to the system under test.

[0041] The first transaction log is a transaction log of the system under test saved during the previous production process. The embodiment of the present application saves the transaction logs of the system under test in production in advance. In order to ensure the persistence of the data, the transaction logs can be saved in a database that can store data for a long time, such as a distributed database.

[0042] In addition, different types of logs of the system under test can be saved in different storage areas or different databases, for example, the pre-log and the communication log can be written into different databases. The pre-log here contains the request received by the system under test during a production transaction and the response output by the system under test; the communication log here can include the request sent by the system under test to the associated system during a production transaction and the response returned by the associated system to the system under test. The above-mentioned first transaction log includes a complete log corresponding to a production transaction process, that is, the first transaction log includes the pre-log and the communication log.

[0043] S220: Receive a second request message sent by the system under test, where the second request message is generated by the system under test according to the first request message.

[0044] That is, the system under test performs a logic operation according to the first request message and outputs a second request message.

[0045] S230, obtaining a first response message according to the second request message; the first response message is a response message found from the first transaction log and matching the characteristic data of the second request message.

[0046] In actual production, the second request message should be sent to the associated system, but this embodiment is only a testing process, and the first response message corresponding to the second request message has been saved in the first transaction log. Therefore, this embodiment does not set up an associated system, but directly searches for the corresponding first response message from the first transaction log based on the characteristic data of the second request message.

[0047] Among them, if the second request message is correct, the first response message can be found, and if the second request message is wrong, the first response message cannot be found usually, so an error will be reported. That is, in this embodiment, as long as the corresponding first response message can be found, it means that the second request message is correct, and the first response message must be correct; if the corresponding first response message cannot be found, it means that the second request message is wrong. Therefore, this embodiment can achieve the purpose of testing the request transmitted between the system to be tested and the associated system.

[0048] S240: Return the first response message to the system under test.

[0049] S250: Receive a second response message output by the system under test, where the second response message is generated by the system under test according to the first response message.

[0050] After receiving the first response message, the system under test performs a logical operation on the first response message and then outputs a second response message. The purpose of receiving the second response message in this embodiment is to compare the second response message with the output response of the system under test recorded in the first transaction log to determine whether the system under test is operating normally.

[0051] S260, comparing the test record with the first transaction log to obtain a test result; wherein the test record includes at least any one of the following: a second request message, a second response message.

[0052] During the test of this example, under normal circumstances the first request message is correct. If the first response message can be found, the first response message is also correct. Therefore, what needs to be detected and compared are the second request message and the second response message. These two messages are the messages output after the system under test performs logical operations. If these two messages are tested, a complete test of the system under test can be achieved.

[0053] After the system under test has finished running, it will read the previously saved first transaction log, and compare the pre-response in the first transaction log with the second response message; and compare the request message actively initiated by the system under test in the first transaction log with the second request message. After the comparison is completed, the test result is generated according to the comparison result, and the test result can be output later for evaluation by the tester.

[0054] In the embodiment of the present application, the second request message is a request message between the system under test and the associated system during actual production. The present application does not need to perform complex logical operations on the second request message, but directly finds the response message corresponding to the second request message in the pre-stored transaction log according to the characteristic data of the second request message and returns it to the system under test. In this case, if the second request message is wrong, the first response message cannot be found, so that the system under test cannot output the second response message normally. By comparing the second request message and any one of the second response messages, the purpose of testing the request response transmitted between the system under test and the associated system can be achieved, and the integrity of the test can be improved. In addition, since the present application does not perform the logical operations that will be performed in the associated system on the second request message, the response result will not be affected by the associated system, and the accuracy of the test result is higher. In addition, in the embodiment of the present application, the system under test can be decoupled from the associated system, and no longer requires the coordination settings of other associated systems, and can be tested independently, thereby improving the efficiency and accuracy of parallel testing.

[0055] In some embodiments, the above S220 may include:

[0056] A target identifier of the simulated service module carried in the second request message is identified, where the target identifier includes at least one of the following: an address, a domain name, and an interface name.

[0057] The second request message is distributed to the target simulation service module corresponding to the target identifier.

[0058] The above S230 may include:

[0059] A first response message is obtained according to the second request message through the target simulation service module.

[0060] Since the system under test may interact with multiple associated systems, in order to ensure the accuracy of the test, multiple simulation service modules are set in this embodiment, each simulation service module corresponds to a microservice, each microservice is for an associated system, and each simulation service module is used to access the preset transaction log corresponding to the associated system to which it corresponds. Since the second request message is processed by the associated system in actual application, the second request message will carry the target identifiers such as the address, domain name, and interface name of the associated system, and the target identifier is used to enable the second request message to be sent to the correct associated system and to be received by the associated system. In this embodiment, since the associated system is not set, in order to ensure that the second request message can be allocated to the correct simulation service module, the simulation service module is pre-bound with the target identifier of the associated system to which it corresponds, so that the second request message can be sent to the correct simulation service module for processing according to the target identifier carried by the second request message.

[0061] For asynchronous communication transactions, or transactions initiated by the system under test to the associated system, the message is usually set up using a multi-field matching method based on the business logic of the specific system, such as institution number + order number + transaction type, etc. In this case, if you want to find the corresponding response message, you need to search according to the institution number, order number, transaction type, etc. in the request message. The search process is complicated and there are certain errors. In addition, for different associated systems, the field format used may be different, such as the number of characters included in the institution number. In this case, different search methods need to be used for different associated systems, which lacks universality.

[0062] In some embodiments of the present application, the above S230 may include:

[0063] Calculate a first tag value corresponding to the second request message;

[0064] A first response message matching the first tag value is searched from the first transaction log; the request message pre-stored in the transaction log is associated with the corresponding tag value and the response message.

[0065] In this embodiment, the tag value corresponding to the request message in the pre-stored transaction log is pre-calculated and saved. After the second request message is obtained later, the request message corresponding to the first tag value can be found from the first transaction log according to the first tag value corresponding to the second request message, and the response message corresponding to the found request message is the first response message.

[0066] In some other embodiments, the calculating the first tag value corresponding to the second request message may include:

[0067] The request content in the second request message is converted into a first key-value pair; the first key-value pair here may be in a map format.

[0068] The variable fields in the second request message are removed to obtain a second key-value pair, wherein the variable fields include at least one of the following: time, random string, signature value, version information, etc.

[0069] Sort the second key-value pairs and concatenate them into the target string in the order of the sorting results, wherein the sorting can be performed in ASCII.

[0070] The target character string is subjected to information digest calculation to obtain a first tag value, wherein the information digest calculation may be MD5 calculation, and the first tag value may be an MD5 tag value.

[0071] In this embodiment, the variable fields in the second request message are removed to avoid the influence of the variable fields on the calculated first tag value. Since these variable fields mainly change according to factors such as time and number of transmissions, the variable fields themselves do not involve the core content in the second request message. Therefore, if you want to calculate the first tag value according to the second request message to find the first reply message that actually corresponds to it, you need to avoid the influence of the variable fields, and ensure that as long as the second request message is correct, the first tag value calculated according to the second request message should be the same value each time, that is, the request message and the tag value in the pre-stored transaction log are in a one-to-one correspondence. In this case, after calculating the first tag value according to the second request message, the corresponding first reply message can be accurately found according to the first tag value, so as to achieve the purpose of testing the second request message of the present application and improving the test accuracy of the second reply message. And by searching the reply message through the tag value, the reply message corresponding to different associated systems can also be searched in the same search method, which is more versatile. And this unified search method has higher accuracy.

[0072] In the related art, since different systems under test or different interfaces of the same system under test have differences in message formats, calling methods, etc., it is necessary to write a set of specific driver tools for each system under test or even each interface, which is time-consuming and labor-intensive. Based on this, in some embodiments of the present application, S230 may include:

[0073] Invoke an identification tool adapted to the target message format and the target communication protocol according to the target message format and the target communication protocol of the second request message;

[0074] Identify the characteristic data of the second request message by using an identification tool;

[0075] The first response message matching the characteristic data is searched from the pre-stored transaction log.

[0076] In this embodiment, identification tools compatible with various message formats and communication protocols are pre-set, so that after receiving the second request message, the corresponding identification tool will be called according to the message format and communication protocol of the second request message to identify the characteristic data. In this case, when testing various types of systems under test, it can be applied without the need to set corresponding driving tools according to different systems under test or interfaces in the subsequent test process, thereby improving the efficiency of the test.

[0077] Optionally, the target message format may include any one of the following: json, xml, uphead; the target communication protocol may include any one of the following: hypertext transfer protocol, network protocol, distributed service protocol. The above is only a specific implementation method. This application does not limit the specific content of the message format and communication protocol.

[0078] In addition, in the process of obtaining the first transaction log stored in the database and comparing the test record with the first transaction log, an identification tool adapted to the first transaction log message format and communication protocol may be called to identify the first transaction log. This allows the present application to be applicable to various communication protocols and message formats, and has a wider scope of application.

[0079] In some other embodiments of the present application, before S210, the method may further include:

[0080] The acquired production transaction log is converted into a target format; the target format here may be a common log format.

[0081] The production transaction log in the target format is saved to obtain the pre-stored transaction log.

[0082] In this embodiment, when the production transaction log is saved, it is first converted into a fixed two-object format. In this case, after the first request message in the first transaction log is sent to the system under test, the system under test can easily identify the content of the first request message, and the database can be convenient for unified management of the pre-stored transaction logs.

[0083] In addition, after pre-saving the production transaction log, in order to achieve the above-mentioned purpose of searching for the corresponding response message according to the tag value, it is also necessary to calculate the tag value corresponding to the request message contained in the pre-stored transaction log. The method of calculating the tag value can be to calculate the information summary after removing the variable field. This application does not limit the specific calculation method of the tag value. However, the request message in the pre-stored transaction log needs to correspond to its own tag value one by one, and the algorithm for calculating the tag value corresponding to the request message in the pre-stored transaction log needs to be the same as the algorithm for calculating the first tag value corresponding to the second request message.

[0084] Optionally, the tag value calculation can be performed only on the request message actively initiated by the tested system in the pre-stored transaction log, that is, the tag value calculation can be performed only on the request message sent by the tested system to the associated system. The tag value calculation here can be implemented through a configuration file. This is because the tested system obtains the second request message between the tested system and the associated system after processing the first request message, that is to say, the first request message usually does not have a corresponding response message. If there is a response message for the first request message, since the first request message is directly obtained from the first transaction log, it is usually correct. In this case, it is necessary to test the tested system according to whether the response message corresponding to the first request message is correct. Therefore, the correct response message cannot be directly called according to the tag value corresponding to the first request message, which will result in the loss of the test effect. Therefore, in this embodiment, only the tag value calculation for the request message actively initiated by the tested system can reduce the amount of calculation of the tag value calculation and reduce the storage space occupied by the tag value.

[0085] In other embodiments, before S210, in order to implement the above embodiments, it is also necessary to configure the simulation service module according to the configuration information. The configuration information includes at least one of the following: communication mode, request interface, response delay time, signature verification, and response message format.

[0086] Since the simulation service module is used to simulate the actual associated system, the simulation service module needs to be able to receive the second request message sent by the system under test in real time and calculate the tag value of the second request message. Through the tag value and searching for the first response message corresponding to the second request message, the purpose of simulating the response of the real associated system is achieved.

[0087] Optionally, the above-mentioned process of configuring according to the configuration information may include receiving the configuration information input by the staff to configure the simulation service module each time a simulation service module is pulled. Or it may also include determining the number of associated systems and pre-setting the configuration information corresponding to each simulation service module according to the characteristics of each associated system, and then uniformly pulling each simulation service module, and automatically calling the pre-set configuration information to configure each simulation service module respectively. This application does not limit which specific method is adopted.

[0088] Based on the same inventive concept as the above method embodiment, the present application also provides a system testing device, see Figure 4 , Figure 4 : is a structural diagram of a system testing device provided by another embodiment of the present application; the device comprises:

[0089] The request sending module 310 is used to extract the first request message in the pre-stored first transaction log and send it to the system under test;

[0090] The request receiving module 320 is used to receive a second request message sent by the system under test, where the second request message is generated by the system under test according to the first request message;

[0091] The response acquisition module 330 is used to acquire a first response message according to the second request message; the first response message is a response message found from the first transaction log and matching the characteristic data of the second request message;

[0092] A response returning module 340, configured to return the first response message to the system under test;

[0093] A response receiving module 350 is used to receive a second response message output by the system under test, where the second response message is a message generated by the system under test according to the first response message;

[0094] The comparison module 360 ​​is used to compare the test record with the first transaction log to obtain a test result; wherein the test record includes at least any one of the following: a second request message, a second response message.

[0095] In the embodiment of the present application, the second request message is a request message between the system under test and the associated system during actual production. The present application does not need to perform complex logical operations on the second request message, but directly finds the response message corresponding to the second request message in the pre-stored transaction log based on the characteristic data of the second request message and returns it to the system under test. In this case, if an error occurs in the second request message, the first response message cannot be found, so that the system under test cannot normally output the second response message. By comparing the second request message and any one of the second response messages, the purpose of testing the request response transmitted between the system under test and the associated system can be achieved, thereby improving the integrity of the test. In addition, since the present application does not perform the logical operations that would be performed in the associated system on the second request message, the response result will not be affected by the associated system, and the accuracy of the test result is higher.

[0096] In some embodiments, the request receiving module 320 may include:

[0097] An identification identification unit, used to identify a target identification of the simulated service module carried in the second request message, where the target identification includes at least one of the following: an address, a domain name, and an interface name;

[0098] A distribution unit, used for distributing the second request message to a target simulation service module corresponding to the target identifier;

[0099] Correspondingly, the above-mentioned response acquisition module 330 can be specifically used to: obtain the first response message according to the second request message through the target simulation service module.

[0100] In this embodiment, since no associated system is set up, in order to ensure that the second request message can be allocated to the correct simulation service module, the simulation service module is pre-bound with the target identifier of the associated system corresponding to it, so that the second request message can be sent to the correct simulation service module for processing according to the target identifier carried by the second request message.

[0101] In some embodiments, the response acquisition module 330 may include:

[0102] A tag calculation unit, used to calculate a first tag value corresponding to the second request message;

[0103] The first search unit is used to search the first response message matching the first tag value from the first transaction log; the request message pre-stored in the transaction log is associated with the corresponding tag value and the response message.

[0104] In this embodiment, the tag value corresponding to the request message in the pre-stored transaction log is pre-calculated and saved. After the second request message is obtained later, the request message corresponding to the first tag value can be found from the first transaction log according to the first tag value corresponding to the second request message, and the response message corresponding to the found request message is the first response message.

[0105] In some other embodiments, the tag calculation unit may include:

[0106] A conversion unit, configured to convert the request content in the second request message into a first key-value pair;

[0107] A field removal unit, used to remove the variable field in the second request message to obtain a second key-value pair;

[0108] A sorting and connecting module, used for sorting the second key-value pairs and connecting them into a target string in the order of the sorting results;

[0109] The information digest calculation is used to perform information digest calculation on the target character string to obtain a first tag value.

[0110] In this embodiment, the variable fields in the second request message are removed to avoid the influence of the variable fields on the calculated first tag value. Since these variable fields mainly change according to factors such as time and number of transmissions, the variable fields themselves do not involve the core content in the second request message. Therefore, if you want to calculate the first tag value according to the second request message to find the first reply message that actually corresponds to it, you need to avoid the influence of the variable fields, and ensure that as long as the second request message is correct, the first tag value calculated according to the second request message should be the same value each time, that is, the request message and the tag value in the pre-stored transaction log are in a one-to-one correspondence. In this case, after calculating the first tag value according to the second request message, the corresponding first reply message can be accurately found according to the first tag value, so as to achieve the purpose of testing the second request message of the present application and improving the test accuracy of the second reply message. And by searching the reply message through the tag value, the reply message corresponding to different associated systems can also be searched in the same search method, which is more versatile. And this unified search method has higher accuracy.

[0111] In some embodiments, the response acquisition module 330 may include:

[0112] A tool calling unit, configured to call an identification tool adapted to a target message format and a target communication protocol according to a target message format and a target communication protocol of the second request message;

[0113] A data identification unit, used for identifying characteristic data of the second request message through an identification tool;

[0114] The second searching unit is used to search the pre-stored transaction log for a first response message matching the characteristic data.

[0115] In this embodiment, identification tools compatible with various message formats and communication protocols are pre-set, so that after receiving the second request message, the corresponding identification tool will be called according to the message format and communication protocol of the second request message to identify the characteristic data. In this case, when testing various types of systems under test, it can be applied without the need to set corresponding driving tools according to different systems under test or interfaces in the subsequent test process, thereby improving the efficiency of the test.

[0116] In some other embodiments, the device may further include:

[0117] A format conversion module, used to convert the acquired production transaction log into a target format;

[0118] The saving module is used to save the production transaction log in the target format to obtain the pre-stored transaction log.

[0119] In this embodiment, when the production transaction log is saved, it is first converted into a fixed two-object format. In this case, after the first request message in the first transaction log is sent to the system under test, the system under test can easily identify the content of the first request message, and the database can be convenient for unified management of the pre-stored transaction logs.

[0120] In some further embodiments, the device may further include:

[0121] The configuration module is used to configure the simulation service module according to the configuration information; the configuration information includes at least one of the following: communication mode, request interface, response delay time, signature verification, and response message format.

[0122] Since the simulation service module is used to simulate the actual associated system, the simulation service module needs to be able to receive the second request message sent by the system under test in real time and calculate the tag value of the second request message. Through the tag value and searching for the first response message corresponding to the second request message, the purpose of simulating the response of the real associated system is achieved.

[0123] See also Figure 5 , Figure 5 It is a structural schematic diagram of an electronic device provided in yet another embodiment of the present application.

[0124] The electronic device may include a processor 401 and a memory 402 storing computer program instructions. The processor 401 reads and executes the computer program instructions stored in the memory 402 to implement any one of the system testing methods in the above embodiments.

[0125] Specifically, the processor 401 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0126] The memory 402 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 402 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 402 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 402 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 402 is a non-volatile solid-state memory. In a specific embodiment, the memory 402 includes a read-only memory (ROM). In appropriate cases, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically rewritable ROM (EAROM) or a flash memory or a combination of two or more of these.

[0127] In one example, the electronic device may further include a communication interface 403 and a bus 410. Figure 5 As shown, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 and communicate with each other.

[0128] The communication interface 403 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0129] Bus 410 includes hardware, software or both, and the parts of online data flow billing equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front-side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 410 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0130] In addition, in combination with the system testing method in the above embodiments, the present application embodiment can provide a computer storage medium for implementation. The computer storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the system testing methods in the above embodiments is implemented.

[0131] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0132] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0133] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A system testing method, characterized in that: include: Extracting a first request message from a pre-stored first transaction log and sending it to the system under test; receiving a second request message sent by the system under test, where the second request message is a message generated by the system under test according to the first request message; Obtaining a first response message according to the second request message; The first response message is a response message found in the first transaction log and matching the characteristic data of the second request message; Returning the first response message to the system under test; receiving a second response message output by the system under test, where the second response message is a message generated by the system under test according to the first response message; Compare the test record with the first transaction log to obtain a test result; wherein the test record includes at least any one of the following: the second request message, the second response message.

2. The method according to claim 1, characterized in that The acquiring a first response message according to the second request message includes: Calculate a first tag value corresponding to the second request message; The first response message matching the first tag value is searched from the first transaction log; the request message in the pre-stored first transaction log is associated with the corresponding tag value and the response message.

3. The method according to claim 2, characterized in that The calculating the first tag value corresponding to the second request message includes: Convert the request content in the second request message into a first key-value pair; Removing the variable field in the second request message to obtain a second key-value pair; Sort the second key-value pairs, and concatenate them into a target string in the order of the sorting results; An information digest is calculated for the target character string to obtain the first tag value.

4. The method according to claim 3, characterized in that The first tag value includes an MD5 tag value.

5. The method according to claim 3, characterized in that: The variable field includes at least one of the following: time, random string, signature value, and version information.

6. The method according to claim 1, characterized in that The receiving a second request message sent by the system under test includes: Identify a target identifier of the simulated service module carried by the second request message, where the target identifier includes at least one of the following: an address, a domain name, and an interface name; Allocating the second request message to the target simulation service module corresponding to the target identifier; The acquiring a first response message according to the second request message includes: The first response message is obtained according to the second request message through the target simulation service module.

7. The method according to claim 6, characterized in that Before extracting the first request message from the pre-stored first transaction log and sending it to the system under test, the method further includes: The simulation service module is configured according to the configuration information; the configuration information includes at least one of the following: communication mode, request interface, response delay time, signature verification, and response message format.

8. The method according to claim 1, characterized in that The method further comprises: Convert the acquired production transaction log into the target format; The production transaction log in the target format is saved to obtain the pre-stored first transaction log.

9. The method according to claim 1, characterized in that: The acquiring a first response message according to the second request message includes: According to the target message format and the target communication protocol of the second request message, calling an identification tool adapted to the target message format and the target communication protocol; Identify the characteristic data of the second request message by the identification tool; The first response message matching the characteristic data is searched from the pre-stored first transaction log.

10. The method according to claim 9, characterized in that The target message format includes any one of the following: json, xml, uphead; The target communication protocol is any one of the following: Hypertext Transfer Protocol, Internet Protocol, Distributed Services Protocol.

11. A system testing device, characterized in that: include: A request sending module, used for extracting a first request message from a pre-stored first transaction log and sending it to a system under test; A request receiving module, used to receive a second request message sent by the system under test, where the second request message is a message generated by the system under test according to the first request message; A response acquisition module, used to acquire a first response message according to the second request message; The first response message is a response message found in the first transaction log and matching the characteristic data of the second request message; A response returning module, used for returning the first response message to the system under test; A response receiving module, used for receiving a second response message output by the system under test, where the second response message is a message generated by the system under test according to the first response message; A comparison module is used to compare the test record with the first transaction log to obtain a test result; wherein the test record includes at least any one of the following: the second request message, the second response message.

12. An electronic device, characterized in that: The system comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the system testing method according to any one of claims 1 to 10.

13. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the system testing method according to any one of claims 1 to 10 are implemented.