Interactive scene testing method, system, processor and electronic device
By configuring a simulation device to simulate the transmission of messages between the third-party system and the system to be tested, the inefficiency problem caused by relying on third-party systems in the existing technology of interactive scenario testing is solved, and more efficient interactive scenario testing is achieved.
Patent Information
- Application Number
- CN202211289103.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-20
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2042-10-20
AI Technical Summary
In the prior art, the reliance on third-party systems when testing interactive scenarios results in low testing efficiency and problems such as incoherent testing processes and inability to coherently test multiple interactive business scenarios and inter-system interaction processes are omitted.
By determining the execution order of the target interaction scenario to be tested and its interaction behavior, the simulation device is configured to simulate a third-party system, and the simulation device and the system to be tested transmit messages until all interactive behaviors are completed, and the test result is determined based on the simulation results.
It improves the testing efficiency of interactive scenarios, ensures the accuracy and completeness of test results, and solves the problem of inefficient testing caused by relying on third-party systems.
Smart Images

Figure CN115495381B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of financial technology, and specifically, to a testing method, system, processor and electronic device for interactive scenarios. Background Art
[0002] When testing application systems, some projects involve interaction with partners. The lack of a stable joint debugging and testing environment with partners can severely impact the development and testing progress of application systems, hindering project progress. Related technologies utilize an end-to-end firewall for joint testing, synchronizing various data between the application system under test and the partner system before conducting online joint testing. Alternatively, segmented short-circuit testing can be performed before and after interaction between the application system under test and the partner system.
[0003] However, the use of online joint debugging and testing is highly dependent on the stability of the test environment and data synchronization between the application system to be tested and the partner system, and it also depends on the technical level of the partner system test environment maintenance personnel, so the project progress cannot be guaranteed; the use of segmented short-circuit testing before and after the interaction between the application system to be tested and the partner system also has many disadvantages, such as inconsistent testing processes, the need for the system to be tested to support simulated return data, the inability to continuously test business scenarios with multiple interactions, and the inability to test the interaction process between systems. There are omissions in the test scenarios and other problems, which pose quality risks.
[0004] Currently, no effective solution has been proposed to the problem that related technologies rely on third-party systems when testing interactive scenarios, resulting in low testing efficiency. Summary of the Invention
[0005] The main purpose of this application is to provide a testing method, system, processor and electronic device for an interactive scenario, so as to solve the problem in the related art of relying on a third-party system when testing an interactive scenario, resulting in low testing efficiency.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for testing an interaction scenario is provided. The method includes: determining a target interaction scenario to be tested, and determining at least one interaction behavior in the target interaction scenario and the execution order of at least one interaction behavior, wherein the target interaction scenario is an interaction scenario for conducting transactions between the system to be tested and a third-party system; determining the current interaction behavior from the at least one interaction behavior in sequence according to the execution order, and configuring the simulation device according to the resource configuration information of the current interaction behavior to obtain a configured simulation device, wherein the configured simulation device is used to simulate the third-party system; sequentially controlling the configured simulation device and the system to be tested to transmit the target message of the current interaction behavior according to preset rules, and obtaining a simulation result of the current interaction behavior, until all interaction behaviors of the target interaction scenario are tested and the simulation results of all interaction behaviors are obtained; and determining the test result of the target interaction scenario according to the simulation results of all interaction behaviors.
[0007] Optionally, before configuring the simulation device based on the resource configuration information of the current interactive behavior and obtaining the configured simulation device, the method also includes: obtaining a preset message format and a preset data transmission protocol of the third-party system; configuring the format of the messages sent and received by the simulation device to the preset message format, configuring the data transmission protocol of the simulation device to the preset data transmission protocol, and establishing a network connection between the simulation device and the system to be tested according to the preset message format and the preset data transmission protocol.
[0008] Optionally, determining the test result of the target interaction scenario based on the simulation results of all interaction behaviors includes: determining whether the simulated interaction behavior has passed the test based on each simulation result; when all simulation results indicate that the simulated interaction behavior has passed the test, determining that the target interaction scenario has passed the test; when there is a simulation result indicating that the simulated interaction behavior has not passed the test, determining that the target interaction scenario has not passed the test.
[0009] Optionally, determining whether the simulated interactive behavior has passed the test based on each simulation result includes: obtaining the interactive content of the corresponding interactive behavior from the simulation result, and judging whether the interactive content is the same as the preset interactive content; when the interactive content is the same as the preset interactive content, judging whether the corresponding interactive behavior has an abnormality; when no abnormality occurs in the corresponding interactive behavior, determining that the corresponding interactive behavior test has passed.
[0010] Optionally, determining whether an abnormality occurs in the corresponding interactive behavior includes: determining whether the network connection between the configured simulation device and the system to be tested is stable, and if the network connection is unstable, determining that an abnormality occurs in the corresponding interactive behavior; if the network connection is stable, determining whether the message transmission duration between the configured simulation device and the system to be tested exceeds a preset duration threshold; if the message transmission duration exceeds the preset duration threshold, determining that an abnormality occurs in the corresponding interactive behavior; if the message transmission duration does not exceed the preset duration threshold, determining whether there is an error in the target message, and if there is an error in the target message, determining that an abnormality occurs in the corresponding interactive behavior.
[0011] Optionally, determining whether there is an error in the target message includes: determining whether the format of the target message is the same as the preset message format, determining whether there is an error in the encoding of the target message, and determining whether the content of the target message is missing; if the format of the target message is different from the preset message format, and / or there is an error in the encoding of the target message, and / or the content of the target message is missing, it is determined that there is an error in the target message.
[0012] Optionally, when the target interaction scenario is a fault scenario, before configuring the simulation device according to the resource configuration information of the current interaction behavior, the method also includes: obtaining the fault ratio of the target interaction scenario and the target number of concurrent interaction behaviors, wherein the fault ratio is the ratio of abnormal interaction behaviors in the concurrent interaction behaviors; configuring the simulation device according to the fault ratio and the target number to obtain an updated simulation device; executing the step of configuring the simulation device according to the resource configuration information of the current interaction behavior based on the updated simulation device; determining the test result of the target interaction scenario according to the simulation results of all interaction behaviors includes: determining the number of abnormal interaction behaviors based on the simulation results of all interaction behaviors, obtaining the number of faults, and judging whether the number of faults is the same as the target number; when the number of faults is the same as the target number, determining that the target interaction scenario test has passed.
[0013] To achieve the above-mentioned objectives, according to another aspect of the present application, a test system for an interactive scenario is provided. The system comprises: a simulation device for deploying a configuration file for interactive behaviors in a target interactive scenario and configuring a message interface for the interactive behaviors to simulate a third-party system; a system to be tested for establishing a network connection with the simulation device and simulating the interactive behaviors in the target interactive scenario by transmitting messages to the simulation device; and a host computer connected to the system to be tested for determining a test result for the target interactive scenario based on the simulation results of all interactive behaviors after the simulation of all interactive behaviors in the target interactive scenario is completed.
[0014] In order to achieve the above-mentioned purpose, according to another aspect of the present application, a testing device for an interaction scenario is provided. The device includes: a first determining unit, configured to determine a target interaction scenario to be tested, and to determine at least one interaction behavior in the target interaction scenario and the execution order of at least one interaction behavior, wherein the target interaction scenario is an interaction scenario for transactions between the system to be tested and a third-party system; a configuration unit, configured to sequentially determine the current interaction behavior from at least one interaction behavior according to the execution order, and to configure a simulation device according to resource configuration information of the current interaction behavior to obtain a configured simulation device, wherein the configured simulation device is used to simulate a third-party system; a transmission unit, configured to sequentially control the configured simulation device and the system to be tested to transmit the target message of the current interaction behavior according to preset rules, to obtain a simulation result of the current interaction behavior, until all interaction behaviors of the target interaction scenario are tested and the simulation results of all interaction behaviors are obtained; a second determining unit, configured to determine the test result of the target interaction scenario according to the simulation results of all interaction behaviors.
[0015] Through this application, the following steps are adopted: determining the target interaction scenario to be tested, and determining at least one interaction behavior in the target interaction scenario and the execution order of at least one interaction behavior, wherein the target interaction scenario is an interaction scenario for transactions between the system to be tested and a third-party system; determining the current interaction behavior from at least one interaction behavior in sequence according to the execution order, and configuring the simulation device according to the resource configuration information of the current interaction behavior to obtain a configured simulation device, wherein the configured simulation device is used to simulate the third-party system; sequentially controlling the configured simulation device and the system to be tested to transmit the target message of the current interaction behavior according to the preset rules to obtain the simulation result of the current interaction behavior, until all the interaction behaviors of the target interaction scenario are tested and the simulation results of all the interaction behaviors are obtained; determining the test result of the target interaction scenario according to the simulation results of all the interaction behaviors, thereby solving the problem of relying on a third-party system when testing the interaction scenario in the related art, resulting in low test efficiency. The simulation device simulates the third-party system to establish a network connection with the system to be tested, transmits messages to simulate the interaction scenario, and thus achieves the effect of improving the test efficiency of the interaction scenario. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of this application. The exemplary embodiments and descriptions of this application are intended to explain this application and do not constitute an improper limitation on this application. In the accompanying drawings:
[0017] Figure 1 This is a flowchart of a method for testing an interactive scenario according to an embodiment of the present application;
[0018] Figure 2is a structural diagram of a test system for an interactive scenario provided in an embodiment of the present application;
[0019] Figure 3 is a schematic structural diagram of an optional simulation device provided according to an embodiment of the present application;
[0020] Figure 4 is a schematic diagram of a testing device for an interactive scenario provided in an embodiment of the present application;
[0021] Figure 5 is a schematic diagram of an electronic device provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0022] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0023] In order to enable those skilled in the art to better understand the present invention, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this application.
[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0026] The present invention will be described below in conjunction with preferred implementation steps. Figure 1 is a flow chart of a testing method for an interactive scenario provided in an embodiment of the present application, such as Figure 1 As shown, the method includes the following steps:
[0027] Step S101 : determining a target interaction scenario to be tested, and determining at least one interaction behavior and an execution order of the at least one interaction behavior in the target interaction scenario, wherein the target interaction scenario is an interaction scenario of a transaction between the system to be tested and a third-party system.
[0028] Specifically, in order to ensure that the system under test can maintain stability when conducting transactions, it is necessary to test various transaction scenarios between the system under test and third-party systems. The target interaction scenario can be any transaction between the system under test and any third system. The transaction requires the system under test to perform at least one interaction with the third-party application system. The interaction behavior refers to the communication interaction when the system under test and the third-party application system conduct transactions in the target interaction scenario. The execution order refers to the order of simulating various communication interactions in the target interaction scenario, that is, the order in which the system under test and the third-party application system send and receive messages.
[0029] For example, the target interaction scenario is a lottery event jointly organized by the system under test and a third-party system A. The lottery event involves three interactions: the user clicks on the lottery, the lottery wheel rotates, and the prize is drawn. The communication interaction between the system under test and system A is carried out in the order of first clicking on the lottery, then rotating the wheel, and finally drawing the prize.
[0030] Step S102, determining the current interactive behavior from at least one interactive behavior in sequence according to the execution order, and configuring the simulation device according to the resource configuration information of the current interactive behavior to obtain a configured simulation device, wherein the configured simulation device is used to simulate a third-party system.
[0031] Specifically, the current interactive behavior is the interactive behavior in the target interactive scenario being simulated. Resource configuration information refers to the configuration file required to simulate the current interactive behavior. The configuration file may include messages that need to be sent and received during the interactive behavior. For example, a lottery activity involves three interactions: the user clicking the lottery, the lottery wheel spinning, and the prize being drawn. According to the execution order, the user clicking the lottery, the lottery wheel spinning, and the prize being drawn are determined as the current interactive behavior. Before each interactive behavior is executed, the simulation device is configured accordingly. For example, if the current interactive behavior is the lottery wheel spinning, simulating the current interactive behavior requires configuring the configuration file corresponding to the lottery wheel on the simulation device.
[0032] Step S103, sequentially controlling the configured simulation device and the system to be tested to transmit the target message of the current interactive behavior according to preset rules, and obtaining the simulation result of the current interactive behavior, until all interactive behaviors of the target interactive scene are tested and the simulation results of all interactive behaviors are obtained.
[0033] Specifically, the preset rules include message transmission rules, which can be a message transmission format agreed upon between the system under test and the third-party application system. The target message can be a message used to instruct the execution of the current interactive behavior. The simulation result can be the specific transmission situation of the target message of the current interactive behavior. After each interactive behavior of the target interactive scenario is simulated, all simulation results of the target interactive scenario are obtained. Each interactive behavior is simulated in sequence by the simulation device and the system under test in the execution order. When simulating each interactive behavior, the simulation device is configured according to the corresponding configuration file, and the target message corresponding to the interactive behavior is transmitted between the system under test and the simulation device according to the preset message format, thereby obtaining all message transmission results of the target interactive scenario.
[0034] Step S104: determining the test result of the target interaction scenario according to the simulation results of all interaction behaviors.
[0035] Specifically, whether the interactive behavior passes the test is determined by judging whether the message transmission in each interactive behavior is the same as the preset message transmission situation. If all interactive behaviors pass the test, it is determined that the target interactive scenario test passes.
[0036] The test method of the interactive scenario provided by the embodiment of the present application determines the target interactive scenario to be tested, and determines at least one interactive behavior in the target interactive scenario and the execution order of at least one interactive behavior, wherein the target interactive scenario is an interactive scenario for transactions between the system to be tested and a third-party system; determines the current interactive behavior from at least one interactive behavior in sequence according to the execution order, and configures the simulation device according to the resource configuration information of the current interactive behavior to obtain a configured simulation device, wherein the configured simulation device is used to simulate the third-party system; sequentially controls the configured simulation device and the system to be tested to transmit the target message of the current interactive behavior according to the preset rules, and obtains the simulation result of the current interactive behavior, until all the interactive behaviors of the target interactive scenario are tested, and the simulation results of all the interactive behaviors are obtained; determines the test result of the target interactive scenario according to the simulation results of all the interactive behaviors, thereby solving the problem of relying on a third-party system when testing the interactive scenario in the related art, resulting in low test efficiency. The simulation device simulates the third-party system to establish a network connection with the system to be tested, transmits messages to simulate the interactive scenario, and thus achieves the effect of improving the test efficiency of the interactive scenario.
[0037] A network connection needs to be established for message transmission between the system to be tested and the simulation device. Optionally, in the test method for the interactive scenario provided in the embodiment of the present application, before configuring the simulation device according to the resource configuration information of the current interactive behavior and obtaining the configured simulation device, the method also includes: obtaining a preset message format and a preset data transmission protocol of the third-party system; configuring the format of the messages sent and received by the simulation device to the preset message format, configuring the data transmission protocol of the simulation device to the preset data transmission protocol, and establishing a network connection between the simulation device and the system to be tested according to the preset message format and the preset data transmission protocol.
[0038] Specifically, the preset message format can be the XML (Extensible Markup Language) or JSON (JavaScript Object Notation, a lightweight data exchange format) format agreed upon between the system under test and the third-party application system. The preset data transmission protocol can be the TCP / IP protocol, HTTP / HTTPS protocol, FTP / SFTP protocol, or other communication protocol agreed upon between the system under test and the third-party application system. By configuring the simulation device with the preset message format and preset data transmission protocol agreed upon between the system under test and the third-party application system, a network connection is established between the simulation device and the system under test. The target interaction scenario can then be simulated by transmitting messages between the simulation device and the system under test.
[0039] Whether the target interaction scenario passes the test is determined by the simulation results of each interaction behavior. Optionally, in the test method for the interaction scenario provided in the embodiment of the present application, determining the test result of the target interaction scenario based on the simulation results of all interaction behaviors includes: determining whether the simulated interaction behavior passes the test based on each simulation result; determining that the target interaction scenario passes the test when all simulation results indicate that the simulated interaction behavior passes the test; and determining that the target interaction scenario fails the test when there is a simulation result indicating that the simulated interaction behavior fails the test.
[0040] For example, the target interaction scenario is a lottery activity jointly organized by the system under test and a third-party system A. If the message transmission results of the three interactions of the user clicking on the lottery, rotating the lottery wheel, and drawing the prize are the same as the preset transmission results, the lottery activity scenario test is determined to have passed. If the message transmission result of one of the interactions of the user clicking on the lottery, rotating the lottery wheel, and drawing the prize is different from the preset transmission result, the lottery activity scenario test fails.
[0041] Whether the simulation result of each interaction represents that the test has passed is determined by whether the interaction content is the same and whether an exception occurs. Optionally, in the test method of the interaction scenario provided in the embodiment of the present application, determining whether the simulated interaction behavior has passed the test according to each simulation result includes: obtaining the interaction content of the corresponding interaction behavior from the simulation result, and judging whether the interaction content is the same as the preset interaction content; when the interaction content is the same as the preset interaction content, judging whether the corresponding interaction behavior has an exception; when no exception occurs in the corresponding interaction behavior, determining that the corresponding interaction behavior test has passed.
[0042] Specifically, the interactive content is the message content transmitted between the system under test and the simulation device, and the preset interactive content refers to the message content transmitted between the system under test and the third-party system when no failure occurs in the target interactive scenario. Interactive behavior anomalies refer to abnormal situations when messages are transmitted between the system under test and the simulation device. From the simulation results of each interactive behavior, it is determined whether the transmitted message content is the same as the preset message content, and whether there are any abnormalities in the message transmission process. When the message content is the same as the preset message content and there are no abnormalities in the message transmission, it is determined that the interactive behavior test has passed. Whether each interactive behavior test has passed is determined by judging whether the interactive content is the same as the preset interactive content and whether there are any abnormalities in the interactive behavior.
[0043] Whether an abnormality occurs in the interactive behavior is determined by judging whether the network connection is stable, whether the message transmission time has timed out, and whether there is an error in the message. Optionally, in the test method for the interactive scenario provided in the embodiment of the present application, judging whether an abnormality occurs in the corresponding interactive behavior includes: judging whether the network connection between the configured simulation device and the system to be tested is stable, and if the network connection is unstable, determining that an abnormality occurs in the corresponding interactive behavior; if the network connection is stable, judging whether the message transmission time between the configured simulation device and the system to be tested exceeds a preset time threshold; if the message transmission time exceeds the preset time threshold, determining that an abnormality occurs in the corresponding interactive behavior; if the message transmission time does not exceed the preset time threshold, judging whether there is an error in the target message, and if there is an error in the target message, determining that an abnormality occurs in the corresponding interactive behavior.
[0044] Specifically, abnormal interactive behavior situations include at least timeout and no return, return of wrong format message, return of wrong code message, return of content missing message, network connection being closed during communication, etc. Unstable network connection can be that the network connection is abnormally closed during message communication, the message transmission time exceeds the preset time threshold, that is, timeout and no return, whether there is an error in the target message, that is, return of wrong format message, return of wrong code message, return of content missing message, etc. Whether the interactive behavior is abnormal is determined by judging whether the above abnormal situations occur in the interactive behavior.
[0045] Whether there is an error in the message is determined by judging whether the format of the message is the same as the preset message format, whether there is an error in the message encoding, and whether the message content is correct. Optionally, in the test method of the interactive scenario provided in the embodiment of the present application, judging whether there is an error in the target message includes: judging whether the format of the target message is the same as the preset message format, judging whether there is an error in the encoding of the target message, and judging whether the content of the target message is missing; when the format of the target message is different from the preset message format, and / or there is an error in the encoding of the target message, and / or the content of the target message is missing, it is determined that there is an error in the target message.
[0046] Specifically, the preset message format can be xml or json format. It is determined whether the format of the target message is the same as the preset message format. For example, the preset message format is xml, but the format of the target message is json, which means that the format of the target message is different from the preset message format. It is also determined whether the encoding of the target message is wrong, and whether the message content of the target message is missing. If any one or more of the above situations exist, the target message has an error.
[0047] The simulation device can also simulate fault scenarios. Optionally, in the test method for the interaction scenario provided in the embodiment of the present application, when the target interaction scenario is a fault scenario, before configuring the simulation device according to the resource configuration information of the current interaction behavior, the method also includes: obtaining the fault ratio of the target interaction scenario and the target number of concurrent interaction behaviors, wherein the fault ratio is the ratio of abnormal interaction behaviors in the concurrent interaction behaviors; configuring the simulation device according to the fault ratio and the target number to obtain an updated simulation device; executing the step of configuring the simulation device according to the resource configuration information of the current interaction behavior based on the updated simulation device; determining the test result of the target interaction scenario according to the simulation results of all interaction behaviors includes: determining the number of abnormal interaction behaviors based on the simulation results of all interaction behaviors, obtaining the number of faults, and judging whether the number of faults is the same as the target number; when the number of faults is the same as the target number, determining that the target interaction scenario test has passed.
[0048] Specifically, the failure ratio can be the artificially set ratio of interactive behaviors with failures in all interactive behaviors. The target number is also the number of concurrent interactive behaviors, and the failure number is the number of actual failed interactive behaviors when simulating concurrent interactive behaviors. In order to determine whether the system under test can maintain stability in a concurrent fault interaction scenario, the fault interaction scenario is simulated by artificially setting the failure ratio, and the failure ratio is set according to the number of failed interactive behaviors that may occur in the third-party application system. By adjusting the configuration of the simulation device, the simulation device can simulate a concurrent fault interaction scenario. When testing the fault interaction scenario, the test results for the non-faulty interactive behaviors are determined according to the test method of the target interaction scenario. In the simulation results of the fault interaction scenario, it is also necessary to determine whether the number of failures is the same as the preset failure ratio. When the number of failures is the same as the target number, and the test of the non-faulty interactive behaviors in the fault interaction scenario passes, it is determined that the fault interaction scenario test has passed.
[0049] For example, a fault interaction scenario is a lucky draw event where the activity interface crashes due to an excessive number of users. When simulating this fault interaction scenario, first determine the number of users that the third-party application system can withstand, that is, the maximum concurrent number of interactive behaviors allowed. For example, the maximum concurrent number of interactive behaviors allowed is 500. When the concurrency exceeds 500, the proportion of interactive behaviors that may fail is 10%. Set the failure proportion to 10%. When the test simulation device simulates concurrent interactive behaviors with the system to be tested, whether only 10% of the interactive behaviors fail, and the remaining 90% of the interactive behaviors do not fail and the test passes. If so, it proves that the system to be tested can maintain system stability under the fault interaction scenario, and this fault interaction scenario test passes.
[0050] According to another embodiment of the present application, a system for testing interactive scenarios is provided. The system includes: a simulation device for deploying a configuration file for interactive behaviors in a target interactive scenario and configuring a message interface for the interactive behaviors to simulate a third-party system; a system under test for establishing a network connection with the simulation device and simulating the interactive behaviors in the target interactive scenario by transmitting messages to the simulation device; and a host computer connected to the system under test for determining a test result for the target interactive scenario based on the simulation results of all interactive behaviors after the simulation of all interactive behaviors in the target interactive scenario is completed.
[0051] Specifically, Figure 2 is a structural diagram of a test system for an interactive scenario provided in an embodiment of the present application, such as Figure 2 As shown, the system includes:
[0052] The simulation device 201 is used to deploy the configuration file of the interactive behavior in the target interactive scenario and configure the message interface of the interactive behavior to simulate the third-party system;
[0053] Specifically, the simulation device is a device used to simulate the message interaction between the third-party application system and the system to be tested 202. The target interaction scenario is simulated through the message interaction between the system to be tested 202 and the simulation device 201. The configuration file and message interface required for each interaction scenario are different. Therefore, it is necessary to configure the configuration file and message interface corresponding to the test target interaction scenario in advance on the simulation device 201.
[0054] The system under test 202 is used to establish a network connection with the simulation device 201 and simulate the interactive behavior in the target interactive scenario by transmitting messages with the simulation device 201;
[0055] Specifically, the system to be tested 202 is a system that needs to test a target interaction scenario, and it establishes a network connection with the simulation device 201 to perform message transmission to simulate various interaction behaviors in the target interaction scenario.
[0056] The host computer 203 is connected to the system to be tested 202 and is used to determine the target interaction scenario test result according to the simulation results of all interaction behaviors after the simulation of all interaction behaviors of the target interaction scenario is completed.
[0057] Specifically, the host computer 203 collects the simulation results of each interactive behavior, and is responsible for determining the interactive content of each interactive behavior and whether the interactive behavior is abnormal to determine the test result of each interactive behavior, and determines the test result of the target interactive scenario through the test results of all interactive behaviors in the target interactive scenario.
[0058] According to the system provided in the example of this application, a network connection is established between a simulation device 201 and a system under test 202. A corresponding configuration file is configured for each interaction in the target interaction scenario to be simulated. The target interaction scenario is simulated by transmitting messages between the simulation device 201 and the system under test 202. The host computer 203 collects the test results of each simulated interaction to determine the test results of the target interaction scenario. This improves the testing efficiency of the interaction scenario.
[0059] According to another embodiment of the present application, an optional simulation device is provided. Figure 3 is a schematic structural diagram of an optional simulation device provided according to an embodiment of the present application, such as Figure 3 As shown, the system includes: a parameter module 301 , a business scenario module 302 , a simulation message module 303 , a fault simulation module 304 and a network module 305 .
[0060] Parameter module 301 first loads the various parameters needed to establish a connection with the application system under test, then imports the network parameters into network module 305, which then establishes a network connection with the application system under test. Once the network connection is successfully established, parameter module 301 imports the business scenario parameters into business scenario module 302. Simulation message module 303 sends simulated interaction messages to business scenario simulation module 302, which then simulates interaction with network module 305, and network module 305 exchanges data with the application system under test. When a fault scenario needs to be simulated, parameter module 301 imports the fault simulation parameters into fault simulation module 304, which then sends the fault calculation results to business scenario module 302, which then simulates interaction with the application system under test.
[0061] It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and that, although a logical order is shown in the flowcharts, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0062] The present application also provides a test device for an interactive scenario. It should be noted that the test device for an interactive scenario in the present application can be used to execute the test method for an interactive scenario provided in the present application. The following describes the test device for an interactive scenario provided in the present application.
[0063] Figure 4 Schematic diagram of a test device for an interactive scenario according to an embodiment of the present application. Figure 4 As shown, the device includes:
[0064] A first determining unit 10 is configured to determine a target interaction scenario to be tested, and determine at least one interaction behavior and an execution order of the at least one interaction behavior in the target interaction scenario, wherein the target interaction scenario is an interaction scenario of a transaction between the system to be tested and a third-party system;
[0065] a configuration unit 20 configured to sequentially determine a current interactive behavior from at least one interactive behavior according to an execution order, and configure a simulation device according to resource configuration information of the current interactive behavior to obtain a configured simulation device, wherein the configured simulation device is used to simulate a third-party system;
[0066] The transmission unit 30 is used to sequentially control the configured simulation device and the system under test to transmit the target message of the current interactive behavior according to the preset rules, thereby obtaining the simulation result of the current interactive behavior, until all interactive behaviors of the target interactive scenario are tested and the simulation results of all interactive behaviors are obtained;
[0067] The second determining unit 40 is configured to determine a test result of a target interaction scenario according to simulation results of all interaction behaviors.
[0068] The test device for an interactive scenario provided by an embodiment of the present application, through a first determination unit 10, determines a target interactive scenario to be tested, and determines at least one interactive behavior in the target interactive scenario and the execution order of at least one interactive behavior, wherein the target interactive scenario is an interactive scenario for transactions between the system to be tested and a third-party system; a configuration unit 20, sequentially determines the current interactive behavior from at least one interactive behavior according to the execution order, and configures a simulation device according to resource configuration information of the current interactive behavior to obtain a configured simulation device, wherein the configured simulation device is used to simulate the third-party system; a transmission unit 30, sequentially controls the configured simulation device and the system to be tested to transmit the target message of the current interactive behavior according to a preset rule, to obtain a simulation result of the current interactive behavior, until all interactive behaviors of the target interactive scenario are tested and the simulation results of all interactive behaviors are obtained; a second determination unit 40, determines the test result of the target interactive scenario according to the simulation results of all interactive behaviors, thereby solving the problem of relying on a third-party system when testing interactive scenarios in the related art, resulting in low test efficiency. The simulation device simulates the third-party system to establish a network connection with the system to be tested, transmits messages to simulate the interactive scenario, thereby achieving the effect of improving the test efficiency of the interactive scenario.
[0069] Optionally, in the test device for the interactive scenario provided in an embodiment of the present application, the device also includes: an acquisition unit for acquiring a preset message format and a preset data transmission protocol of a third-party system; an establishment unit for configuring the format of messages sent and received by the simulation device to a preset message format, configuring the data transmission protocol of the simulation device to a preset data transmission protocol, and establishing a network connection between the simulation device and the system to be tested according to the preset message format and the preset data transmission protocol.
[0070] Optionally, in the testing device for the interaction scenario provided in an embodiment of the present application, the second determination unit 40 includes: a first determination module, used to determine whether the simulated interaction behavior has passed the test based on each simulation result; a second determination module, used to determine that the target interaction scenario has passed the test when all simulation results indicate that the simulated interaction behavior has passed the test; and a third determination module, used to determine that the target interaction scenario has not passed the test when there is a simulation result indicating that the simulated interaction behavior has not passed the test.
[0071] Optionally, in the testing device for the interactive scenario provided in the embodiment of the present application, the first determination module includes: an acquisition submodule, used to obtain the interactive content of the corresponding interactive behavior from the simulation results, and determine whether the interactive content is the same as the preset interactive content; a judgment submodule, used to determine whether the corresponding interactive behavior has an abnormality when the interactive content is the same as the preset interactive content; and a determination submodule, used to determine that the corresponding interactive behavior test has passed when no abnormality has occurred in the corresponding interactive behavior.
[0072] Optionally, in the test device for the interactive scenario provided in the embodiment of the present application, the judgment submodule includes: a network connection judgment module, which is used to judge whether the network connection between the configured simulation device and the system to be tested is stable, and determine that the corresponding interactive behavior is abnormal when the network connection is unstable; a message transmission duration judgment module, which is used to judge whether the message transmission duration between the configured simulation device and the system to be tested exceeds a preset duration threshold when the network connection is stable; an interactive behavior judgment module, which is used to determine that the corresponding interactive behavior is abnormal when the message transmission duration exceeds the preset duration threshold; a target message judgment module, which is used to judge whether there is an error in the target message when the message transmission duration does not exceed the preset duration threshold, and determine that the corresponding interactive behavior is abnormal when there is an error in the target message.
[0073] Optionally, in the test device for the interactive scenario provided in an embodiment of the present application, the target message judgment module includes: a message format judgment module, used to judge whether the format of the target message is the same as the preset message format, judge whether there is an error in the encoding of the target message, and judge whether the content of the target message is missing; a message error determination module, used to determine that there is an error in the target message when the format of the target message is different from the preset message format, and / or there is an error in the encoding of the target message, and / or the content of the target message is missing.
[0074] Optionally, in the test device for the interaction scenario provided in the embodiment of the present application, when the target interaction scenario is a fault scenario, the device further includes: a target number acquisition unit, used to acquire the fault ratio of the target interaction scenario and the target number of concurrent interaction behaviors, wherein the fault ratio is the ratio of abnormal interaction behaviors in the concurrent interaction behaviors; a first configuration unit of the simulation device, used to configure the simulation device according to the fault ratio and the target number to obtain an updated simulation device; a second configuration unit of the simulation device, used to execute the step of configuring the simulation device according to the resource configuration information of the current interaction behavior based on the updated simulation device; determining the test result of the target interaction scenario according to the simulation results of all interaction behaviors includes: determining the number of abnormal interaction behaviors based on the simulation results of all interaction behaviors, obtaining the number of faults, and judging whether the number of faults is the same as the target number; when the number of faults is the same as the target number, determining that the target interaction scenario test has passed.
[0075] The testing device for the interactive scenario includes a processor and a memory. The above-mentioned first determination unit 10, configuration unit 20, transmission unit 30 and second determination unit 40 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0076] The processor contains a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and by adjusting the kernel parameters, the file processing can be compatible with multiple platforms.
[0077] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0078] An embodiment of the present invention provides a computer-readable storage medium having a program stored thereon, which implements the test method of the interaction scenario when executed by a processor.
[0079] An embodiment of the present invention provides a processor, which is used to run a program, wherein the testing method of the interaction scenario is executed when the program is running.
[0080] like Figure 5 As shown, an embodiment of the present invention provides an electronic device. Device 501 includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, a pressure sensor is constructed. The device herein can be a server, a PC, a PAD, a mobile phone, etc.
[0081] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0082] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes 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 steps in the process. 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.
[0083] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work 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 The function specified in one or more boxes.
[0084] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0085] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0086] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0087] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0088] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0089] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0090] The above are merely embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application should all be included within the scope of the claims of the present application.
Claims
1. A testing method for an interactive scenario, characterized in that: include: Determining a target interaction scenario to be tested, and determining at least one interaction behavior in the target interaction scenario and an execution order of the at least one interaction behavior, wherein the target interaction scenario is an interaction scenario of a transaction between the system to be tested and a third-party system; determining a current interactive behavior from the at least one interactive behavior in sequence according to the execution order, and configuring a simulation device according to resource configuration information of the current interactive behavior to obtain a configured simulation device, wherein the configured simulation device is used to simulate the third-party system; Controlling the configured simulation device and the system to be tested to transmit the target message of the current interactive behavior in accordance with preset rules, and obtaining the simulation result of the current interactive behavior, until all interactive behaviors of the target interactive scenario are tested, and obtaining the simulation results of all interactive behaviors; Determine the test result of the target interaction scenario according to the simulation results of all interaction behaviors; Before configuring the simulation device according to the resource configuration information of the current interactive behavior to obtain the configured simulation device, the method further includes: obtaining a preset message format and a preset data transmission protocol of the third-party system; configuring the format of messages sent and received by the simulation device to the preset message format, configuring the data transmission protocol of the simulation device to the preset data transmission protocol, and establishing a network connection between the simulation device and the system under test according to the preset message format and the preset data transmission protocol; Determining the test result of the target interaction scenario based on the simulation results of all interaction behaviors includes: determining whether the simulated interaction behavior has passed the test based on each simulation result; when all simulation results indicate that the simulated interaction behavior has passed the test, determining that the target interaction scenario has passed the test; when there is a simulation result indicating that the simulated interaction behavior has not passed the test, determining that the target interaction scenario has not passed the test.
2. The method according to claim 1, characterized in that Determining whether the simulated interactive behavior passes the test based on each simulation result includes: Obtaining the interaction content of the corresponding interaction behavior from the simulation result, and determining whether the interaction content is the same as the preset interaction content; When the interaction content is the same as the preset interaction content, determining whether an abnormality occurs in the corresponding interaction behavior; If no abnormality occurs in the corresponding interactive behavior, it is determined that the corresponding interactive behavior test has passed.
3. The method according to claim 2, characterized in that Determining whether an abnormality occurs in the corresponding interactive behavior includes: Determining whether a network connection between the configured simulation device and the system to be tested is stable, and if the network connection is unstable, determining that a corresponding interaction behavior is abnormal; When the network connection is stable, determining whether the message transmission time between the configured simulation device and the system to be tested exceeds a preset time threshold; When the message transmission time exceeds the preset time threshold, determining that the corresponding interaction behavior is abnormal; When the message transmission duration does not exceed the preset duration threshold, it is determined whether the target message has an error. When the target message has an error, it is determined that the corresponding interactive behavior is abnormal.
4. The method according to claim 3, characterized in that Determining whether the target message has an error includes: Determining whether the format of the target message is the same as the preset message format, determining whether there is an error in the encoding of the target message, and determining whether the content of the target message is missing; In the case that the format of the target message is different from the preset message format, and / or there is an error in the encoding of the target message, and / or the content of the target message is missing, it is determined that there is an error in the target message.
5. The method according to claim 1, wherein When the target interaction scenario is a fault scenario, before configuring the simulation device according to the resource configuration information of the current interaction behavior, the method further includes: Obtaining a failure ratio of the target interaction scenario and a target number of concurrent interaction behaviors, wherein the failure ratio is the ratio of abnormal interaction behaviors to the concurrent interaction behaviors; configuring the simulation device according to the failure ratio and the target number to obtain an updated simulation device; The step of configuring the simulation device according to the resource configuration information of the current interactive behavior is performed based on the updated simulation device; The test results of the target interaction scenario are determined based on the simulation results of all interaction behaviors, including: Determining the number of abnormal interactive behaviors in simulation results of all interactive behaviors to obtain a number of faults, and determining whether the number of faults is the same as the target number; When the number of faults is the same as the target number, it is determined that the target interaction scenario test has passed.
6. A testing system for an interactive scenario, used to implement the testing method for an interactive scenario according to any one of claims 1 to 5, characterized in that: include: A simulation device, used to deploy configuration files of interactive behaviors in a target interactive scenario and configure message interfaces for interactive behaviors to simulate a third-party system; The system to be tested is configured to establish a network connection with the simulation device and simulate the interaction behavior in the target interaction scenario by transmitting messages with the simulation device; The host computer is connected to the system to be tested and is used to determine the target interaction scenario test result according to the simulation results of all the interaction behaviors after the simulation of all the interaction behaviors of the target interaction scenario is completed.
7. A processor, characterized in that: The processor is configured to run a program, wherein the program, when running, executes the method for testing an interactive scenario according to any one of claims 1 to 5.
8. An electronic device, characterized in that: The system comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the testing method for the interactive scenario described in any one of claims 1 to 5.
Citation Information
Patent Citations
Foreign exchange transaction simulation test method and device, computer equipment and storage medium
CN112634047A
Automatic portable device testing method and system
CN113760746A