Automatic test method and device of functional module, computer equipment and medium
Through automated testing methods, user operations of unreleased functional modules of the merchant service system are simulated, virtual response data is generated and verified, which solves the problem of low manual testing efficiency and achieves efficient functional module testing and risk reduction.
Patent Information
- Application Number
- CN202410496117.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-24
- Publication Date
- 2024-08-23
AI Technical Summary
The manual testing of existing merchant service systems before the release of functional modules is inefficient, resulting in increased product operation risks.
The automated testing method is used to obtain the test operation events of the target product functional module, simulate user trigger operations, generate virtual response data, perform data verification, and perform prompt operations based on the verification results to achieve automated testing.
It improves testing efficiency, reduces the risk of product leakage, replaces manual testing, and improves testing efficiency and accuracy.
Smart Images

Figure CN118535456A
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to the field of automatic testing technology, and in particular, to an automatic testing method, apparatus, computer equipment, and medium applicable to a functional module. Background Art
[0002] Merchants can register in the designated merchant service system, which can provide different product function modules to each merchant to facilitate product management.
[0003] At present, the merchant service system will release / develop new product function modules during function maintenance. However, before the new product function modules are released to the merchant service system, in order to avoid affecting the operation of the original product function modules, regression testing is required for the new product function modules. The existing testing method is mainly manual testing by staff.
[0004] However, the existing method has low testing efficiency. Summary of the invention
[0005] The embodiments described herein provide a method, apparatus, computer device, and medium for automated testing of a functional module, which overcome the above-mentioned problems.
[0006] In a first aspect, according to the content of the present disclosure, there is provided an automated testing method for a functional module, comprising:
[0007] Acquire a test operation event of a target product function module, wherein the test operation event is used to describe a user-triggered operation corresponding to the target product function module, and the target product function module is an unpublished function module in the merchant service system;
[0008] Simulating a user triggering operation corresponding to the target product function module to obtain corresponding virtual response data, wherein the virtual response data is used to describe a simulated operation result obtained by the target product function module after executing the user triggering operation;
[0009] Performing data verification on the virtual response data, wherein the data verification is used to verify the difference between the virtual response data and the estimated response data obtained after executing the user trigger operation;
[0010] Based on the verification result corresponding to the virtual response data, a corresponding prompt operation is performed.
[0011] In a second aspect, according to the content of the present disclosure, there is provided an automated testing device for a functional module, comprising:
[0012] An acquisition module, used for acquiring a test operation event of a target product function module, wherein the test operation event is used for describing a user-triggered operation corresponding to the target product function module, and the target product function module is an unpublished function module in the merchant service system;
[0013] A simulation module, used to simulate the user triggering operation corresponding to the target product function module, and obtain corresponding virtual response data, wherein the virtual response data is used to describe the simulation operation result obtained by the target product function module after the user triggering operation is executed;
[0014] A verification module, used to perform data verification on the virtual response data, wherein the data verification is used to verify the difference between the virtual response data and the estimated response data obtained after executing the user trigger operation;
[0015] The execution module is used to execute a corresponding prompt operation based on the verification result corresponding to the virtual response data.
[0016] In a third aspect, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps of the automated testing method for the functional module in any of the above embodiments are implemented.
[0017] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the automated testing method for the functional module in any of the above embodiments are implemented.
[0018] The automated testing method for the functional modules provided in the embodiment of the present application obtains the test operation event of the target product functional module, the test operation event is used to describe the user trigger operation corresponding to the target product functional module, and the target product functional module is an unpublished functional module in the merchant service system; simulates the user trigger operation corresponding to the target product functional module to obtain the corresponding virtual response data, the virtual response data is used to describe the simulated operation result obtained after the target product functional module runs the user trigger operation; performs data verification on the virtual response data, the data verification is used to verify the difference between the virtual response data and the estimated response data obtained after running the user trigger operation; based on the verification result corresponding to the virtual response data, executes the corresponding prompt operation. In this way, the user trigger operation corresponding to the target product functional module is intelligently simulated to test and simulate the user test operation, realize automated testing, and adopt automated testing methods instead of manual testing, effectively improving testing efficiency and reducing the risk of product leakage.
[0019] The above description is only an overview of the technical solution of the embodiment of the present application. In order to more clearly understand the technical means of the embodiment of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the embodiment of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly described below. It should be noted that the drawings described below only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure, wherein:
[0021] Figure 1 It is a flowchart of an automated testing method for a functional module provided by the present disclosure.
[0022] Figure 2 It is a structural schematic diagram of an automated testing device for a functional module provided by the present disclosure.
[0023] Figure 3 It is a structural schematic diagram of a computer device provided by the present disclosure.
[0024] It should be noted that the elements in the drawings are schematic and not drawn to scale. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative work also fall within the scope of protection of the present disclosure.
[0026] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by a person skilled in the art to which the subject matter of the present disclosure belongs. It will be further understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the specification and the relevant art, and will not be interpreted in an idealized or overly formal form unless otherwise explicitly defined herein. As used herein, a statement that two or more parts are "connected" or "coupled" together shall mean that the parts are joined together directly or through one or more intermediate components.
[0027] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase "embodiments" in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0028] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists, A and B exist at the same time, and B exists. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship. Terms such as "first" and "second" are only used to distinguish one component (or a part of a component) from another component (or another part of a component).
[0029] In the description of the present application, unless otherwise specified, "plurality" means more than two (including two), and similarly, "multiple groups" means more than two groups (including two).
[0030] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0031] Figure 1 is a flow chart of an automated testing method for a functional module provided by an embodiment of the present disclosure, such as Figure 1 As shown, the specific process of the automated testing method for the functional module includes:
[0032] S110: Acquire a test operation event of a target product function module, where the test operation event is used to describe a user-triggered operation corresponding to the target product function module.
[0033] The target product function module is an unreleased function module in the merchant service system. In practical applications, the target product function module may be a function module that has not been launched yet, or a function module that is in grayscale testing.
[0034] The test operation event of the target product function module may be determined based on the test requirement, or may also be determined based on the user selection, which is not specifically limited in this embodiment.
[0035] In some embodiments, the user-triggered operation corresponding to the target product function module includes at least one of the following: a product adding operation, a document creating operation, a document submitting operation, a document importing operation, a document saving operation, a document rejecting operation, and a document deleting operation.
[0036] The triggering forms for user-triggered operations may include multiple types. For example, the product adding operation may correspond to moving operations such as dragging and pulling, the document creation operation may correspond to click operations such as single-clicking, the document submission operation may correspond to click operations such as single-clicking, the document import operation may correspond to click and drag operations such as single-clicking, the document saving operation may correspond to click operations such as single-clicking, the document rejection operation may correspond to click operations such as single-clicking, and the document deletion operation may correspond to click operations such as single-clicking.
[0037] S120, simulating a user triggering operation corresponding to a target product function module to obtain corresponding virtual response data.
[0038] Among them, the virtual response data can be used to describe the simulated operation results obtained by the target product function module after running the user trigger operation.
[0039] In some embodiments, simulating a user-triggered operation corresponding to a target product function module includes:
[0040] Initialize a service operation instance; based on the service operation instance, determine the service storage address of the target product function module; locate the program operation data corresponding to the target product function module; based on the service storage address of the target product function module, simulate the program operation data corresponding to the target product function module to simulate the user-triggered operation corresponding to the target product function module.
[0041] The service operation instance is generated based on a preset programming language. The service storage address of the target product function module corresponds to a service website in the merchant service system.
[0042] In some embodiments, the program operation data corresponding to the target product function module includes at least one of the following: adding data, creating new data, submitting data, importing data, saving data, rejecting data, and deleting data.
[0043] Program operation data can be used to characterize a specific user operation behavior. For example, add data can be used to characterize the user behavior of clicking the add button; create data can be used to characterize the user behavior of clicking the create button; submit data can be used to characterize the user behavior of clicking the submit button; import data can be used to characterize the user behavior of clicking the import button / drag and drop; save data can be used to characterize the user behavior of clicking the save button; reject data can be used to characterize the user behavior of clicking the reject button; delete data can be used to characterize the user behavior of clicking the delete button.
[0044] Specifically, the Selenium framework can be used to simulate user operations by providing a series of APIs (Application Program Interface) through WebDriver.
[0045] Take the document creation operation triggered by the user as an example, that is, simulate the document creation process executed by the user. Install the corresponding browser driver for use, such as ChromeDriver, Firefox, etc.; import the selenium.webdriver module to initialize a Chrome browser instance; use the driver.get method to navigate to the corresponding merchant backend URL, use the element positioning method to locate an input box or click a button in the front-end code, call the corresponding method driver.find_element (corresponding element).click() to simulate the click operation, etc., to simulate the user's click or input operation.
[0046] Therefore, by adopting an intelligent program running mode and an automated method to simulate the user's manual testing behavior, the corresponding test results can be quickly obtained.
[0047] In addition, different user-triggered operations may correspond to different virtual response data.
[0048] For example, when the user-triggered operation is a product addition operation, the virtual response data is used to describe the simulated product price and simulated product quantity; when the user-triggered operation is a document creation operation, the virtual response data is used to describe the document creation content and the document creation quantity; when the user-triggered operation is a document submission operation, the virtual response data is used to describe the document submission feedback message; when the user-triggered operation is a document import operation, the virtual response data is used to describe the document import content and the document import quantity; when the user-triggered operation is a document save operation, the virtual response data is used to describe the document save content and the document save address; when the user-triggered operation is a document rejection operation, the virtual response data is used to describe the document rejection reason and the document rejection suggestion; when the user-triggered operation is a document deletion operation, the virtual response data is used to describe the document deletion content and the document deletion quantity.
[0049] S130: Perform data verification on the virtual response data.
[0050] The data verification may be used to verify the difference between the virtual response data and the estimated response data obtained after running the user trigger operation.
[0051] The estimated response data can be estimated based on the historical operation data of this user-triggered operation.
[0052] In some embodiments, when the user triggering operation corresponding to the target product function module is a commodity adding operation, the virtual response data is used to describe a simulated commodity price and a simulated commodity quantity, and the commodity adding operation is used to describe adding multiple different types of commodities.
[0053] Perform data verification on virtual response data, including:
[0054] Obtain the estimated price and estimated quantity of the product corresponding to the user triggering operation corresponding to the execution of the target product function module; compare the estimated price of the product with the simulated price of the product, and compare the estimated quantity of the product with the simulated quantity of the product; based on the comparison results of the estimated price of the product with the simulated price of the product, and the comparison results of the estimated quantity of the product with the simulated quantity of the product, determine the verification result corresponding to the virtual response data.
[0055] Among them, the comparison between the estimated price of the product and the simulated price of the product may correspond to a preset price error value, and the comparison result between the estimated price of the product and the simulated price of the product may be the price difference between the two. Correspondingly, the estimated quantity of the product and the simulated quantity of the product may correspond to a preset quantity error value, and the comparison result between the estimated quantity of the product and the simulated quantity of the product may be the quantity difference between the two.
[0056] Based on the comparison result of the estimated price of the commodity and the simulated price of the commodity, and the comparison result of the estimated quantity of the commodity and the simulated quantity of the commodity, determining the verification result corresponding to the virtual response data may include: if the price difference between the estimated price of the commodity and the simulated price of the commodity is greater than the preset price error value, and the quantity difference between the estimated quantity of the commodity and the simulated quantity of the commodity is greater than the preset quantity error value, then determining that the verification result corresponding to the virtual response data is verification failure; if the price difference between the estimated price of the commodity and the simulated price of the commodity is greater than the preset price error value, and the quantity difference between the estimated quantity of the commodity and the simulated quantity of the commodity is less than or equal to the preset quantity error value, then determining that the verification result corresponding to the virtual response data is verification failure; if the price difference between the estimated price of the commodity and the simulated price of the commodity is less than or equal to the preset price error value, and the quantity difference between the estimated quantity of the commodity and the simulated quantity of the commodity is greater than the preset quantity error value, then determining that the verification result corresponding to the virtual response data is verification failure; if the price difference between the estimated price of the commodity and the simulated price of the commodity is less than or equal to the preset price error value, and the quantity difference between the estimated quantity of the commodity and the simulated quantity of the commodity is less than or equal to the preset quantity error value, then determining that the verification result corresponding to the virtual response data is verification passed.
[0057] Therefore, by independently comparing different parameters in the virtual response data, the verification results corresponding to the virtual response data are measured, so as to ensure the verification accuracy of the virtual response data.
[0058] In some embodiments, obtaining the estimated price and estimated quantity of the product corresponding to the user triggering operation corresponding to the target product function module includes:
[0059] Obtain historical service data associated with the user-triggered operation corresponding to the target product function module; based on the interval between the service time of the historical service data and the current test time of the target product function module, estimate the estimated price and estimated quantity of the goods after executing the user-triggered operation corresponding to the target product function module.
[0060] Among them, historical service data includes: historical execution price and historical execution quantity.
[0061] The service time of the historical service data may be the time point when the historical service was generated, and the current test time of the target product function module may be the time point when the test of the target product function module started.
[0062] Based on the interval between the service time of historical service data and the current test time of the target product function module, the estimated price and estimated quantity of the goods corresponding to the user triggering operation corresponding to the target product function module are estimated, which may include: calculating the price change ratio of the product price based on time based on multiple historical execution prices, and calculating the quantity change ratio of the product quantity based on time based on multiple historical execution quantities; multiplying the price change ratio of the product price based on time with a corresponding historical execution price to determine the estimated price of the goods corresponding to the user triggering operation corresponding to the target product function module; multiplying the quantity change ratio of the product quantity based on time with a corresponding historical execution quantity to determine the estimated quantity of the goods corresponding to the user triggering operation corresponding to the target product function module.
[0063] Therefore, by using the service results of historical user behaviors corresponding to the user triggering operation to estimate the price and quantity of goods in the current test, the estimation accuracy is effectively improved.
[0064] In some embodiments, before performing data verification on the virtual response data, the method further includes:
[0065] Repeat the simulation of the user triggering operation corresponding to the target product function module multiple times to obtain multiple simulated response data; based on the multiple simulated response data, update the virtual response data.
[0066] When the virtual response data is updated based on a plurality of simulated response data, the plurality of simulated response data may be weighted to obtain new virtual response data.
[0067] The user trigger operation is the product adding operation, and the virtual response data is used to describe the product simulation price and product simulation quantity. The simulation is repeated for example. The original virtual response data is: product simulation price 1 and product simulation quantity 1. After repeated simulations of the user trigger operation corresponding to the target product function module, multiple simulated response data are obtained, namely: product simulation price 2 and product simulation quantity 2. The new virtual response data are: the average of product simulation price 1 and product simulation price 2, and the average of product simulation quantity 1 and product simulation quantity 2.
[0068] S140. Execute corresponding prompt operations based on the verification result corresponding to the virtual response data.
[0069] Among them, different prompt messages can be sent to the associated node devices corresponding to the target product function modules based on the verification results corresponding to different virtual response data.
[0070] In some embodiments, based on the verification result corresponding to the virtual response data, a corresponding prompt operation is performed, including:
[0071] If the verification result corresponding to the virtual response data is verification failure, a first prompt message is generated; if the verification result corresponding to the virtual response data is verification success, a second prompt message is generated.
[0072] The first prompt message may be used to instruct the associated node device corresponding to the target product function module to optimize the target product function module. The second prompt message may be used to instruct the associated node device corresponding to the target product function module to publish the target product function module.
[0073] The sending forms of the first prompt message and the second prompt message may include but are not limited to: email, pop-up window, system message, etc., so that the associated node device corresponding to the target product function module can receive the message prompt in time.
[0074] In this embodiment, the test operation event of the target product function module is obtained, and the test operation event is used to describe the user trigger operation corresponding to the target product function module, and the target product function module is an unpublished function module in the merchant service system; the user trigger operation corresponding to the target product function module is simulated to obtain the corresponding virtual response data, and the virtual response data is used to describe the simulated operation result obtained after the target product function module runs the user trigger operation; the virtual response data is verified, and the data verification is used to verify the difference between the virtual response data and the estimated response data obtained after running the user trigger operation; based on the verification result corresponding to the virtual response data, the corresponding prompt operation is executed. In this way, the user trigger operation corresponding to the target product function module is intelligently simulated to test and simulate the user test operation, realize automated testing, and use automated testing instead of manual testing, effectively improve testing efficiency, and reduce the risk of product leakage.
[0075] Figure 2 The present embodiment provides a schematic diagram of the structure of an automatic testing device for a functional module, wherein the automatic testing device for a functional module may include: an acquisition module 210 , a simulation module 220 , a verification module 230 and an execution module 240 .
[0076] The acquisition module 210 is used to acquire the test operation event of the target product function module, where the test operation event is used to describe the user trigger operation corresponding to the target product function module. The target product function module is an unpublished function module in the merchant service system.
[0077] The simulation module 220 is used to simulate the user triggering operation corresponding to the target product function module to obtain corresponding virtual response data, and the virtual response data is used to describe the simulation operation result obtained after the target product function module runs the user triggering operation.
[0078] The verification module 230 is used to perform data verification on the virtual response data. The data verification is used to verify the difference between the virtual response data and the estimated response data obtained after running the user trigger operation.
[0079] The execution module 240 is used to execute a corresponding prompt operation based on the verification result corresponding to the virtual response data.
[0080] In this embodiment, optionally, the simulation module 220 is specifically used for:
[0081] Initialize a service operation instance, where the service operation instance is generated based on a preset program language; based on the service operation instance, determine a service storage address of a target product function module, where the service storage address of the target product function module corresponds to a service URL in a merchant service system; locate program operation data corresponding to the target product function module; based on the service storage address of the target product function module, simulate the program operation data corresponding to the target product function module to simulate a user-triggered operation corresponding to the target product function module.
[0082] In this embodiment, optionally, the user-triggered operation corresponding to the target product function module includes at least one of the following: a product adding operation, a document creating operation, a document submitting operation, a document importing operation, a document saving operation, a document rejecting operation, and a document deleting operation; the program operation data corresponding to the target product function module includes at least one of the following: adding data, creating data, submitting data, importing data, saving data, rejecting data, and deleting data.
[0083] In this embodiment, optionally, when the user triggering operation corresponding to the target product function module is a commodity adding operation, the virtual response data is used to describe the commodity simulation price and commodity simulation quantity, and the commodity adding operation is used to describe adding multiple different types of commodities.
[0084] The verification module 230 is specifically used for:
[0085] Obtain the estimated price and estimated quantity of the product corresponding to the user triggering operation corresponding to the execution of the target product function module; compare the estimated price of the product with the simulated price of the product, and compare the estimated quantity of the product with the simulated quantity of the product; based on the comparison results of the estimated price of the product with the simulated price of the product, and the comparison results of the estimated quantity of the product with the simulated quantity of the product, determine the verification result corresponding to the virtual response data.
[0086] In this embodiment, optionally, the verification module 230 is specifically used to:
[0087] Obtain historical service data associated with the user-triggered operation corresponding to the target product function module, the historical service data including: historical execution price and historical execution quantity; based on the interval between the service time of the historical service data and the current test time of the target product function module, estimate the estimated price and estimated quantity of the goods after the user-triggered operation corresponding to the target product function module is executed.
[0088] In this embodiment, optionally, the execution module 240 is specifically configured to:
[0089] If the verification result corresponding to the virtual response data is a verification failure, a first prompt message is generated, and the first prompt message is used to instruct the associated node device corresponding to the target product function module to optimize the target product function module; if the verification result corresponding to the virtual response data is a verification success, a second prompt message is generated, and the second prompt message is used to instruct the associated node device corresponding to the target product function module to publish the target product function module.
[0090] In this embodiment, optionally, it also includes: a processing module.
[0091] The processing module is used to repeatedly simulate the user triggering operation corresponding to the target product function module to obtain multiple simulated response data; based on the multiple simulated response data, the virtual response data is updated.
[0092] The automated testing device for the functional modules provided in the present disclosure can execute the above method embodiments. The specific implementation principles and technical effects thereof can be found in the above method embodiments, and the present disclosure will not elaborate on them here.
[0093] The present application also provides a computer device. Figure 3 , Figure 3 This is a basic structural block diagram of the computer device in this embodiment.
[0094] The computer device includes a memory 310 and a processor 320 that are connected to each other through a system bus. It should be noted that the figure only shows a computer device with a memory 310 and a processor 320, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0095] Computer devices can be computing devices such as desktop computers, notebooks, PDAs, and cloud servers. Computer devices can interact with users through keyboards, mice, remote controls, touch pads, or voice control devices.
[0096] The memory 310 includes at least one type of readable storage medium, and the readable storage medium includes a non-volatile memory or a volatile memory, for example, a flash memory, a hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, etc., and the RAM may include a static RAM or a dynamic RAM. In some embodiments, the memory 310 may be an internal storage unit of a computer device, for example, a hard disk or a memory of the computer device. In other embodiments, the memory 310 may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, or a flash card (FlashCard) equipped on the computer device. Of course, the memory 310 may also include both the internal storage unit of the computer device and its external storage device. In this embodiment, the memory 310 is generally used to store the operating system and various application software installed on the computer device, such as the program code of the above method. In addition, the memory 310 may also be used to temporarily store various data that have been output or are to be output.
[0097] The processor 320 is generally used to perform the overall operation of the computer device. In this embodiment, the memory 310 is used to store program codes or instructions, the program code includes computer operation instructions, and the processor 320 is used to execute the program codes or instructions stored in the memory 310 or process data, such as running the program code of the above method.
[0098] In this article, the bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus system can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0099] Another embodiment of the present application also provides a computer-readable medium, which may be a computer-readable signal medium or a computer-readable medium. A processor in a computer reads a computer-readable program code stored in the computer-readable medium, so that the processor can execute the functional actions specified in each step or a combination of steps in the above method; and generate a device for implementing the functional actions specified in each block or a combination of blocks in the block diagram.
[0100] Computer-readable media include but are not limited to electronic, magnetic, optical, electromagnetic, infrared memory or semiconductor systems, devices or apparatuses, or any appropriate combination of the foregoing, the memory is used to store program codes or instructions, the program codes include computer operating instructions, and the processor is used to execute the program codes or instructions of the above methods stored in the memory.
[0101] For the definitions of memory and processor, please refer to the description of the aforementioned computer device embodiment and will not be repeated here.
[0102] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of modules or units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0103] Each functional unit or module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0104] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) or a processor (processor) to perform all or part of the steps of each embodiment method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.
[0105] In the claims, any reference symbols placed between brackets shall not be construed as limiting the claims. The word "comprising" described in the present application does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The present application can be implemented with the aid of hardware comprising several different elements and with the aid of a suitably programmed computer. In a unit claim that lists a number of devices, several units of these devices may be embodied by the same hardware item. The use of first, second, and third, etc. does not indicate any order, and these words may be interpreted as names. The steps in the above embodiments, unless otherwise specified, should not be understood as limitations on the order of execution.
[0106] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An automated testing method for a functional module, characterized in that: include: Acquire a test operation event of a target product function module, wherein the test operation event is used to describe a user-triggered operation corresponding to the target product function module, and the target product function module is an unpublished function module in the merchant service system; Simulating a user triggering operation corresponding to the target product function module to obtain corresponding virtual response data, wherein the virtual response data is used to describe a simulated operation result obtained by the target product function module after executing the user triggering operation; Performing data verification on the virtual response data, wherein the data verification is used to verify the difference between the virtual response data and the estimated response data obtained after executing the user trigger operation; Based on the verification result corresponding to the virtual response data, a corresponding prompt operation is performed.
2. The method according to claim 1, characterized in that The simulating the user triggering operation corresponding to the target product function module includes: Initializing a service operation instance, wherein the service operation instance is generated based on a preset program language; Based on the service operation instance, determining a service storage address of the target product function module, wherein the service storage address of the target product function module corresponds to a service website in the merchant service system; Locating program operation data corresponding to the target product function module; Based on the service storage address of the target product function module, the program operation data corresponding to the target product function module is simulated to simulate the user triggering operation corresponding to the target product function module.
3. The method according to claim 2, characterized in that The user triggering operation corresponding to the target product function module includes at least one of the following: Operations of adding products, creating new documents, submitting documents, importing documents, saving documents, rejecting documents, and deleting documents; The program operation data corresponding to the target product function module includes at least one of the following: Add data, create new data, submit data, import data, save data, reject data, and delete data.
4. The method according to claim 3, characterized in that When the user triggering operation corresponding to the target product function module is the commodity adding operation, the virtual response data is used to describe the commodity simulation price and commodity simulation quantity, and the commodity adding operation is used to describe adding multiple commodities of different types; The performing data verification on the virtual response data includes: Obtaining the estimated price and estimated quantity of the product corresponding to the user triggering operation corresponding to the target product function module; Comparing the estimated price of the commodity with the simulated price of the commodity, and comparing the estimated quantity of the commodity with the simulated quantity of the commodity; Based on the comparison result of the estimated commodity price and the simulated commodity price, and the comparison result of the estimated commodity quantity and the simulated commodity quantity, the verification result corresponding to the virtual response data is determined.
5. The method according to claim 4, characterized in that The obtaining of the estimated price and the estimated quantity of the product corresponding to the user triggering operation corresponding to the target product function module includes: Acquire historical service data associated with the user-triggered operation corresponding to the target product function module, wherein the historical service data includes: historical execution price and historical execution quantity; Based on the interval between the service time of the historical service data and the current test time of the target product function module, the estimated price and estimated quantity of the commodity corresponding to the user triggering operation corresponding to the target product function module are estimated.
6. The method according to claim 1, characterized in that The performing corresponding prompting operation based on the verification result corresponding to the virtual response data includes: If the verification result corresponding to the virtual response data is verification failure, a first prompt message is generated, wherein the first prompt message is used to instruct the associated node device corresponding to the target product function module to optimize the target product function module; If the verification result corresponding to the virtual response data is verification passed, a second prompt message is generated, and the second prompt message is used to instruct the associated node device corresponding to the target product function module to publish the target product function module.
7. The method according to claim 1, characterized in that Before performing data verification on the virtual response data, the method further includes: Repeating multiple simulations of user triggering operations corresponding to the target product function module to obtain multiple simulation response data; The virtual response data is updated based on the plurality of simulation response data.
8. An automated testing device for a functional module, characterized in that: include: An acquisition module, used for acquiring a test operation event of a target product function module, wherein the test operation event is used for describing a user-triggered operation corresponding to the target product function module, and the target product function module is an unpublished function module in the merchant service system; A simulation module, used to simulate the user triggering operation corresponding to the target product function module, and obtain corresponding virtual response data, wherein the virtual response data is used to describe the simulation operation result obtained by the target product function module after the user triggering operation is executed; A verification module, used to perform data verification on the virtual response data, wherein the data verification is used to verify the difference between the virtual response data and the estimated response data obtained after executing the user trigger operation; The execution module is used to execute a corresponding prompt operation based on the verification result corresponding to the virtual response data.
9. A computer device, characterized in that: The invention comprises a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, an automatic testing method for a functional module as claimed in any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the automated testing method for the functional module as claimed in any one of claims 1 to 7 is implemented.
