A test data generation method, device, equipment and storage medium

By responding to interface definition instructions to generate agent implementation classes and generate simulated test data, it solves the problem of low front-end development efficiency, realizes automated test data generation after interface definition, and improves overall development efficiency.

CN113485927BActive Publication Date: 2024-09-20XIAN JINGXUNDI SUPPLY CHAIN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110762305.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-06
Publication Date
2024-09-20
Estimated Expiration
2041-07-06

AI Technical Summary

Technical Problem

In the existing technology, it is difficult for front-end developers to develop test data by themselves based on interface definition documents, resulting in low efficiency, and the back-end development cycle is long, which increases the waste of overall development resources.

Method used

By responding to the interface definition instructions, the interface definition parameters are obtained, the agent implementation class is generated, and simulated test data is generated based on the class and stored to achieve automated test data generation, reducing the development burden of front-end developers and improving the efficiency of test data generation.

Benefits of technology

It enables the front-end to directly use existing interfaces for development, and back-end interface changes are reflected to the front-end in real time, which significantly improves the efficiency of test data generation and reduces the development cycle.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113485927B
    Figure CN113485927B
Patent Text Reader

Abstract

The embodiment of the present invention discloses a test data generation method, device, equipment and storage medium, the method comprising: in response to a detected interface definition instruction, obtaining interface definition parameters corresponding to the interface definition instruction; generating a proxy implementation class according to the interface definition parameters; generating simulation test data according to the proxy implementation class, and storing the simulation test data. After the back-end developer defines the interface, the method provided by the embodiment of the present invention directly publishes the test interface on the platform, the system automatically generates test data, the front end directly uses the existing interface for one-step development, and the back-end interface changes are reflected in real time to the front end for timely modification, thereby improving the efficiency of test data generation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a test data generation method, apparatus, device and storage medium. Background Art

[0002] The current test data generation requires that after receiving new requirements, the backend developers start writing interface definition documents and then hand them over to the frontend. The frontend then performs frontend development based on the documents and waits for the backend interface development to be completed and released to the test environment before entering the joint debugging phase.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following technical problems in the prior art: it is difficult to develop the front end according to the interface definition document, and it cannot be developed in one step according to the existing interface data or it needs to mock the data by itself, which is inefficient. The back end has a long development cycle because it involves business. At this time, the front end waits for joint debugging, which increases the demand development cycle. Development resources are wasted. Summary of the invention

[0004] The embodiments of the present invention provide a test data generation method, apparatus, device and storage medium to improve the test data generation efficiency.

[0005] In a first aspect, an embodiment of the present invention provides a test data generating method, comprising:

[0006] In response to the detected interface definition instruction, acquiring an interface definition parameter corresponding to the interface definition instruction;

[0007] Generate a proxy implementation class according to the interface definition parameters;

[0008] Generate simulation test data according to the proxy implementation class, and store the simulation test data. Optionally, based on the above scheme, the interface definition parameters include at least one of interface package path, interface request method, interface uniform resource identifier address, interface field definition, interface field request, interface response structure and error code definition.

[0009] Optionally, based on the above solution, in response to the detected interface definition instruction, obtaining the interface definition parameter corresponding to the interface definition instruction includes:

[0010] In response to the detected interface definition instruction, obtaining the interface type corresponding to the interface definition instruction, generating and displaying an interface definition parameter configuration interface based on the interface type;

[0011] In response to the detected parameter configuration instruction, an interface definition parameter corresponding to the parameter configuration instruction is acquired.

[0012] Optionally, based on the above solution, it also includes:

[0013] When the interface type is a remote procedure call protocol type, the service is registered to a remote procedure call protocol registration center according to a set application program interface.

[0014] Optionally, based on the above solution, the interface type is a remote procedure call protocol type, and the generating and displaying of an interface definition parameter configuration interface based on the interface type includes:

[0015] Generate and display the interface definition parameter configuration interface based on the registration center address, interface package full path, interface field definition, interface field request, interface response structure and error code definition.

[0016] Optionally, based on the above solution, the interface type is a hypertext transfer protocol type, a hypertext transfer protocol secure type or a WebSocket protocol type, and the generating and displaying of an interface definition parameter configuration interface based on the interface type includes:

[0017] Generate and display the interface definition parameter configuration interface based on the uniform resource identifier, interface field definition, interface field request, interface response structure and error code definition.

[0018] Optionally, based on the above solution, it also includes:

