Business test method and device, electronic equipment, storage medium and program product
By constructing simulated response data, the problem of being unable to directly obtain the second business application response data during business testing is solved, improving the accuracy of the test and making it more suitable for actual business scenarios.
Patent Information
- Application Number
- CN202410643336.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-09-17
AI Technical Summary
In business testing, it is difficult for the existing technology to accurately simulate actual business scenarios when the response data of the second business application cannot be directly obtained, resulting in testing that is not close to reality and lacks accuracy.
By responding to the test request of the first business application, determining the test requirement data and configuration information of the target business, constructing simulated response data, simulating the response data of the second business application, and returning it to the first business application to achieve accurate business testing sex.
The accuracy of business testing is improved, making it more suitable for actual business scenarios, and enabling effective testing when the response data of the second business application cannot be directly obtained.
Smart Images

Figure CN118656295A
Abstract
Description
Technical Field
[0001] The present application relates to the field of testing technology, and in particular to a service testing method, device, electronic device, storage medium and program product. Background Art
[0002] In actual applications, different business applications may be connected in series. The so-called series connection means that the triggering of the operation of one business application depends on the operation of another business application. For example, in a payment application, after a successful payment, it is usually necessary to send a notification message to other third-party applications (such as order applications) and receive data or actions returned from the third-party application before the payment application can continue the subsequent process. Therefore, when testing the business in a business application, the input or interaction of the third-party application is required to complete the test. Summary of the invention
[0003] The embodiments of the present application provide a business testing method, device, electronic device, storage medium and program product, which can make the business testing more in line with the actual business scenarios and improve the accuracy of the business testing.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] The present application provides a service testing method, the method comprising:
[0006] In response to a business test request sent by a first business application, determine the target business to be tested, the test requirement data corresponding to the target business, and the configuration information used for data construction; perform data construction based on the test requirement data and the configuration information to obtain simulated response data, and the simulated response data is used to simulate the response data of the second business application to the business test request; and return the simulated response data to the first business application.
[0007] The present application provides a service testing device, including:
[0008] A data acquisition module, configured to determine, in response to a service test request sent by a first service application, a target service to be tested, test requirement data corresponding to the target service, and configuration information for data construction;
[0009] A data construction module, used to perform data construction based on the test requirement data and the configuration information to obtain simulated response data, wherein the simulated response data is used to simulate the response data of the second business application to the business test request;
[0010] A data return module is used to return the simulated response data to the first business application.
[0011] An embodiment of the present application provides an electronic device, the electronic device comprising:
[0012] A memory for storing computer executable instructions;
[0013] The processor is used to implement the service testing method provided in the embodiment of the present application when executing the computer executable instructions stored in the memory.
[0014] An embodiment of the present application provides a computer-readable storage medium storing a computer program or computer-executable instructions for implementing the service testing method provided in the embodiment of the present application when executed by a processor.
[0015] An embodiment of the present application provides a computer program product, including a computer program or computer executable instructions. When the computer program or computer executable instructions are executed by a processor, the service testing method provided in the embodiment of the present application is implemented.
[0016] The embodiments of the present application have the following beneficial effects:
[0017] By applying the embodiment of the present application, in response to a business test request sent by a first business application, a target business to be tested in the first business application is determined, and test requirement data corresponding to the target business and configuration information for data construction are obtained, so as to perform data construction based on the test requirement data and the configuration information to obtain simulated response data, and the simulated response data is response data of the simulated second business application to the business test request, and the simulated response data is returned to the first business application to complete the test of the target business of the first business application; in this way, when the target business of the first business application is tested, if the response data for the target business cannot be directly obtained from the second business application, the series connection and data correlation between the first business application and the second business application in the actual business scenario are achieved in the test of the target business, thereby making the business test more in line with the actual business scenario and improving the accuracy of the business test. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 It is a schematic diagram of the architecture of the service testing system provided in the embodiment of the present application;
[0019] Figure 2 It is a structural diagram of an electronic device for implementing a service testing method provided in an embodiment of the present application;
[0020] Figure 3 It is a flowchart of the service testing method provided in the embodiment of the present application;
[0021] Figure 4 It is a flowchart of the service testing method provided in the embodiment of the present application;
[0022] Figure 5 It is a flowchart of the service testing method provided in the embodiment of the present application;
[0023] Figure 6 It is a flowchart of the service testing method provided in the embodiment of the present application;
[0024] Figure 7 It is a flowchart of the service testing method provided in the embodiment of the present application;
[0025] Figure 8 It is a flowchart of the service testing method provided in the embodiment of the present application;
[0026] Fig. 9 is a schematic diagram of the architecture of a simulation test system provided in an embodiment of the present application;
[0027] Fig.10 It is a flowchart of a simulation test configuration method provided in an embodiment of the present application;
[0028] Fig.11 It is a flowchart of a simulation test execution method provided in an embodiment of the present application;
[0029] Fig.12 It is a flowchart of the number generation component provided in the embodiment of the present application for generating numbers based on the Mock result and the configuration information for data construction. DETAILED DESCRIPTION
[0030] 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. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.
[0031] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0032] In the following description, the terms "first\second\third" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second\third" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
[0033] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0034] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meanings as those commonly understood by those skilled in the art. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0035] The relevant data collection and processing in the embodiments of this application should be strictly in accordance with the requirements of relevant national laws and regulations when applied in examples, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of authorization of laws and regulations and the personal information subject.
[0036] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.
[0037] 1) Business applications: applications or clients running in the terminal to provide various business services, such as order applications, payment applications, etc.
[0038] 2) In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed may be in real time or have a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations executed.
[0039] 3) Mock testing: It is a technology that uses simulated objects or fake objects to replace real components. It can be understood as a technology used to simulate and replace the interface of a component or service under development to return simulated response data or perform specific operations. Through mock testing, the dependencies of the tested code can be isolated, making the test more controllable, stable and efficient.
[0040] 4) Number generation template: refers to a template used to simulate or generate test data in simulation testing. This template can help testers quickly generate test data that meets specific conditions when performing unit testing or integration testing to verify the correctness and stability of the code. For example, when testing the target business of a first business application, the number generation template is used to simulate and generate the response data (i.e., simulated response data) of the second business application for the target business, so as to use the simulated response data to test the target business of the first business application.
[0041] The embodiments of the present application provide a service testing method, device, electronic device, computer-readable storage medium, and computer program product, which can make service testing more in line with actual service scenarios. The exemplary application of the service testing device provided by the embodiments of the present application is described below. The device provided by the embodiments of the present application can be implemented as various types of terminals such as laptops, tablet computers, desktop computers, set-top boxes, mobile devices (e.g., mobile phones, portable music players, personal digital assistants, dedicated messaging devices, portable gaming devices), smart phones, smart speakers, smart watches, smart TVs, and vehicle-mounted terminals, and can also be implemented as servers. Below, an exemplary application when the device is implemented as a server will be described.
[0042] See also Figure 1 , Figure 1 It is an architectural diagram of the business test system 100 provided in an embodiment of the present application. In order to support a business test application, the terminal 300 is connected to the server 200 through a network. Multiple applications (such as a first business application and a second business application) are installed in the terminal 300. The graphical interface 310 is the graphical interface of the application. The network can be a wide area network or a local area network, or a combination of the two.
[0043] The server 200 is used to respond to the business test request sent by the first business application in the terminal 300. After determining the target business to be tested, the test requirement data corresponding to the target business and the configuration information used for data construction, the server 200 constructs data based on the test requirement data and the configuration information, obtains simulated response data, and returns the simulated response data to the first business application in the terminal 300, so that the first business application uses the simulated response data to test the target business.
[0044] In some embodiments, the server 200 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms. The terminal and the server may be directly or indirectly connected via wired or wireless communication, which is not limited in the embodiments of the present application.
[0045] See also Figure 2 , Figure 2 is a structural diagram of an electronic device 400 for implementing a service testing method provided in an embodiment of the present application, Figure 2 The electronic device 400 shown includes: at least one processor 410, a memory 450, at least one network interface 420 and a user interface 430. The various components in the electronic device 400 are coupled together via a bus system 440. It is understood that the bus system 440 is used to achieve connection and communication between these components. In addition to the data bus, the bus system 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the bus system 440 is not described in detail. Figure 2 Various buses are labeled as bus system 440 .
[0046] The processor 410 can be an integrated circuit chip with signal processing capabilities, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc., where the general-purpose processor can be a microprocessor or any conventional processor, etc.
[0047] The user interface 430 includes one or more output devices 431 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. The user interface 430 also includes one or more input devices 432, including user interface components that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0048] The memory 450 may be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drives, optical disk drives, etc. The memory 450 may optionally include one or more storage devices that are physically remote from the processor 410.
[0049] The memory 450 includes a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memories. The non-volatile memory may be a read-only memory (ROM), and the volatile memory may be a random access memory (RAM). The memory 450 described in the embodiments of the present application is intended to include any suitable type of memory.
[0050] In some embodiments, memory 450 can store data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof, as exemplarily described below.
[0051] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;
[0052] A network communication module 452, used to reach other electronic devices via one or more (wired or wireless) network interfaces 420, exemplary network interfaces 420 include: Bluetooth, Wireless Compatibility Certification (WiFi), and Universal Serial Bus (USB), etc.;
[0053] a presentation module 453 for enabling presentation of information via one or more output devices 431 (e.g., display screen, speaker, etc.) associated with the user interface 430 (e.g., a user interface for operating peripherals and displaying content and information);
[0054] The input processing module 454 is used to detect one or more user inputs or interactions from one of the one or more input devices 432 and translate the detected inputs or interactions.
[0055] In some embodiments, the device provided in the embodiments of the present application can be implemented in software. Figure 2 The service testing device 455 stored in the memory 450 is shown, which can be software in the form of a program and a plug-in, etc., including the following software modules: a data acquisition module 4551, a data construction module 4552 and a data return module 4553. These modules are logical, so they can be arbitrarily combined or further split according to the functions implemented. The functions of each module will be explained below.
[0056] In other embodiments, the device provided in the embodiments of the present application can be implemented in hardware. As an example, the device provided in the embodiments of the present application can be a processor in the form of a hardware decoding processor, which is programmed to execute the service testing method provided in the embodiments of the present application. For example, the processor in the form of a hardware decoding processor can adopt one or more application-specific integrated circuits (Application Specific Integrated Circuit, ASIC), digital signal processors (Digital Signal Processor, DSP), programmable logic devices (Programmable Logic Device, PLD), complex programmable logic devices (Complex Programmable Logic Device, CPLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other electronic components.
[0057] As mentioned above, the service testing method provided in the embodiment of the present application can be implemented by various types of electronic devices, for example, Figure 1 The terminal 300 and the server 200 in the embodiment can be executed by either one of them separately, or by Figure 1 The terminal 300 and the server 200 in the embodiment cooperate to execute. Figure 1 The service testing method provided in the embodiment of the present application is described as an example in which the server in the embodiment executes the service testing method provided in the embodiment of the present application alone. Figure 3 , Figure 3 This is a flow chart of the service testing method provided in the embodiment of the present application, which will be combined with Figure 3 The steps shown are explained.
[0058] Step 101: In response to a service test request sent by a first service application, determine a target service to be tested, test requirement data corresponding to the target service, and configuration information for data construction.
[0059] In actual applications, when the tester tests the target business of the first business application, the corresponding business test request can be triggered, and the business test request for requesting the target business in the first business application to be tested can be sent to the server through the first business application. After receiving the business test request, the server responds to the business test request, determines the target business to be tested in the first business application, and obtains the test requirement data and configuration information for data construction for testing the target business. Here, the test requirement data is the test data provided by the first business application when the target business is tested by the first business application. The configuration information is determined according to the test needs of the target business, and the configuration information is used to indicate the number-making method corresponding to the test of the target business, wherein the number-making method includes but is not limited to the following methods: a method of implementing number-making by calling the interface of the business system, a method of implementing number-making by updating data through the second business application, and a method of implementing number-making by transmitting a message to the second business application.
[0060] Taking the first business application as a payment application and the second business application as an order application (not yet fully developed) as an example, the target business is an update business for the payment page in the payment application, and the business test request is used to request testing of the update business. However, due to the interaction between different business applications (such as payment applications and order applications) in the actual business process, when testing the target business of the first business application (i.e., the payment application), it depends on the response data returned by the second business application (i.e., the order application). For example, an order to be paid is displayed in the payment application. After the user pays a certain amount of the order to be paid through the payment application, if the corresponding response data cannot be directly obtained from the second business application (i.e., the order application), it is necessary to simulate the verification operation of the second business application on the paid amount, and use the verification result as the simulated response data, and test whether the updated content of the payment page meets expectations based on the simulated response data. For example, when the simulated response data indicates that the payment amount is consistent with the amount to be paid of the order, if the payment application updates the payment page to payment success based on the simulated response data, then the updated content of the payment page meets expectations; if the payment application does not update the payment page based on the simulated response data, or updates the payment page to payment failure, then the updated content of the payment page is not as expected. For another example, when the simulated response data indicates that the payment amount is inconsistent with the amount to be paid of the order, if the payment application does not update the payment page based on the simulated response data, or updates the payment page to successful payment, then it indicates that the updated content of the payment page is not in line with expectations; if the payment application updates the payment page to successful payment based on the simulated response data, then it indicates that the updated content of the payment page is in line with expectations.
[0061] More specifically, in a complete business process, the user selects a target product in the order application and places an order. The order application generates a payment order including an order number and an order price (consistent with the price of the target product) based on the price of the target product, and saves temporary order data including the payment order in the database. After that, the order application sends the payment order to the payment application for the user to pay. After the user completes the order payment through the payment application, the payment application transmits a message carrying payment data (including the order number and payment amount) to the order application, so that the order application can determine the order amount of the corresponding payment order based on the order number carried in the payment data, and then compare the payment amount carried in the payment data with the order amount. And return the comparison result to the payment application; when the comparison result indicates a successful payment (i.e., the payment amount is consistent with the order amount), the payment application generates a payment number and writes order data containing temporary order data and the payment number in the order application database. After the order application returns the order data to the payment application, the payment application generates and displays a payment success page (including payment number, order number and order amount) based on the order data. When the comparison result indicates a payment failure (i.e., the payment amount is inconsistent with the order amount), the payment application obtains the order number of this payment order, calls the interface in the order application to delete the temporary order data containing the order number, and generates and displays a payment failure page after receiving the deletion success information returned by the order application.
[0062] It can be seen that the test of the target business (i.e., the update business of the payment page) of the first business application (such as the payment application) depends on the response data of the second business application (such as the order application) to the target business (such as the order data including the order number and the order price, the comparison result of whether the payment is successful or not, etc.), and in actual applications, if the corresponding response data cannot be obtained from the second business application (such as the order application), such as when the second business application (such as the order application) has not yet been fully developed, it is necessary to simulate the response data of the second business application (such as the order application) to the target business, so as to test the target business of the first business application (such as the payment application) based on the simulated response data.
[0063] In addition, it should be noted that the above example is only used to illustrate that the target business can correspond to multiple configuration information. In the actual business process, the corresponding return results can be obtained through different configuration information. For example, when the comparison result indicates that the payment is successful, the payment application can also call the data writing interface of the order application through an interface call to write order data containing temporary order data and payment number in the order application, and receive the order data returned by the order application.
[0064] In some embodiments, before step 101, the first business application can also be configured to test the target business in the following manner, and an association relationship between the target business, test requirement data and configuration information can be established: in response to a test configuration request for the target business, the test information required for the test of the target business is configured, and the test information includes test requirement data and configuration information; in response to a test configuration determination instruction, an association relationship between the target business, test requirement data and configuration information is established; accordingly, in step 101, the target business to be tested, the test requirement data corresponding to the target business and the configuration information for data construction are determined in response to the business test request sent by the first business application, which can be achieved in the following manner: in response to the business test request, the target business to be tested is determined; based on the target business to be tested, the established association relationship is queried to obtain the test requirement data corresponding to the target business and the configuration information for data construction.
[0065] In actual applications, testers need to consider various situations in the target business execution process in advance and set the corresponding test requirement data and configuration information for various situations. For example, for the above-mentioned payment page update business, the tester needs to configure the test information shown in Table 1:
[0066] Table 1
[0067]
[0068] In order to obtain simulated response data, it is necessary to first configure the test information required for testing the target business. Taking the configuration of the first test information mentioned above as an example, there are two situations in the execution process of the target business, payment success and payment failure. Therefore, the tester sets the test requirement data (i.e., order number and payment amount) for payment success and payment failure respectively. For example, for something with an order number of 1001 and an order amount of 100 yuan, the corresponding test requirement data for successful payment includes the order number (1001) and the payment amount (100 yuan), and the corresponding test requirement data for failed payment includes the order number (1001) and the payment amount (other quantities than 100 yuan, such as 50 yuan, 80 yuan, etc.).
[0069] After the test requirement data configuration is completed, the tester configures the corresponding configuration information for each target business. The configuration information is used to generate payment data (i.e., simulated response data) carrying the order number and payment amount based on the order number and payment amount, and transmit the payment data to the order application so that the order application can compare and return the comparison results. Taking the configuration of the first test information mentioned above as an example, the configuration information can be to generate a message carrying the payment data, transmit the message to the order application to receive the comparison results returned by the order application.
[0070] After the tester completes the configuration of the test information such as the test requirement data and configuration information of the target business, by triggering the test configuration determination instruction for the configured test information (such as by triggering a determination button), the server responds to the test configuration determination instruction to establish an association relationship between the target business, the test requirement data and the configuration information. When establishing the association relationship, the business identifier of the target business (such as TestID), the configuration identifier of the test requirement data (such as MockID) and the plan identifier (PlanID) of the configuration information can be determined first, and then the business identifier (TestID), the configuration identifier (MockID) and the plan identifier (PlanID) are bound, that is, an association relationship between the business identifier (TestID), the configuration identifier (MockID) and the plan identifier (PlanID) is established, that is, an association relationship between the target business, the test requirement data and the configuration information is established.
[0071] In some embodiments, step 101 of determining the target business to be tested, the test requirement data and configuration information corresponding to the target business in response to the business test request sent by the first business application can be implemented in the following manner: determining the target business to be tested in response to the business test request; based on the target business to be tested, querying the established association relationship to obtain the test requirement data and configuration information corresponding to the target business.
[0072] In actual applications, after the server receives a business test request for requesting testing of a target business in a first business application, it obtains the business identifier of the target business (i.e., the target business to be tested) requested by the business test request, and then obtains the test requirement data and configuration information configuration associated with the target business by querying the association relationship between the previously established business identifier, configuration identifier, and plan identifier.
[0073] In some embodiments, the test configuration request carries a requirement description text, which may be input through a conversational question-and-answer method and is used to describe the configuration requirements of the test requirement data and configuration information. Figure 4 , Figure 4 is a flow chart of the service testing method provided in the embodiment of the present application. In step 101, in response to a test configuration request for a target service, the test information required for testing the target service is configured. Figure 4 Steps 104-105 shown implement:
[0074] Step 104: In response to the test configuration request, feature extraction is performed on the requirement description text to obtain configuration requirement features.
[0075] Step 105: Based on the configuration requirement characteristics, generate test information that meets the configuration requirement characteristics.
[0076] In actual applications, when the tester requests to configure the test information, he / she inputs the requirement description text and triggers the request to send the instruction to send the test configuration request carrying the requirement description text to the server. Here, the requirement description text can be a natural language description of the configuration requirements of the test requirement data and configuration information, that is, the requirement description text does not follow specific specifications, and the tester does not need to learn the input specifications of the requirement description text in advance, which reduces the workload of the tester and lowers the configuration threshold of the test requirement data and configuration information.
[0077] It should be noted that the tester may not be able to determine the configuration requirements of the test requirement data and configuration information at the first time. Therefore, the tester can enter the description text multiple times during the session, and use all the description texts entered by the tester in multiple rounds as the requirement description text. This not only improves the convenience of inputting configuration requirements, but also helps to obtain configuration requirements that meet the user, thereby improving the accuracy of subsequent simulation response data and achieving improved accuracy in the target test of the first business application.
[0078] After receiving the test configuration request, the server responds to the test configuration request by inputting the requirement description text carried in the test configuration request into the large language model for feature extraction. After obtaining the configuration requirement features of the test requirement data and configuration information, the large model generates test requirement data and configuration information that meet the tester's configuration requirements based on the configuration requirement features.
[0079] Step 102: construct data based on the test requirement data and the configuration information to obtain simulated response data, where the simulated response data is used to simulate the response data of the second business application to the business test request.
[0080] Continuing with the above example, for the four pairs of test requirement data and configuration information shown in Table 1, the obtained simulation response data is shown in Table 2:
[0081] Table 2
[0082] Test information serial number Simulating response data 1 Pay your order 2 Comparison results 3 Order data 4 Provisional order data
[0083] It can be seen that the configuration information indicates the specific content of the simulated response data. It should be noted that in this example, for ease of understanding, the configuration information is written in natural language. In actual applications, the configuration information may be the number-generating code written by the tester (that is, machine language), or it may be the number-generating code generated by calling a large language model based on the number-generating requirements in natural language form input by the tester.
[0084] In some embodiments, see Figure 5 , Figure 5is a flow chart of the service testing method provided in the embodiment of the present application. After step 101, Figure 5 Steps 106 and 107 shown obtain new test requirement data:
[0085] Step 106: Receive a first update request for the test requirement data, where the first update request is used to request an update of the test requirement data.
[0086] Step 107: In response to the first update request, the test requirement data is updated to obtain new test requirement data.
[0087] Correspondingly, data construction may be performed based on the test requirement data and configuration information to obtain simulation response data in the following manner: data construction may be performed based on new test requirement data and configuration information to obtain new simulation response data.
[0088] As described above, the tester configures the test requirement data and configuration information before the business test. However, during the actual testing of the target business, the tester has the need to update the test requirement data. Therefore, in actual applications, the tester can update the test requirement data by triggering a first update request so that the server obtains new test requirement data, and constructs data based on the new test requirement data and configuration information to obtain new simulated response data.
[0089] In some embodiments, see Figure 6 , Figure 6 is a flow chart of the service testing method provided in the embodiment of the present application. After step 101, Figure 6 Steps 108-109 shown obtain new configuration information:
[0090] Step 108: Receive a second update request for the configuration information, where the second update request is used to request to update the configuration information.
[0091] Step 109: In response to the second update request, the configuration information is updated to obtain new configuration information.
[0092] Correspondingly, data construction may be performed based on the test requirement data and the configuration information to obtain simulation response data in the following manner: data construction may be performed based on the test requirement data and the new configuration information to obtain new simulation response data.
[0093] Similarly, in the actual testing process of the target business, the tester has the need to update the configuration information. Therefore, in actual applications, the tester can update the configuration information by triggering a second update request so that the server obtains the new configuration information, and constructs data based on the test requirement data and the new configuration information to obtain new simulated response data. In addition, it can be understood that the tester can apply the above two methods at the same time to update the test requirement data and the configuration information at the same time, and the server constructs data based on the new test requirement data and the new configuration information to obtain new simulated response data.
[0094] In some embodiments, see Figure 7 , Figure 7 is a flow chart of the service testing method provided in the embodiment of the present application. If there is a number-generating template in the configuration information, step 102 can be performed by Figure 7 The steps 1021-1022 shown implement:
[0095] Step 1021: If a number generation template exists in the configuration information, the number generation template is parsed to obtain fields to be filled in the number generation template.
[0096] Step 1022: If the field to be filled is associated with the test requirement data, the test requirement data is filled into the field of the number-generating template to obtain the simulated response data.
[0097] In actual applications, when configuring configuration information, the tester can configure a number-generating template for it. The so-called number-generating template can be a string used for data construction, which contains normal fields and fields to be filled in, wherein the normal fields can be determined during the configuration period, and the tester can also revise them during the test process by triggering an update request, while the fields to be filled in need to be filled in by obtaining the test requirement data associated with the fields to be filled in during the test execution process. Specifically, the fields to be filled in can be determined based on the configuration identifier by referencing the configuration identifier of the test requirement data configured by the tester when configuring the test requirement data. Continuing with Table 1 in the above example, for the first test information, the tester configures the configuration identifier of the test requirement data for it when configuring the test requirement data, as shown in Table 3. For a complete test requirement data, it includes the configuration identifier (MockID), data a (order number) and data b (payment amount) shown in Table 3.
[0098] Table 3
[0099] Configuration Identifier (MockID) Data a (order number) Data b (payment amount) 1 1001 100 NTD
[0100] After configuring the test requirement data, the tester configures a number template for the configuration information, for example: the order number is ${MockID-1}.a, and the payment amount is ${MockID-1}.b.
[0101] Here, "Order Number" and "Payment Amount" are normal fields, "${MockID-1}.a" and "${MockID-1}.b" are fields to be filled. In this example, the server determines the test requirement data associated with the field to be filled according to the test data identifier contained in the field to be filled in the number template, fills the test requirement data into the field of the number template, obtains the simulated response data, and sends the simulated response data to the second business application according to the instructions of the configuration information, so that the second business application compares the simulated response data and returns the comparison result to the first business application.
[0102] In some embodiments, see Figure 8 , Figure 8 is a flow chart of the service testing method provided in the embodiment of the present application. If the number-generating template does not exist in the configuration information, step 102 can be performed by Figure 8 The illustrated steps 1023-1025 implement:
[0103] Step 1023: If the number-generating template does not exist in the configuration information, semantic analysis is performed on the target service to obtain semantic features of the target service.
[0104] Step 1024: Based on the semantic features, the configuration information is template constructed to obtain a construction template.
[0105] Step 1025: Fill the test requirement data into the construction template to obtain simulation response data.
[0106] In actual applications, when there is no number-making template in the configuration information, the server queries the target business corresponding to the associated TestID based on the PlanID of the configuration information and the association between the target business and the configuration information, and inputs the target business into the large language model for semantic analysis to obtain the semantic features of the target business. The large language model then generates a construction template based on the semantic features. Here, the construction template is consistent with the number-making template, and is also a string used for data construction. The normal fields and fields to be filled in it are all constructed by the large language model based on semantic features. After obtaining the construction template, the server determines the test requirement data associated with the field to be filled according to the test data identifier contained in the field to be filled in the construction template, fills the test requirement data into the field of the construction template, and after obtaining the simulated response data, sends the simulated response data to the second business application according to the instructions of the configuration information, so that the second business application compares according to the simulated response data and returns the comparison result to the first business application.
[0107] Step 103: Return the simulated response data to the first business application.
[0108] The simulated response data is used to test the target service of the first service application.
[0109] In some embodiments, the target service is an interface call service, and simulated response data can be returned to the first service application in the following manner: simulated response data corresponding to the interface call service is returned to the first service application to test the target interface indicated by the simulated response data called by the first service application.
[0110] In actual applications, if the target business is an interface calling business, that is, when testing the business of a first business application calling an interface in a second business application, the return data when the target interface in the second business application is called is generated by simulation, and the return data is returned to the first business application as simulated response data, so as to test the target interface indicated by the simulated response data called by the first business application.
[0111] In some embodiments, the target service is a data update service, and simulated response data can be returned to the first service application in the following manner: simulated response data corresponding to the data update service is returned to the first service application to test the target data indicated by the simulated response data updated by the first service application.
[0112] In actual applications, if the target business is a data update business, that is, when testing the business of a first business application updating data in a second business application, the return data after the target data in the second business application is updated is generated by simulation, and the return data is returned to the first business application as simulated response data to test the target data indicated by the updated simulated response data of the first business application.
[0113] In some embodiments, the target service is a message generating service, and simulated response data may be returned to the first service application in the following manner: simulated response data corresponding to the message generating service may be returned to the first service application to test the target message indicated by the simulated response data generated by the first service application.
[0114] In actual applications, if the target business is a message generation business, that is, when testing the business of a first business application generating a message to be sent to a second business application, the return data of the second business application after receiving the target message is simulated, and the return data is returned to the first business application as simulated response data, so as to test the target message indicated by the simulated response data generated by the first business application.
[0115] In actual applications, the first business application can continue to execute the business process of the target business after receiving the simulated response data returned by the second business application, so as to test the target business of the first business application. Continuing with the above example, the simulated response data is the comparison result returned by the order application. When the comparison result indicates that the payment is successful, the first business application should update the payment page and display the payment success page. At this time, when the target business (i.e., the update business of the payment page) of the first business application (such as the payment application) based on the simulated response data object is tested, if the test result indicates that the first business application (i.e., the payment application) displays the payment success page, it means that the test of the target business of the first business application has passed. Otherwise, if the test result indicates that the first business application does not display the payment success page (such as the payment failure page or the payment no response page, etc.), it means that the test of the target business of the first business application has failed, and the problem of the target business function of the first business application needs to be found and improved.
[0116] Through the above method, testers can configure the test requirement data and configuration information required for the test before the target business test, and establish the association relationship between the target business, test requirement data and configuration information, so that during the target business test process, data construction is performed based on the test requirement data through the configured configuration information, and simulated response data for simulating the response data of the second business application to the business test request is obtained. In the business test, business concatenation and data correlation in actual business scenarios are realized, so that the business test is more in line with the actual business scenario and the accuracy of the business test is improved.
[0117] The following will describe an exemplary application of the present invention in a practical application scenario. Fig. 9 , Fig. 9 is a schematic diagram of the architecture of the simulation test system provided in the embodiment of the present application, such as Fig. 9 As shown, the system includes: a first business application, a second business application, a Mock server, a Mock configuration platform, a number-making configuration platform, an associated repository and a number-making component; wherein the first business application is used to trigger a business test request for testing a target business to be tested, and send the business test request to the Mock server, the second business application has a business association with the first business application, the Mock server responds to the business test request, performs Mock configuration through the Mock configuration platform, the Mock configuration platform configures the test requirement data required for testing the target business, wherein the configured test requirement data is stored in the Mock configuration repository, the number-making configuration platform is used to respond to the test configuration request, configure the configuration information required for testing the target business, and store the configured configuration information in the number-making configuration repository, the associated repository is used to save the test requirement data and configuration information of the Mock configuration that establishes an associated relationship, the number-making component is used to construct business data according to the test requirement data and configuration information of the Mock configuration, and is used to obtain the Mock configuration execution from the Mock configuration platform and transmit the executed Mock result back to the Mock server of the Mock configuration platform.
[0118] In this embodiment, the tester adopts the simulation test method to test the target business. Before the simulation test is executed, the tester needs to perform relevant Mock configuration. Fig.10 , Fig.10 It is a flow chart of the simulation test configuration method provided by the embodiment of the present application. Taking the first business application as a payment application, the second business application as an order application, and the target business as the update function of the payment page as an example, the business test method provided by the embodiment of the present application is further described.
[0119] Step 201: Perform Mock configuration for the target business on the Mock configuration platform.
[0120] In actual applications, the test of the target business needs to be executed repeatedly. If the sample size of the test requirement data is small, it may not be possible to find the problems with the target business. The method of manually setting a large amount of test requirement data by the tester is not only time-consuming and labor-intensive but also may have omissions. Therefore, the tester can configure a Mock for the target business, so that during the target business testing process, the first business application (payment application) obtains the Mock result by requesting the Mock server to execute the Mock configuration associated with the target business, and uses the Mock result as the test requirement data corresponding to the target business test.
[0121] When performing Mock configuration, the tester needs to consider in advance various situations in the execution process of the target business and set the corresponding test requirement data for various situations. In this embodiment, a normal business process is that after the user completes the payment operation in the payment application, the payment application transmits the payment data carrying the order number and the payment amount to the order application. After the order application determines the order amount of the corresponding payment order based on the order number carried in the received payment data, the payment amount carried in the payment data is compared with the order amount, and the comparison result is returned to the payment application, so that the payment application can update the payment page based on the comparison result, such as displaying a payment success page after the comparison result indicates that the payment is successful, or displaying a payment failure page after the comparison result indicates that the payment fails. There are two situations in the execution process of the target business: payment success and payment failure. Therefore, the tester sets two Mock configurations respectively, one for simulating the generation of Mock results when the payment is successful, and the other for simulating the generation of Mock results when the payment fails. The specific Mock configuration content and possible Mock generation results can be seen in Table 4 below:
[0122] Table 4
[0123]
[0124] Step 202: The Mock configuration platform saves the Mock configuration and generates a MockID corresponding to the Mock configuration.
[0125] In actual applications, the Mock configuration platform saves all the Mock configurations required by the target business into the built-in Mock configuration library, and generates a MockID (i.e. the above-mentioned configuration identifier) for each Mock configuration for subsequent call during the test execution process. See Table 5 below for details:
[0126] Table 5
[0127]
[0128] Step 203: The Mock configuration platform sends the Mock configuration to the Mock server, so that the Mock server associates the target service with the Mock configuration.
[0129] In actual applications, the Mock server can generate a service identifier (TestID) for each target service and save the association between the TestID and the MockID.
[0130] Step 204: Configure the configuration information for data construction based on the MockID on the data configuration platform.
[0131] In actual applications, the test execution process of the target business may only need to be implemented through the Mock result obtained by the Mock configuration. In this case, there is no need to configure the corresponding configuration information. For those target businesses that need to execute the configuration information based on the Mock result, the tester needs to write the corresponding configuration information for the Mock configuration.
[0132] In this example, for the target business of the update function of the payment page, the tester wrote the following three configuration information for it: 1. Call the order comparison interface of the order interface to perform order comparison based on the test requirement data, and receive the returned comparison result; 2. Send a message carrying the test requirement data to the order application, so that the order application performs order comparison based on the test requirement data, and receives the returned comparison result; 3. Write the test requirement data in the order application database, so that the order application performs order comparison based on the test requirement data, and receives the returned comparison result. It can be understood that these three configuration information are only different in form, and their purpose and results are consistent. Here, it is only to illustrate that the configuration information in the business testing method provided in the embodiment of the present application includes at least one of the following number-making methods according to business needs: calling the interface of the business system to realize number-making, updating data in the second business application to realize number-making, and transmitting messages to the second business application to realize number-making.
[0133] Step 205: The number creation configuration platform saves the configuration information and generates a PlanID corresponding to the configuration information.
[0134] In actual applications, the data configuration platform saves all the configuration information required by the target business into the built-in data configuration library, and generates a PlanID for each configuration information for subsequent test execution. See Table 6 below for details:
[0135] Table 6
[0136]
[0137] Step 206: Save the association relationship between the MockID and the PlanID in the association repository.
[0138] In actual applications, the Zaoshu configuration platform saves all the configuration information associated with the Mock configuration, and the association repository saves the association between the MockID and the PlanID for subsequent queries. In this example, each Mock configuration corresponds to three pieces of configuration information, as shown in Table 7 below:
[0139] Table 7
[0140]
[0141]
[0142] Next, combine Fig.11 , Fig.11 It is a flowchart of the simulation test execution method provided in the embodiment of the present application, and continues to explain the business testing method provided in the embodiment of the present application.
[0143] Step 301: In response to a service test request sent by a payment application, a target service to be tested is determined.
[0144] In actual applications, the mock server receives a business test request sent by the payment application and determines that the target business to be tested is an update function of the payment page.
[0145] Step 302: The Mock server obtains the Mock configuration associated with the target business and executes it to obtain the Mock result, and reports the Mock result to the Mock configuration platform.
[0146] In actual applications, the Mock server obtains the Mock configuration associated with the target business through the TestID of the target business and the association between TestID and MockID, executes and obtains the Mock result, and reports the obtained Mock result to the Mock configuration platform for storage to wait for subsequent calls.
[0147] Step 303: The Mock configuration platform calls the associated repository to query whether the MockID of the Mock configuration corresponding to the Mock result is associated with the PlanID.
[0148] Here, when the Mock configuration platform fails to query the MockID associated with the PlanID from the associated repository, step 304 is executed, otherwise step 305 is executed.
[0149] Step 304: The Mock server returns the Mock result to the payment application.
[0150] In actual applications, when the Mock configuration platform fails to query the MockID associated with the PlanID from the associated repository, it means that there is no cross-system business association in the execution process of the target business. The test of the target business only requires the Mock result. Therefore, the Mock result is directly returned to the payment application, so that the payment application tests the target business based on the Mock result.
[0151] Step 305: The number generation configuration platform obtains the configuration information corresponding to the PlanID.
[0152] In actual applications, the Zaoshu configuration platform obtains the corresponding configuration information from the Zaoshu configuration library based on PlanID.
[0153] Step 306: The number generation component generates numbers according to the Mock result and the configuration information.
[0154] As mentioned above, the three configuration information provided in this example are only different in form, but their purpose and results are the same. In an actual target business test process, only one of the configuration information will be used for data construction. Fig.12 , Fig.12 This is a flow chart of the number generation component provided in the embodiment of the present application based on the Mock result and configuration information to generate numbers, combined with Fig.12 The service testing method provided in the embodiment of the present application is further described.
[0155] Step 401: Determine whether the configuration information includes a number generation template.
[0156] Here, if the configuration information includes a number generation template, step 402 is executed, otherwise step 403 is executed.
[0157] Step 402: the expression parsing engine in the number-generating component parses the number-generating template, fills the data into the to-be-filled field of the number-generating template, and obtains simulated response data.
[0158] Here, the so-called number-making template is a string used for data construction, which contains normal fields and fields to be filled, wherein the normal fields can be determined during the configuration, and the tester can also revise them during the test process by triggering an update request, and the content filled in the fields to be filled may be the Mock result associated with the fields to be filled, or it may be the data actually generated in the target business execution process. Specifically, the fields to be filled can be determined by referencing the configuration identifier corresponding to the Mock result configured by the tester when configuring the test requirement data to determine the Mock result associated with the fields to be filled. Similarly, the data actually generated in the target business execution process can also have its specific identifier for reference by the fields to be filled. The server determines the test requirement data associated with the fields to be filled according to the test data identifier contained in the fields to be filled in the number-making template, fills the test requirement data into the fields of the number-making template, obtains the simulated response data, and sends the simulated response data to the second application according to the instructions of the configuration information, so that the second application compares according to the simulated response data and returns the comparison result to the first business application.
[0159] Step 403: semantic analysis is performed on the target service to obtain semantic features of the target service, and based on the semantic features, template construction is performed on the configuration information to obtain a construction template.
[0160] Step 404: Fill the test requirement data into the construction template to obtain simulation response data.
[0161] In actual applications, when there is no number-making template in the configuration information, the server queries the target business corresponding to the associated TestID based on the PlanID of the configuration information and the association between the target business and the configuration information, and inputs the target business into the large language model for semantic analysis to obtain the semantic features of the target business. The large language model then generates a construction template based on the semantic features. Here, the construction template is consistent with the number-making template, and is also a string used for data construction. The normal fields and fields to be filled in it are all constructed by the large language model based on semantic features. After obtaining the construction template, the server determines the test requirement data associated with the field to be filled according to the test data identifier contained in the field to be filled in the construction template, fills the test requirement data into the field of the construction template, and after obtaining the simulated response data, sends the simulated response data to the second application according to the instructions of the configuration information, so that the second application compares according to the simulated response data and returns the comparison result to the first business application.
[0162] In this example, the simulated response data is the comparison result returned by the order application. When the comparison result indicates that the payment is successful, the payment application should update the payment page and display the payment success page. At this time, if the test result indicates that the payment application displays the payment success page, it means that the test of the target business of the payment application has passed. Otherwise, if the test result indicates that the payment application does not display the payment success page (such as the payment failure page or the payment no response page, etc.), it means that the test of the target business of the payment application has failed, and it is necessary to find problems and improve the target business functions of the payment application.
[0163] Through the above method, the tester can provide a larger amount of test demand data that meets the test requirements during the test execution by performing Mock configuration, and construct data according to the configuration information configured by the tester during the test execution, and obtain simulated response data for simulating the response data of the second business application to the business test request, thereby realizing business concatenation and data correlation in actual business scenarios in business testing, thereby making business testing more in line with actual business scenarios and improving the accuracy of business testing.
[0164] So far, the business testing method provided by the embodiment of the present application has been described in combination with the exemplary application and implementation of the electronic device provided by the embodiment of the present application. The following will continue to describe the processing scheme for implementing the buried data by cooperating with each module in the business testing device 455 provided by the embodiment of the present application.
[0165] The data acquisition module 4551 is used to respond to the service test request sent by the first service application, determine the target service to be tested, the test requirement data corresponding to the target service, and the configuration information for data construction.
[0166] A data construction module 4552 is used to perform data construction based on the test requirement data and the configuration information to obtain simulation response data, where the simulation response data is used to simulate the response data of the second business application to the business test request;
[0167] The data return module 4553 is used to return the simulated response data to the first business application.
[0168] In some embodiments, the data acquisition module is also used to configure the test information required for the test of the target business in response to a test configuration request for the target business, the test information including test requirement data and configuration information for data construction; in response to a test configuration determination instruction, an association relationship is established between the target business, the test requirement data and the configuration information; the data acquisition module is also used to determine the target business to be tested in response to the business test request; based on the target business to be tested, the established association relationship is queried to obtain the test requirement data and the configuration information corresponding to the target business.
[0169] In some embodiments, the test configuration request carries a requirement description text, which is input through a conversational question-and-answer method and is used to describe the configuration requirements of the test requirement data and configuration information. The data acquisition module is also used to respond to the test configuration request, perform feature extraction on the requirement description text, and obtain configuration requirement features; based on the configuration requirement features, generate the test information that meets the configuration requirement features.
[0170] In some embodiments, the data acquisition module is also used to receive a first update request for the test requirement data, and the first update request is used to request an update to the test requirement data; in response to the first update request, the test requirement data is updated to obtain new test requirement data; the data construction module is also used to perform data construction based on the new test requirement data and the configuration information to obtain new simulation response data.
[0171] In some embodiments, the data acquisition module is also used to receive a second update request for the configuration information, and the second update request is used to request an update to the configuration information; in response to the second update request, the configuration information is updated to obtain new configuration information; the data construction module is also used to perform data construction based on the test requirement data and the new configuration information to obtain new simulation response data.
[0172] In some embodiments, the data construction module is also used to parse the number template if there is a number template in the configuration information to obtain the fields to be filled in the number template; if the fields to be filled are associated with the test requirement data, the test requirement data is filled into the fields of the number template to obtain simulation response data.
[0173] In some embodiments, the data construction module is also used to perform semantic analysis on the target business to obtain semantic features of the target business if no number-generating template exists in the configuration information; perform template construction on the configuration information based on the semantic features to obtain a construction template; and fill the test requirement data into the construction template to obtain simulated response data.
[0174] In some embodiments, the target service is an interface calling service, and the data return module is further used to return the simulated response data corresponding to the interface calling service to the first service application, so as to test the target interface indicated by the simulated response data called by the first service application.
[0175] In some embodiments, the target service is a data update service, and the data return module is further used to return the simulated response data corresponding to the data update service to the first service application to test the first service application updating the target data indicated by the simulated response data.
[0176] In some embodiments, the target service is a message generating service, and the data returning module is further used to return the simulated response data corresponding to the message generating service to the first service application, so as to test the target message indicated by the simulated response data generated by the first service application.
[0177] The embodiment of the present application provides a computer program product, which includes a computer program or a computer executable instruction, and the computer program or the computer executable instruction is stored in a computer readable storage medium. The processor of the electronic device reads the computer executable instruction from the computer readable storage medium, and the processor executes the computer executable instruction, so that the electronic device executes the service test method described above in the embodiment of the present application.
[0178] The present application embodiment provides a computer-readable storage medium, in which computer executable instructions or computer programs are stored. When the computer executable instructions or computer programs are executed by a processor, the processor will be caused to execute the service testing method provided by the present application embodiment, for example, Figure 3 Business testing method shown.
[0179] In some embodiments, the computer-readable storage medium may be a memory such as RAM, ROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories.
[0180] In some embodiments, computer executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0181] As an example, computer-executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file that stores other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0182] As an example, computer executable instructions may be deployed to be executed on one electronic device, or on multiple electronic devices located at one site, or on multiple electronic devices distributed at multiple sites and interconnected by a communication network.
[0183] The above is only an embodiment of the present application and is not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.
Claims
1. A service testing method, characterized in that: The method comprises: In response to a service test request sent by the first service application, determining a target service to be tested, test requirement data corresponding to the target service, and configuration information for data construction; Performing data construction based on the test requirement data and the configuration information to obtain simulated response data, wherein the simulated response data is used to simulate response data of the second business application to the business test request; The simulated response data is returned to the first business application.
2. The method according to claim 1, characterized in that Before responding to the service test request sent by the first service application, the method further includes: In response to a test configuration request for the target service, configure test information required for testing the target service, the test information including test requirement data and configuration information for data construction; In response to a test configuration determination instruction, establishing an association relationship between the target service, the test requirement data and the configuration information; The step of determining, in response to a service test request sent by the first service application, a target service to be tested, test requirement data corresponding to the target service, and configuration information for data construction includes: In response to the service test request, determining the target service to be tested; Based on the target business to be tested, the established association relationship is queried to obtain the test requirement data and the configuration information corresponding to the target business.
3. The method according to claim 2, characterized in that The test configuration request carries a requirement description text, which is input through a conversational question-and-answer mode and is used to describe the configuration requirements of the test requirement data and the configuration information used for data construction; The step of configuring, in response to the test configuration request for the target service, test information required for testing the target service includes: In response to the test configuration request, feature extraction is performed on the requirement description text to obtain configuration requirement features; Based on the configuration requirement characteristics, the test information that meets the configuration requirement characteristics is generated.
4. The method according to claim 1, characterized in that After determining the target service to be tested, the test requirement data corresponding to the target service, and the configuration information for data construction, the method further includes: receiving a first update request for the test requirement data, wherein the first update request is used to request an update of the test requirement data; In response to the first update request, updating the test requirement data to obtain new test requirement data; The data construction based on the test requirement data and the configuration information to obtain simulation response data includes: Data is constructed based on the new test requirement data and the configuration information to obtain new simulation response data.
5. The method according to claim 1, characterized in that After determining the target service to be tested, the test requirement data corresponding to the target service, and the configuration information for data construction, the method further includes: receiving a second update request for the configuration information, where the second update request is used to request an update of the configuration information; In response to the second update request, updating the configuration information to obtain new configuration information; The data construction based on the test requirement data and the configuration information to obtain simulation response data includes: Data is constructed based on the new configuration information and the test requirement data to obtain new simulation response data.
6. The method according to claim 1, characterized in that The data construction based on the test requirement data and the configuration information to obtain simulation response data includes: If a number generation template exists in the configuration information, the number generation template is parsed to obtain fields to be filled in the number generation template; If the field to be filled is associated with the test requirement data, the test requirement data is filled into the field of the number-generating template to obtain simulated response data.
7. The method according to claim 1, characterized in that The data construction based on the test requirement data and the configuration information to obtain simulation response data includes: If the number-generating template does not exist in the configuration information, semantic analysis is performed on the target task to obtain semantic features of the target task; Based on the semantic features, template construction is performed on the configuration information to obtain a construction template; The test requirement data is filled into the construction template to obtain simulation response data.
8. The method according to claim 1, characterized in that The returning the simulated response data to the first business application includes: If the target service is an interface call service, returning the simulated response data corresponding to the interface call service to the first service application, so as to test the first service application calling the target interface indicated by the simulated response data; or, If the target service is a data update service, returning the simulated response data corresponding to the data update service to the first service application to test whether the first service application updates the target data indicated by the simulated response data; or, If the target service is a message generation service, the simulated response data corresponding to the message generation service is returned to the first service application, so as to test the target message indicated by the simulated response data generated by the first service application.
9. A service testing device, characterized in that: The device comprises: A data acquisition module, configured to determine, in response to a service test request sent by a first service application, a target service to be tested, test requirement data corresponding to the target service, and configuration information for data construction; A data construction module, used to perform data construction based on the test requirement data and the configuration information to obtain simulated response data, wherein the simulated response data is used to simulate the response data of the second business application to the business test request; A data return module is used to return the simulated response data to the first business application.
10. An electronic device, characterized in that: The electronic device comprises: A memory for storing computer executable instructions; A processor, used to implement the service testing method described in any one of claims 1 to 8 when executing the computer executable instructions stored in the memory.
11. A computer-readable storage medium storing computer-executable instructions or a computer program, characterized in that: The computer executable instructions or computer program, when executed by a processor, implements the service testing method according to any one of claims 1 to 8.
12. A computer program product comprising computer executable instructions or a computer program, characterized in that: The computer executable instructions or computer programs implement the service testing method according to any one of claims 1 to 8 when executed by a processor.
Citation Information
Cited By
Vehicle safety detection method and related device
CN120567504A
