CN113485927A - Test data generation method, device, equipment and storage medium - Google Patents

Test data generation method, device, equipment and storage medium Download PDF

Info

Publication number
CN113485927A
CN113485927A CN202110762305.6A CN202110762305A CN113485927A CN 113485927 A CN113485927 A CN 113485927A CN 202110762305 A CN202110762305 A CN 202110762305A CN 113485927 A CN113485927 A CN 113485927A
Authority
CN
China
Prior art keywords
interface
definition
test data
generating
instruction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110762305.6A
Other languages
Chinese (zh)
Inventor
王北永
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xi'an Jingxundi Supply Chain Technology Co ltd
Original Assignee
Xi'an Jingxundi Supply Chain Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Xi'an Jingxundi Supply Chain Technology Co ltd filed Critical Xi'an Jingxundi Supply Chain Technology Co ltd
Priority to CN202110762305.6A priority Critical patent/CN113485927A/en
Publication of CN113485927A publication Critical patent/CN113485927A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/73Program documentation

Abstract

The embodiment of the invention discloses a test data generation method, a device, equipment and a storage medium, wherein the method comprises the following steps: responding to the detected interface definition instruction, and acquiring interface definition parameters corresponding to the interface definition instruction; generating an agent implementation class according to the interface definition parameters; and generating simulation test data according to the agent implementation class, and storing the simulation test data. According to the method provided by the embodiment of the invention, after the interface of the rear-end developer is well defined, the test interface is directly released by the platform, the system automatically generates the test data, the front end directly utilizes the existing interface to carry out one-time and over-handed development, the change of the interface of the rear end is reflected in real time that the front end is changed in time, and the generation efficiency of the test data is improved.

Description