[0019] Based on the detected interface form management instructions, a pre-set interface description template is managed, wherein the interface description template includes at least one of request and response parameter field definitions, enumeration definitions and response code definitions, interface access methods, and interface authentication methods.

[0020] In a second aspect, an embodiment of the present invention further provides a test data generating device, comprising:

[0021] An interface definition module, configured to obtain, in response to a detected interface definition instruction, an interface definition parameter corresponding to the interface definition instruction;

[0022] An interface proxy module, used to generate a proxy implementation class according to the interface definition parameters;

[0023] The data processing module is used to generate simulation test data according to the proxy implementation class and store the simulation test data.

[0024] In a third aspect, an embodiment of the present invention further provides a computer device, the device comprising:

[0025] one or more processors;

[0026] A storage device for storing one or more programs;

[0027] When one or more programs are executed by one or more processors, the one or more processors implement the test data generating method provided by any embodiment of the present invention.

[0028] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a test data generating method as provided in any embodiment of the present invention.

[0029] The test data generation method provided by the embodiment of the present invention obtains the interface definition parameters corresponding to the interface definition instruction in response to the detected interface definition instruction; generates a proxy implementation class according to the interface definition parameters; generates simulation test data according to the proxy implementation class, and stores the simulation test data. After the interface is defined by the back-end developer, the test interface is directly released to the platform, and the system automatically generates test data. The front-end directly uses the existing interface for one-step development. The back-end interface changes are reflected in real time to the front-end for timely modification, thereby improving the efficiency of test data generation. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a flowchart of a test data generating method provided in the first embodiment of the present invention;

[0031] Figure 2 is a structural diagram of a test data generating system provided by Embodiment 2 of the present invention;

[0032] Figure 3a It is a structural diagram of a device for automatically generating a test interface service provided by Embodiment 3 of the present invention;

[0033] Figure 3b It is a flowchart of an interface definition configuration provided by Embodiment 3 of the present invention;

[0034] Figure 3c This is a schematic diagram of a process of interface publishing provided by Embodiment 3 of the present invention;

[0035] Figure 3d This is a schematic diagram of a management structure provided by Embodiment 3 of the present invention;

[0036] Figure 4 It is a structural diagram of a computer device provided in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0037] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0038] Embodiment 1

[0039] Figure 1 1 is a flow chart of a test data generation method provided in the first embodiment of the present invention. This embodiment is applicable to the case of automatically generating test data. The method can be executed by a test data generation device, and the test data generation device can be implemented in software and / or hardware. For example, the test data generation device can be configured in a computer device. Figure 1 As shown, the method includes:

[0040] S110. In response to the detected interface definition instruction, obtain interface definition parameters corresponding to the interface definition instruction.

[0041] In this embodiment, in order to improve the efficiency of test data generation, the back-end developer can define the interface definition parameters and generate simulation test data based on the defined interface definition parameters. The interface definition parameters can be set according to actual needs or according to the interface's own properties, such as according to the interface type, etc., and are not limited here.

[0042] Optionally, the interface definition parameters include at least one of an interface packet path, an interface request mode, an interface uniform resource identifier address, an interface field definition, an interface field request, an interface response structure, and an error code definition. Specific interface definition parameters can be determined according to the interface type.

[0043] In one embodiment of the present invention, the step of obtaining the interface definition parameters corresponding to the interface definition instruction in response to the detected interface definition instruction includes: obtaining the interface type corresponding to the interface definition instruction in response to the detected interface definition instruction, generating and displaying an interface definition parameter configuration interface based on the interface type; and obtaining the interface definition parameters corresponding to the parameter configuration instruction in response to the detected parameter configuration instruction. Exemplarily, after detecting the interface definition instruction initiated by the developer, the interface definition instruction is analyzed to obtain the interface type contained in the interface definition instruction, the interface definition parameters that need to be configured are determined based on the interface type, and an interface definition parameter configuration interface is generated based on the interface definition parameters that need to be configured for display. After the developer configures the interface definition parameters in the interface definition parameter configuration interface and completes the configuration, the parameter configuration instruction is triggered, and the test data generation system obtains the interface definition parameters corresponding to the parameter configuration instruction as the interface definition parameters corresponding to the interface definition instruction.

[0044] In this embodiment, the interface type can be a remote procedure call protocol type, a hypertext transfer protocol type, a hypertext transfer secure protocol type, or a WebSocket protocol type. According to the different characteristics of different interface types, different interface definition parameter configuration interfaces need to be generated to enable developers to configure different interface definition parameters.

[0045] In one embodiment, the interface type is a remote procedure call protocol type, and the interface definition parameter configuration interface is generated and displayed based on the interface type, including: generating and displaying the interface definition parameter configuration interface based on the registration center address, the full path of the interface package, the interface field definition, the interface field request, the interface response structure, and the error code definition. Optionally, the developer selects the interface type. If it is an RPC service, the registration center address and the full path of the interface package need to be filled in, and then the interface request and response field definitions are performed, including the field name, length, type, and the enumeration type needs to define List <Map<?,?> >Data format. In case of exception, the exception enumeration code needs to be automatically defined. Finally, select the data definition type and data storage type. After clicking Submit, the system automatically generates an interface class to save a specific directory according to the rules, and automatically generates a Uniform Resource Locator (URL) connection for manual data generation.

[0046] In one embodiment, the interface type is a hypertext transfer protocol type, a hypertext transfer secure protocol type, or a WebSocket protocol type, and the generation and display of an interface definition parameter configuration interface based on the interface type includes: generating and displaying an interface definition parameter configuration interface based on a uniform resource identifier, an interface field definition, an interface field request, an interface response structure, and an error code definition. Optionally, the developer selects the interface type. If it is a hypertext transfer protocol type (HTTP) / hypertext transfer secure protocol type (HTTPS) / WebSocket service, only the ULI needs to be specified, and then the interface request and response field definitions are performed, including the field name, length, type, and the enumeration type needs to define List <Map<?,?> >Data format. In case of exception, the exception enumeration code needs to be automatically defined. Finally, select the data definition type and data storage type. After clicking Submit, the system automatically generates an interface class to save a specific directory according to the rules, and automatically generates a manual data generation URL connection.

[0047] S120: Generate a proxy implementation class according to the interface definition parameters.

[0048] In this embodiment, after the developer defines the interface definition parameters, the test data generating device can automatically generate a proxy implementation class in a specific directory.

[0049] On the basis of the above, it also includes: when the interface type is a remote call protocol type, registering the service to the remote procedure call protocol registration center according to the set application interface. In other words, if it is a remote procedure call protocol (RPC) service, the service needs to be registered to the RPC registration center according to a specific application programming interface (API).

[0050] S130. Generate simulation test data according to the proxy implementation class, and store the simulation test data.

[0051] Optionally, the method of generating simulation test data according to the proxy implementation class can refer to the method of generating data according to the class in the prior art, which is not limited here.

[0052] In general, back-end developers can define interface definition parameters through the interface definition module. After the test data generation system receives the interface definition parameters defined by the back-end developer, it generates a proxy implementation class according to the interface definition parameters through the interface proxy module. The data definition module randomly generates simulated test data as test data based on the proxy implementation class, and stores the simulated test data through the data storage module.

[0053] In this embodiment, the storage of simulation test data can support multiple data types of simulation test data, such as ES and RDBMS. Developers can select the storage type according to actual needs when editing the interface. The data definition module can include manual definition and automatic definition. The simulation test data is automatically generated by FAKE randomly according to the interface definition class for storage device storage. The database is manually generated, and the system automatically generates a connection, which can perform addition, deletion, modification, and batch import functions.

[0054] The embodiment of the present invention obtains interface definition parameters corresponding to the interface definition instruction in response to the detected interface definition instruction; generates a proxy implementation class according to the interface definition parameters; generates simulation test data according to the proxy implementation class, and stores the simulation test data. After the interface is defined by the back-end developer, the test interface is directly released to the platform, and the system automatically generates test data. The front-end directly uses the existing interface for one-step development. The back-end interface changes are reflected in real time to the front-end for timely modification, thereby improving the efficiency of test data generation.

[0055] On the basis of the above scheme, it also includes: based on the detected interface form management instruction, managing the pre-set interface description template, wherein the interface description template includes at least one of request and response parameter field definition, enumeration definition and response code definition, interface access method, and interface authentication method. Specifically, the interface form management is mainly the interface description template created and submitted by the developer, including request and response parameter field definition, enumeration definition and response code definition, interface access method, interface authentication method, etc.

[0056] Embodiment 2

[0057] Figure 2 1 is a schematic diagram of the structure of a test data generating device provided in the second embodiment of the present invention. The test data generating device can be implemented in software and / or hardware, for example, the test data generating device can be configured in a computer device. In this embodiment, the explanation of the terms that are the same or corresponding to the above embodiments will not be repeated here. Figure 2 As shown, the device includes an interface definition module 210, an interface proxy module 220 and a data processing module 230, wherein:

[0058] The interface definition module 210 is used to obtain interface definition parameters corresponding to the interface definition instruction in response to the detected interface definition instruction;

[0059] The interface proxy module 220 is used to generate a proxy implementation class according to the interface definition parameters;

[0060] The data processing module 230 is used to generate simulation test data according to the proxy implementation class and store the simulation test data.

[0061] In the embodiment of the present invention, the interface definition module responds to the detected interface definition instruction, and the interface proxy module obtains the interface definition parameters corresponding to the interface definition instruction; generates a proxy implementation class according to the interface definition parameters; the data processing module generates simulation test data according to the proxy implementation class, and stores the simulation test data. After the interface is defined by the back-end developer, the test interface is directly released on the platform, and the system automatically generates test data. The front-end directly uses the existing interface for one-step development. The back-end interface changes are reflected in real time to the front-end for timely modification, thereby improving the efficiency of test data generation.

[0062] Optionally, based on the above scheme, the interface definition parameters include at least one of interface packet path, interface request method, interface uniform resource identifier address, interface field definition, interface field request, interface response structure and error code definition.

[0063] Optionally, based on the above solution, the interface definition module 210 is specifically used for:

[0064] In response to the detected interface definition instruction, obtaining the interface type corresponding to the interface definition instruction, generating and displaying an interface definition parameter configuration interface based on the interface type;

[0065] In response to the detected parameter configuration instruction, an interface definition parameter corresponding to the parameter configuration instruction is acquired.

[0066] Optionally, based on the above solution, the interface proxy module 230 is further used to:

[0067] When the interface type is a remote procedure call protocol type, the service is registered to a remote procedure call protocol registration center according to a set application program interface.

[0068] Optionally, based on the above solution, the interface definition module 210 is specifically used for:

[0069] Generate and display the interface definition parameter configuration interface based on the registration center address, interface package full path, interface field definition, interface field request, interface response structure and error code definition.

[0070] Optionally, based on the above solution, the interface type is a hypertext transfer protocol type, a hypertext transfer protocol secure type or a WebSocket protocol type, and the interface definition module 210 is specifically used for:

[0071] Generate and display the interface definition parameter configuration interface based on the uniform resource identifier, interface field definition, interface field request, interface response structure and error code definition.

[0072] Optionally, based on the above solution, the device further includes an interface form management module, which is used to:

[0073] The interface form management module manages the pre-set interface description template based on the detected interface form management instructions, wherein the interface description template includes at least one of request and response parameter field definitions, enumeration definitions and response code definitions, interface access methods, and interface authentication methods.

[0074] Embodiment 3

[0075] This embodiment provides a preferred embodiment based on the above solution. The embodiment of the present invention provides a device for automatically generating a test interface service to realize automatic generation and maintenance of test data.

[0076] Figure 3a It is a structural diagram of a device for automatically generating a test interface service provided by Embodiment 3 of the present invention. Figure 3a The description of each module is as follows:

[0077] The data storage module (i.e., ES and RDBMS in the figure) temporarily supports two types, ES and RDBMS. The developer's interface data, including automatically generated and manually generated data, is saved in this storage device. The developer selects the storage type when editing the interface.

[0078] Netty service and RPC registry. The RPC registry is an existing registry, such as JD JSF, Taobao DUBBO, etc. If the developer interface definition does not have an RPC interface, you need to select the service registry address. HTTP, HTTPS and WEBSOCKET services are built on the Netty service. The front desk can freely configure, view and restart the service.

[0079] The interface definition module is the core module, including the interface package path. If it is a non-RPC service, it is necessary to define the interface request method, interface URL address, interface field definition, request and response structure, and error code definition.

[0080] After the interface dynamic proxy module is defined by the developer, the module automatically generates a proxy implementation class in a specific directory. If it is an RPC service, the service needs to be registered to the RPC registration center according to the specific API.

[0081] The API gateway service and authentication service mainly provide unified interface connection and interface authentication services, which are consistent with the production authentication method and can be subsequently migrated and released to production.

[0082] The data customization module is manual and automatic. It uses FAKE to randomly generate simulated test data according to the interface definition class for storage device storage. The database is manually generated, and the system automatically generates connections, which can perform addition, deletion, modification, query and batch import functions.

[0083] The device for automatically generating test interface services mainly includes three functions: interface definition configuration, interface publishing and management.

[0084] 1. Interface definition configuration:

[0085] Figure 3b FIG. 1 is a flow chart of an interface definition configuration provided by Embodiment 3 of the present invention. Figure 3b As shown, the interface definition configuration includes:

[0086] 1) The developer selects the interface type. If it is an RPC service, the registration center address and the full path of the interface package need to be filled in. If it is an HTTP / HTTPS / WEBSOCKET service, only the URI needs to be specified.

[0087] 2) Define the interface request and response fields, including field name, length, type, and enumeration type. List <Map<?,?> >Data format. In abnormal situations, the abnormal enumeration code needs to be automatically defined.

[0088] 3) Select the data definition type and data storage type. After clicking Submit, the system automatically generates an interface class to save the specific directory according to the rules, and automatically generates a manual data generation URL connection.

[0089] 2. Interface Release

[0090] Figure 3c This is a schematic diagram of a process of interface publishing provided by Embodiment 3 of the present invention. Figure 3c As shown in the figure, interface publishing includes:

[0091] The developer clicks publish on the above interface definition template. At this time, it is necessary to determine the type of data to be generated. If it is automatically generated, set the number of automatically generated data, and then fake random data for ES and RDBMS storage. If it is manually added, it will automatically jump to Figure 1 Manual data maintenance including batch import of URL addresses generated in.

[0092] Fill in the service port and verify whether it is enabled. The corresponding proxy implementation class is automatically generated according to the previously configured interface type, and this class is placed in a specific service directory for subsequent directory monitoring service processing.

[0093] Use NIO's WatchService to monitor a specific directory. If there is a file change, further processing is performed to change and reload the interface and proxy implementation class according to the event type. Event types include interface offline (deletion), interface generation, and interface change.

[0094] Then get the Netty service corresponding to the directory of this event and restart it to take effect. If it is an RPC service, it needs to automatically re-register with the service center. And the RPC interface automatically uploads to the MAVEN warehouse center.

[0095] 3. Management

[0096] Figure 3d This is a schematic diagram of a management structure provided by Embodiment 3 of the present invention. Figure 3d As shown, management includes:

[0097] Netty service management, because various services on the platform are enabled, it is necessary to manage the ports and services corresponding to Netty, which can be restarted, started, and run log queries. If the ports are not enough, some unused services can be removed first.

[0098] Interface form management mainly involves developers creating and submitting interface description templates, including request and response parameter field definitions, enumeration definitions, response code definitions, and interface access methods, authentication methods, etc.

[0099] Manual data maintenance management is the URL address generated by the developer after selecting the manual data generation mode. Click it to add, delete, modify, query and batch import data.

[0100] Data set management is the data display of storage devices, which is used to maintain, manage and view the data.

[0101] The monitoring directory management displays all current directories of the system. The directory contains the config.properties configuration file and automatically generated code. The code can be exported, and the developer's business interface can be imported, and then the Netty service can be restarted for testing.

[0102] Verify the release. After the interface is released, you can use clients such as POSTMAN to debug the interface connectivity and access.

[0103] In the embodiment of the present invention, after the end developer defines the interface, the platform directly publishes the test interface, the system automatically generates test data, the front end directly uses the existing interface for one-step development, and the back end interface changes are reflected in real time to the front end for timely modification, thereby improving the efficiency of test data generation.

[0104] Embodiment 4

[0105] Figure 4 It is a structural diagram of a computer device provided in Embodiment 4 of the present invention. Figure 4 It is a structural diagram of a computer device provided in Embodiment 4 of the present invention. Figure 4 A block diagram of an exemplary computer device 412 suitable for use in implementing embodiments of the present invention is shown. Figure 4 The computer device 412 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0106] like Figure 4 As shown, the computer device 412 is in the form of a general-purpose computing device. The components of the computer device 412 may include, but are not limited to: one or more processors 414, a system memory 428, and a bus 418 that connects different system components (including the system memory 428 and the processor 414).

[0107] Bus 418 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a local bus to processor 414, or a bus structure using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0108] The computer device 412 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 412, including volatile and non-volatile media, removable and non-removable media.

[0109] System memory 428 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 430 and / or cache memory 432. Computer device 412 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage device 434 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 418 via one or more data medium interfaces. The memory 428 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0110] A program / utility 440 having a set (at least one) of program modules 442 may be stored, for example, in memory 428, such program modules 442 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 442 generally perform the functions and / or methods of the embodiments described herein.