Test data generation method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a test data generation method, a test data generation device, test data generation equipment and a storage medium.
Background
In the current test data generation, after receiving a new requirement every time, background developers begin to write interface definition documents and then give the interface definition documents to a front end, the front end then carries out front end development according to the documents, and the test data is released to a test environment after the development of a rear end interface is finished, so that a joint debugging stage is entered.
In the process of implementing the invention, the inventor finds that at least the following technical problems exist in the prior art: the front end is difficult to develop according to the interface definition document, can not be developed according to the existing interface data in one step or needs own mock data, and has low efficiency. The back end has a long development period because of the related business, and the front end waits for joint debugging at the time, so that the required development period is increased. Wasting development resources.
Disclosure of Invention
The embodiment of the invention provides a test data generation method, a test data generation device, test data generation equipment and a storage medium, and aims to improve the test data generation efficiency.
In a first aspect, an embodiment of the present invention provides a test data generation method, including:
responding to the detected interface definition instruction, and acquiring interface definition parameters corresponding to the interface definition instruction;
generating an agent implementation class according to the interface definition parameters;
and generating simulation test data according to the agent implementation class, and optionally storing the simulation test data, wherein on the basis of the scheme, the interface definition parameters comprise 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 body and an error code definition.
Optionally, on the basis of the foregoing scheme, the obtaining, in response to the detected interface definition instruction, the interface definition parameter corresponding to the interface definition instruction includes:
responding to the detected interface definition instruction, acquiring an interface type corresponding to the interface definition instruction, generating an interface definition parameter configuration interface based on the interface type, and displaying the interface definition parameter configuration interface;
and responding to the detected parameter configuration instruction, and acquiring interface definition parameters corresponding to the parameter configuration instruction.
Optionally, on the basis of the above scheme, the method further includes:
and when the interface type is the remote calling protocol type, registering the service to a remote procedure calling protocol registration center according to a set application program interface.
Optionally, on the basis of the above scheme, the interface type is a remote procedure call protocol type, and the generating and displaying an interface definition parameter configuration interface based on the interface type includes:
and generating and displaying an interface definition parameter configuration interface based on the registry address, the interface package full path, the interface field definition, the interface field request, the interface response structure body and the error code definition.
Optionally, on the basis of the above scheme, the interface type is a hypertext transfer protocol type, a hypertext transfer security protocol type, or a WebSocket protocol type, and the generating and displaying an interface definition parameter configuration interface based on the interface type includes:
and generating and displaying an interface definition parameter configuration interface based on the uniform resource identifier, the interface field definition, the interface field request, the interface response structure body and the error code definition.
Optionally, on the basis of the above scheme, the method further includes:
and managing a preset interface description template based on the detected interface form management instruction, wherein the interface description template comprises at least one of request and response parameter field definition, enumeration definition, response code definition, an interface access mode and an interface authentication mode.
In a second aspect, an embodiment of the present invention further provides a test data generating apparatus, including:
the interface definition module is used for responding to the detected interface definition instruction and acquiring interface definition parameters corresponding to the interface definition instruction;
the interface agent module is used for generating an agent implementation class according to the interface definition parameters;
and the data processing module is used for generating simulation test data according to the agent implementation class and storing the simulation test data.
In a third aspect, an embodiment of the present invention further provides a computer device, where the computer device includes:
one or more processors;
storage means for storing one or more programs;
when the one or more programs are executed by the one or more processors, the one or more processors are caused to implement the test data generation method as provided by any of the embodiments of the present invention.
In a fourth aspect, the embodiments of the present invention further provide a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the test data generation method provided in any embodiment of the present invention.
The test data generation method provided by the embodiment of the invention responds to the detected interface definition instruction to obtain the interface definition parameters corresponding to the interface definition instruction; generating an agent implementation class according to the interface definition parameters; and generating simulation test data according to the agent implementation class, storing the simulation test data, directly publishing a test interface by a platform after a back-end developer interface is defined, automatically generating the test data by the system, directly utilizing the existing interface to develop the test data once and over, and reflecting the change of the back-end interface to the timely change of the front end in real time, thereby improving the generation efficiency of the test data.
Drawings
Fig. 1 is a schematic flowchart of a test data generation method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a test data generating system according to a second embodiment of the present invention;
fig. 3a is a schematic structural diagram of an apparatus for automatically generating a test interface service according to a third embodiment of the present invention;
fig. 3b is a flowchart illustrating an interface definition configuration according to a third embodiment of the present invention;
fig. 3c is a schematic flowchart of interface publishing according to a third embodiment of the present invention;
fig. 3d is a schematic structural diagram of a management according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a schematic flowchart of a test data generation method according to an embodiment of the present invention. The present embodiment is applicable to a case when test data is automatically generated. The method may be performed by a test data generating device, which may be implemented in software and/or hardware, for example, which may be configured in a computer device. As shown in fig. 1, the method includes:
s110, responding to the detected interface definition instruction, and acquiring interface definition parameters corresponding to the interface definition instruction.
In this embodiment, in order to improve the generation efficiency of the test data, a back-end developer may define the interface definition parameters, and generate the simulation test data based on the defined interface definition parameters. The interface definition parameters may be set according to actual requirements or according to attributes of the interface itself, such as setting according to interface types, and the like, which is not limited herein.
Optionally, the interface definition parameter includes 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. The specific interface definition parameters may be determined according to the interface type.
In an embodiment of the present invention, the obtaining, in response to the detected interface definition instruction, an interface definition parameter corresponding to the interface definition instruction includes: responding to the detected interface definition instruction, acquiring an interface type corresponding to the interface definition instruction, generating an interface definition parameter configuration interface based on the interface type, and displaying the interface definition parameter configuration interface; and responding to the detected parameter configuration instruction, and acquiring interface definition parameters corresponding to the parameter configuration instruction. Illustratively, after an interface definition instruction initiated by a developer is detected, the interface definition instruction is analyzed to obtain an interface type included in the interface definition instruction, an interface definition parameter to be configured is determined according to the interface type, an interface definition parameter configuration interface is generated based on the interface definition parameter to be configured to be displayed, the developer triggers the parameter configuration instruction after the interface definition parameter configuration interface performs configuration and completion of the interface definition parameter, and a test data generation system acquires the interface definition parameter corresponding to the parameter configuration instruction as the interface definition parameter corresponding to the interface definition instruction.
In this embodiment, the interface type may be a remote procedure call protocol type, a hypertext transfer security protocol type, or a WebSocket protocol type. According to different characteristics of different interface types, different interface definition parameter configuration interfaces are required to be generated, so that developers can configure different interface definition parameters.
In one embodiment, the interface type is a remote procedure call protocol type, and the generating and displaying an interface definition parameter configuration interface based on the interface type includes: and generating and displaying an interface definition parameter configuration interface based on the registry address, the interface package full path, the interface field definition, the interface field request, the interface response structure body and the error code definition. Optionally, the developer selects an interface type, if the interface type is an RPC service, the registry address and the full path of the interface package need to be filled in, and then interface request and response field definitions including field name, length and type are performed, and an enumeration type needs to define List < Map <? Is it? And >. And in abnormal conditions, an abnormal enumeration code needs to be automatically defined. And finally, selecting a data definition type and a data storage type, after clicking and submitting, automatically generating an interface type by the system, storing a specific directory according to rules, and automatically generating manual data to generate Uniform Resource Locator (URL) connection.
In one embodiment, the interface type is a hypertext transfer protocol type, a hypertext transfer security protocol type, or a WebSocket protocol type, and the generating and displaying an interface definition parameter configuration interface based on the interface type includes: and generating and displaying an interface definition parameter configuration interface based on the uniform resource identifier, the interface field definition, the interface field request, the interface response structure body and the error code definition. Optionally, the developer selects an interface type, and if the interface type is hypertext transfer protocol type (HTTP)/hypertext transfer security protocol type (HTTPs)/WebSocket service, only the ULI needs to be specified, and then interface request and response field definitions including field name, length, type, and enumeration type need to be defined as List < Map <? Is it? And >. And in abnormal conditions, an abnormal enumeration code needs to be automatically defined. And finally, selecting a data definition type and a data storage type, after clicking and submitting, automatically generating an interface type by the system, storing a specific directory according to rules, and automatically generating manual data to generate URL connection.
And S120, generating an agent implementation class according to the interface definition parameters.
In this embodiment, after the developer defines the interface definition parameters, the test data generating apparatus may automatically generate the agent implementation class in a specific directory.
On the basis, the method further comprises the following steps: and when the interface type is the remote calling protocol type, registering the service to a remote procedure calling protocol registration center according to a set application program interface. That is, if it is a Remote Procedure Call (RPC) service, the service needs to be registered with the RPC registry according to a specific Application Programming Interface (API).
And S130, generating simulation test data according to the agent implementation class, and storing the simulation test data.
Optionally, the method for generating the simulation test data according to the agent implementation class may refer to a method for generating data according to a class in the prior art, which is not limited herein.
In a whole, a back-end developer can define interface definition parameters through an interface definition module, after a test data generation system receives the interface definition parameters defined by the back-end developer, an interface agent module generates an agent implementation class according to the interface definition parameters, and a data definition module randomly generates simulation test data based on the agent implementation class to serve as test data and stores the simulation test data through a data storage module.
In this embodiment, the storage of the simulation test data may support multiple data types of the simulation test data, for example, two types of ES and RDBMS may be supported, and a developer may select a storage type according to actual requirements when editing an interface. The data definition module can comprise manual definition and automatic definition, simulation test data are generated randomly by FAKE automatically according to interface definition classes to be stored in storage equipment, a database is generated manually, a system generates connection automatically, and functions of increasing, deleting, modifying and checking and batch import can be performed.
The embodiment of the invention responds to the detected interface definition instruction to obtain the interface definition parameter corresponding to the interface definition instruction; generating an agent implementation class according to the interface definition parameters; and generating simulation test data according to the agent implementation class, storing the simulation test data, directly publishing a test interface by a platform after a back-end developer interface is defined, automatically generating the test data by the system, directly utilizing the existing interface to develop the test data once and over, and reflecting the change of the back-end interface to the timely change of the front end in real time, thereby improving the generation efficiency of the test data.
On the basis of the scheme, the method further comprises the following steps: and managing a preset interface description template based on the detected interface form management instruction, wherein the interface description template comprises at least one of request and response parameter field definition, enumeration definition, response code definition, an interface access mode and an interface authentication mode. Specifically, the interface form management is mainly that a developer creates a submitted interface description template, including field definitions of request and response parameters, enumeration definitions, response code definitions, interface access modes, interface authentication modes, and the like.
Example two
Fig. 2 is a schematic structural diagram of a test data generating apparatus according to a second embodiment of the present invention. The test data generating device may be implemented in software and/or hardware, for example, the test data generating device may be configured in a computer device. In this embodiment, explanations of the same or corresponding terms as those in the above embodiments are omitted. As shown in fig. 2, the apparatus includes an interface definition module 210, an interface agent module 220, and a data processing module 230, wherein:
the interface definition module 210 is configured to, in response to a detected interface definition instruction, obtain an interface definition parameter corresponding to the interface definition instruction;
an interface agent module 220, configured to generate an agent implementation class according to the interface definition parameter;
and the data processing module 230 is configured to generate simulation test data according to the agent implementation class, and store the simulation test data.
In the embodiment of the invention, an interface definition module responds to a detected interface definition instruction, and an interface agent module acquires an interface definition parameter corresponding to the interface definition instruction; generating an agent implementation class according to the interface definition parameters; the data processing module generates simulation test data according to the agent implementation class, stores the simulation test data, directly releases a test interface through a platform after a rear-end developer interface is defined, the system automatically generates the test data, the front end directly utilizes the existing interface to develop by hands once, the change of the rear-end interface is reflected in real time that the front end is changed in time, and the generation efficiency of the test data is improved.
Optionally, on the basis of the above scheme, the interface definition parameter includes at least one of an interface packet path, an interface request manner, an interface uniform resource identifier address, an interface field definition, an interface field request, an interface response structure, and an error code definition.
Optionally, on the basis of the foregoing scheme, the interface definition module 210 is specifically configured to:
responding to the detected interface definition instruction, acquiring an interface type corresponding to the interface definition instruction, generating an interface definition parameter configuration interface based on the interface type, and displaying the interface definition parameter configuration interface;
and responding to the detected parameter configuration instruction, and acquiring interface definition parameters corresponding to the parameter configuration instruction.
Optionally, on the basis of the foregoing scheme, the interface agent module 230 is further configured to:
and when the interface type is the remote calling protocol type, registering the service to a remote procedure calling protocol registration center according to a set application program interface.
Optionally, on the basis of the foregoing scheme, the interface definition module 210 is specifically configured to:
and generating and displaying an interface definition parameter configuration interface based on the registry address, the interface package full path, the interface field definition, the interface field request, the interface response structure body and the error code definition.
Optionally, on the basis of the above scheme, the interface type is a hypertext transfer protocol type, a hypertext transfer security protocol type, or a WebSocket protocol type, and the interface definition module 210 is specifically configured to:
and generating and displaying an interface definition parameter configuration interface based on the uniform resource identifier, the interface field definition, the interface field request, the interface response structure body and the error code definition.
Optionally, on the basis of the above scheme, the apparatus further includes an interface form management module, configured to:
the interface-based form management module manages a preset interface description template based on the detected interface form management instruction, wherein the interface description template comprises at least one of request and response parameter field definition, enumeration definition, response code definition, an interface access mode and an interface authentication mode.
EXAMPLE III
The present embodiment provides a preferred embodiment based on the above-described scheme. The embodiment of the invention provides a device for automatically generating test interface service, which is used for realizing automatic generation and maintenance of test data.
Fig. 3a is a schematic structural diagram of an apparatus for automatically generating a test interface service according to a third embodiment of the present invention. The various blocks in FIG. 3a are illustrated as follows:
the data storage module (namely, the ES and the RDBMS in the figure) temporarily supports two types of ES and RDBMS, the interface data of the developer comprises automatically generated data and manually generated data, the storage equipment is saved, and the developer selects the storage type when editing the interface.
The method comprises a Netty service and an RPC (remote procedure call) registry, wherein the RPC registry is an existing registry such as JSF (Java Server face) in Kyoto, Taobao DUBBO and the like, and a developer interface defines that if the RPC interface is not available, the address of the service registry needs to be selected. The HTTP, HTTPS and WEBSOCKET services are established on the Netty service, and the foreground can freely configure and view the restart service.
The interface definition module is a core module and comprises an interface packet path, if the interface packet path is a non-RPC service, the request mode of the interface, an interface URL address, an interface field definition, a request and response structure body and an error code definition need to be defined.
After the interface dynamic proxy module defines the interface of the developer, the module automatically generates a proxy implementation class in a specific directory, and if the RPC service needs to register the service to an RPC registration center according to a specific API.
The API gateway service and the authentication service are mainly various interface unified closing-in and interface authentication services, are consistent with the production authentication mode, and can be subsequently translated and released for production.
The data self-defining module is manual or automatic, simulation test data are generated randomly by FAKE according to interface definition classes automatically for storage of storage equipment, a database is generated manually, and the system generates connection automatically, so that functions of increasing, deleting, modifying, checking and batch importing can be performed.
The device for automatically generating the test interface service mainly comprises three functions of interface definition configuration, interface release and management.
Firstly, interface definition configuration:
fig. 3b is a flowchart illustrating an interface definition configuration according to a third embodiment of the present invention. As shown in fig. 3b, the interface definition configuration includes:
1) and (3) selecting an interface type by a developer, filling out a registration center address and a full path of an interface package if the interface type is RPC service, and only specifying a URI if the interface type is HTTP/HTTPS/WEBSOCKET service.
2) Interface request and response field definitions are made, including field name, length, type, enumeration type requires definition of List < Map <? Is it? And >. And in abnormal conditions, an abnormal enumeration code needs to be automatically defined.
3) Selecting a data definition type and a data storage type, after clicking and submitting, automatically generating an interface type by the system, storing a specific directory according to rules, and automatically generating manual data to generate URL connection.
Second, interface publishing
Fig. 3c is a schematic flowchart of interface publishing provided by the third embodiment of the present invention. As shown in fig. 3c, the interface publishing includes:
and (3) clicking and releasing the interface definition template by a developer, judging the type of the generated data at the moment, automatically generating the quantity of the data if the type is automatically generated, and then storing the ES and the RDBMS by the fake random data. And if the manual addition is carried out, automatically jumping to the URL address generated in the figure 1 for manual data maintenance, including batch import.
And filling in the service port and checking whether the service port is started or not, automatically generating a corresponding proxy implementation class according to the previously configured interface type, and putting the proxy implementation class into a specific service directory for subsequent directory monitoring service processing.
Monitoring the specific directory by using the WatchService of the NIO, further processing if the file is changed, and changing and reloading the interface and the agent implementation class according to the event type. The event types include interface offline (delete), interface generation, and interface change.
And then the network service restart corresponding to the directory for acquiring the event is effective. If the RPC service needs to be automatically re-registered with the service center. And the RPC interface automatically uploads to the MAVEN warehouse center.
Management of
Fig. 3d is a schematic structural diagram of a management provided by the third embodiment of the present invention. As shown in fig. 3d, the management includes:
the Netty service management needs to manage the ports and services corresponding to Netty due to the starting of various services of the platform, and can be used for restarting and starting log query when the platform is operated. Part of the unused service can be dropped first in case the port is not sufficient.
The interface form management is mainly that a developer creates and submits an interface description template, which comprises request and response parameter field definitions, enumeration definitions, response code definitions, interface access modes, authentication modes and the like.
The manual data maintenance management is that the developer generates URL address after selecting manual data generation mode, and can click to increase, delete, modify and import data in batch
And the data set management is the data display of the storage equipment, and the data is maintained, managed and checked.
And the monitoring directory management is the display of all current directories of the system, the directories comprise configuration files of configuration and automatically generated codes, the codes can be exported, the business interfaces of developers can be imported, and then the Netty service is restarted for testing.
And verifying and issuing, and performing interface connectivity and access debugging by using a POSTMAN (post transfer number name) and other clients after the interface is issued.
According to the embodiment of the invention, after the interface of the end developer is well defined, the test interface is directly released by the platform, the system automatically generates the test data, the front end directly utilizes the existing interface to carry out one-time and over-the-hand development, the change of the rear-end interface is reflected in real time that the front end is changed in time, and the generation efficiency of the test data is improved.
Example four
Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. Fig. 4 is a schematic structural diagram of a computer device according to a fourth embodiment of the present invention. FIG. 4 illustrates a block diagram of an exemplary computer device 412 suitable for use in implementing embodiments of the present invention. The computer device 412 shown in FIG. 4 is only one example and should not impose any limitations on the functionality or scope of use of embodiments of the present invention.
As shown in FIG. 4, computer device 412 is in the form of a general purpose computing device. Components of computer device 412 may include, but are not limited to: one or more processors 414, a system memory 428, and a bus 418 that couples the various system components (including the system memory 428 and the processors 414).
Bus 418 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and processor 414 or a local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Computer device 412 typically includes a variety of computer system readable media. Such media can be any available media that is accessible by computer device 412 and includes both volatile and nonvolatile media, removable and non-removable media.
The 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. The computer device 412 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage 434 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 418 by one or more data media interfaces. Memory 428 can include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 440 having a set (at least one) of program modules 442 may be stored, for instance, 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 examples or some combination thereof may comprise an implementation of a network environment. The program modules 442 generally perform the functions and/or methodologies of the described embodiments of the invention.
The computer device 412 may also communicate with one or more external devices 414 (e.g., keyboard, pointing device, display 424, etc.), with one or more devices that enable a user to interact with the computer device 412, and/or with any devices (e.g., network card, modem, etc.) that enable the computer device 412 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 422. Also, computer device 412 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN) and/or a public network, such as the Internet) through network adapter 420. As shown, network adapter 420 communicates with the other modules of computer device 412 over bus 418. It should be appreciated that although not shown in the figures, 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, among others.
The processor 414 executes various functional applications and data processing by executing programs stored in the system memory 428, for example, to implement the test data generation method provided by the embodiment of the present invention, the method includes:
responding to the detected interface definition instruction, and acquiring interface definition parameters corresponding to the interface definition instruction;
generating an agent implementation class according to the interface definition parameters;
and generating simulation test data according to the agent implementation class, and storing the simulation test data.
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.
EXAMPLE five
The fifth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the test data generating method provided in the fifth embodiment of the present invention, where the method includes:
responding to the detected interface definition instruction, and acquiring interface definition parameters corresponding to the interface definition instruction;
generating an agent implementation class according to the interface definition parameters;
and generating simulation test data according to the agent implementation class, and storing the simulation test data.
Of course, the computer program stored on the computer-readable storage medium provided by the embodiments of the present invention is not limited to the above method operations, and may also perform operations related to the test system construction method provided by any embodiments of the present invention.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
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.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, or the like, as well as conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the 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 the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments illustrated herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A method for generating test data, comprising:
responding to the detected interface definition instruction, and acquiring interface definition parameters corresponding to the interface definition instruction;
generating an agent implementation class according to the interface definition parameters;
and generating simulation test data according to the agent implementation class, and storing the simulation test data.
2. The method of claim 1, wherein 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, wherein the obtaining, in response to the detected interface definition instruction, the interface definition parameters corresponding to the interface definition instruction comprises:
responding to the detected interface definition instruction, acquiring an interface type corresponding to the interface definition instruction, generating an interface definition parameter configuration interface based on the interface type, and displaying the interface definition parameter configuration interface;
and responding to the detected parameter configuration instruction, and acquiring interface definition parameters corresponding to the parameter configuration instruction.
4. The method of claim 3, further comprising:
and when the interface type is the remote calling protocol type, registering the service to a remote procedure calling protocol registration center according to a set application program interface.
5. The method of claim 3, wherein the interface type is a remote procedure call protocol type, and wherein generating and presenting the interface definition parameter configuration interface based on the interface type comprises:
and generating and displaying an interface definition parameter configuration interface based on the registry address, the interface package full path, the interface field definition, the interface field request, the interface response structure body and the error code definition.
6. The method of claim 3, wherein the interface type is a hypertext transfer protocol type, a hypertext transfer security protocol type, or a WebSocket protocol type, and generating and displaying an interface definition parameter configuration interface based on the interface type comprises:
and generating and displaying an interface definition parameter configuration interface based on the uniform resource identifier, the interface field definition, the interface field request, the interface response structure body and the error code definition.
7. The method of claim 1, further comprising:
and managing a preset interface description template based on the detected interface form management instruction, wherein the interface description template comprises at least one of request and response parameter field definition, enumeration definition, response code definition, an interface access mode and an interface authentication mode.
8. A test data generation apparatus, comprising:
the interface definition module is used for responding to the detected interface definition instruction and acquiring interface definition parameters corresponding to the interface definition instruction;
the interface agent module is used for generating an agent implementation class according to the interface definition parameters;
and the data processing module is used for generating simulation test data according to the agent implementation class and storing the simulation test data.
9. A computer device, the device comprising:
one or more processors;
storage means for storing one or more programs;
when executed by one or more processors, cause the one or more processors to implement a test data generation method as claimed in any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a test data generation method according to any one of claims 1 to 7.
CN202110762305.6A 2021-07-06 2021-07-06 Test data generation method, device, equipment and storage medium Pending CN113485927A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110762305.6A CN113485927A (en) 2021-07-06 2021-07-06 Test data generation method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110762305.6A CN113485927A (en) 2021-07-06 2021-07-06 Test data generation method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113485927A true CN113485927A (en) 2021-10-08