[0111] The computer device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, display 424, etc.), may also communicate with one or more devices that enable a user to interact with the computer device 412, and / or communicate with any device that enables the computer device 412 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via input / output (I / O) interface 422. Furthermore, the computer device 412 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) via network adapter 420. As shown, the network adapter 420 communicates with other modules of the computer device 412 via bus 418. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 412, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0112] The processor 414 executes various functional applications and data processing by running the program stored in the system memory 428, for example, implementing the test data generation method provided in the embodiment of the present invention, which includes:

[0113] In response to the detected interface definition instruction, acquiring an interface definition parameter corresponding to the interface definition instruction;

[0114] Generate a proxy implementation class according to the interface definition parameters;

[0115] Generate simulation test data according to the proxy implementation class, and store the simulation test data.

[0116] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the test system construction method provided by any embodiment of the present invention.

[0117] Embodiment 5

[0118] Embodiment 5 of the present invention further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the test data generating method provided in the embodiment of the present invention is implemented. The method includes:

[0119] In response to the detected interface definition instruction, acquiring an interface definition parameter corresponding to the interface definition instruction;

[0120] Generate a proxy implementation class according to the interface definition parameters;

[0121] Generate simulation test data according to the proxy implementation class, and store the simulation test data.

[0122] Of course, the computer program stored in a computer-readable storage medium provided by an embodiment of the present invention is not limited to the above method operations, but can also execute related operations of the test system construction method provided by any embodiment of the present invention.

[0123] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0124] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0125] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0126] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0127] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A test data generation method, characterized in that: include: In response to the detected interface definition instruction, obtaining interface definition parameters corresponding to the interface definition instruction; wherein the interface definition parameters are determined according to the interface type; Generate a proxy implementation class according to the interface definition parameters; Generate simulation test data according to the proxy implementation class, and store the simulation test data; The step of obtaining, in response to the detected interface definition instruction, an interface definition parameter corresponding to the interface definition instruction comprises: In response to the detected interface definition instruction, obtaining the interface type corresponding to the interface definition instruction, generating and displaying an interface definition parameter configuration interface based on the interface type; In response to the detected parameter configuration instruction, an interface definition parameter corresponding to the parameter configuration instruction is acquired.

2. The method according to claim 1, characterized in that The interface definition parameters include at least one of an interface packet path, an interface request mode, an interface uniform resource identifier address, an interface field definition, an interface field request, an interface response structure, and an error code definition.

3. The method according to claim 1, characterized in that Also includes: When the interface type is a remote procedure call protocol type, the service is registered to a remote procedure call protocol registration center according to a set application program interface.

4. The method according to claim 1, characterized in that The interface type is a remote procedure call protocol type, and the generating and displaying of an interface definition parameter configuration interface based on the interface type includes: Generate and display the interface definition parameter configuration interface based on the registration center address, interface package full path, interface field definition, interface field request, interface response structure and error code definition.

5. The method according to claim 1, characterized in that The interface type is a hypertext transfer protocol type, a hypertext transfer secure protocol type or a WebSocket protocol type, and the generating and displaying of an interface definition parameter configuration interface based on the interface type includes: Generate and display the interface definition parameter configuration interface based on the uniform resource identifier, interface field definition, interface field request, interface response structure and error code definition.

6. The method according to claim 1, characterized in that Also includes: Based on the detected interface form management instructions, a pre-set interface description template is managed, wherein the interface description template includes at least one of request and response parameter field definitions, enumeration definitions and response code definitions, interface access methods, and interface authentication methods.

7. A test data generating device, characterized in that: include: An interface definition module, configured to obtain, in response to a detected interface definition instruction, interface definition parameters corresponding to the interface definition instruction; wherein the interface definition parameters are determined according to an interface type; An interface proxy module, used to generate a proxy implementation class according to the interface definition parameters; A data processing module, used to generate simulation test data according to the proxy implementation class and store the simulation test data; The interface definition module is specifically used for: In response to the detected interface definition instruction, obtaining the interface type corresponding to the interface definition instruction, generating and displaying an interface definition parameter configuration interface based on the interface type; In response to the detected parameter configuration instruction, an interface definition parameter corresponding to the parameter configuration instruction is acquired.

8. A computer device, characterized in that: The device comprises: one or more processors; A storage device for storing one or more programs; When one or more programs are executed by one or more processors, the one or more processors implement the test data generating method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the test data generating method according to any one of claims 1 to 6 is implemented.