Family

ID=77940418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110762305.6A Pending CN113485927A (en) 2021-07-06 2021-07-06 Test data generation method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113485927A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116662207A (en) * 2023-07-24 2023-08-29 北京银联金卡科技有限公司 Fuzzy test method for block chain network

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112363941A (en) * 2020-11-13 2021-02-12 平安普惠企业管理有限公司 Interface testing method and device, computer equipment and storage medium
CN112506802A (en) * 2021-01-09 2021-03-16 杭银消费金融股份有限公司 Test data management method and system
CN113050987A (en) * 2021-03-26 2021-06-29 北京沃东天骏信息技术有限公司 Interface document generation method and device, storage medium and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112363941A (en) * 2020-11-13 2021-02-12 平安普惠企业管理有限公司 Interface testing method and device, computer equipment and storage medium
CN112506802A (en) * 2021-01-09 2021-03-16 杭银消费金融股份有限公司 Test data management method and system
CN113050987A (en) * 2021-03-26 2021-06-29 北京沃东天骏信息技术有限公司 Interface document generation method and device, storage medium and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116662207A (en) * 2023-07-24 2023-08-29 北京银联金卡科技有限公司 Fuzzy test method for block chain network

Similar Documents

Publication Publication Date Title
US11093377B2 (en) Systems and methods for testing source code
US10705942B1 (en) Simulated testing of API
US10642721B2 (en) Generation of automated testing scripts by converting manual test cases
US10949335B2 (en) Designer defined mocking service behavior
US8898643B2 (en) Application trace replay and simulation systems and methods
US11561889B2 (en) Orchestration for automated performance testing
US10963370B2 (en) Default mock implementations at a server
US20200233789A1 (en) User defined mocking service behavior
CN110955409B (en) Method and device for creating resources on cloud platform
CN111352836A (en) Pressure testing method and related device
CN113836014A (en) Interface testing method and device, electronic equipment and storage medium
CN113485927A (en) Test data generation method, device, equipment and storage medium
CN113778897A (en) Automatic test method, device, equipment and storage medium of interface
US20180121441A1 (en) Accessing application services from forms
CN113238739A (en) Plug-in development and data acquisition method, device, electronic equipment and medium
CN110874278A (en) Embedding method of external system, workflow system, device and storage medium
US20220012050A1 (en) Mini program batch processing method and apparatus, electronic device, and readable storage medium
CN112202598B (en) Log recording method and device
CN114489674A (en) Data verification method and device of dynamic data model
CN108170557B (en) Method and apparatus for outputting information
CN113542323A (en) Service processing method, device, equipment and computer readable storage medium
CN112181802A (en) Test method and device
CN105610908B (en) A kind of samba service implementing method and system based on Android device
WO2023230797A1 (en) Cross-system test method and apparatus
US20230037019A1 (en) Techniques for distributed interface component generation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination