Test data generation method and device, equipment, medium and program product

By obtaining the field information of the data table to be constructed and using the test data in the preset knowledge base to generate the test data table, the problems of low efficiency and low accuracy in the existing technology are solved, and efficient and accurate test data generation is achieved.

CN119862129APending Publication Date: 2025-04-22RUN TECH CO LTD BEIJING
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411954751.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-22

AI Technical Summary

Technical Problem

In the prior art, the generation of test data relies on manual filling, which is inefficient and has low accuracy, making it difficult to meet the testing needs of big data application products.

Method used

By obtaining the field information of the data table to be constructed, using the object files and object relationship files in the preset knowledge base, the target test data is determined, and the test data table is generated based on the target test data and the data table to be constructed.

Benefits of technology

It improves the efficiency and accuracy of the generation of test data, saves manpower and material resources, and meets the testing needs of big data application products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119862129A_ABST
    Figure CN119862129A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a test data generation method and device, equipment, a medium and a program product, and the method comprises the steps: obtaining a to-be-constructed data table which comprises the field information of to-be-generated test data; target test data in a preset knowledge base are obtained according to the field information, knowledge files in the preset knowledge base comprise object files and object relation files, the object files comprise test data of objects, and the object relation files comprise test data of relations between the objects; and determining a test data table according to the target test data and a to-be-constructed data table. According to the technical scheme provided by the invention, the generation efficiency and accuracy of the test data can be improved, and manpower and material resources are saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data testing, and in particular to a method, device, equipment, medium and program product for generating test data. Background Art

[0002] In recent years, the application of broadband networks and value-added services in my country has become more and more extensive. The application scenarios of big data are increasing. In the process of testing big data products, a large amount of data with different protocols and different types is needed to test functions and scenarios. Therefore, the construction of test data sets is an important issue in the data testing process.

[0003] The current generation of test data mainly relies on manually filling in data tables. However, the manual filling method is inefficient and has low accuracy. Summary of the invention

[0004] The technical solution of the embodiment of the present invention provides a method, device, equipment, medium and program product for generating test data. Through the technical solution of the present invention, the efficiency of generating test data can be improved, the accuracy of generating test data can be improved, and manpower and material resources can be saved.

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

[0006] Obtaining a data table to be constructed, wherein the data table to be constructed includes field information of test data to be generated;

[0007] Acquire target test data in a preset knowledge base according to the field information, wherein the knowledge files in the preset knowledge base include object files and object relationship files, wherein the object files include test data of objects, and the object relationship files include test data of relationships between objects;

[0008] A test data table is determined according to the target test data and the data table to be constructed.

[0009] In a second aspect, an embodiment of the present invention provides a device for generating test data, including:

[0010] A data table acquisition module is used to acquire a data table to be constructed, wherein the data table to be constructed includes field information of test data to be generated;

[0011] A data acquisition module, used to acquire target test data in a preset knowledge base according to the field information, wherein the knowledge files in the preset knowledge base include object files and object relationship files, wherein the object files include test data of objects, and the object relationship files include test data of relationships between objects;

[0012] The test data generating module is used to determine the test data table according to the target test data and the data table to be constructed.

[0013] In a third aspect, an embodiment of the present invention provides an electronic device, the electronic device comprising:

[0014] at least one processor; and

[0015] a memory communicatively connected to the at least one processor; wherein,

[0016] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the test data generating method according to any one of the embodiments of the present invention.

[0017] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement any one of the test data generation methods described in the embodiments of the present invention when executed.

[0018] In a fifth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it implements the method for generating test data according to any one of the embodiments of the present invention.

[0019] The embodiment of the present invention provides a method, device, equipment, medium and program product for generating test data, the method comprising: obtaining a data table to be constructed, the data table to be constructed comprising field information of the test data to be generated; obtaining target test data in a preset knowledge base according to the field information, the knowledge files in the preset knowledge base comprising object files and object relationship files, wherein the object files comprise test data of objects, and the object relationship files comprise test data of relationships between objects; determining a test data table according to the target test data and the data table to be constructed. Specifically, the target test data in the preset knowledge base can be accurately determined through the field information of the data table to be constructed, and then the test data table can be quickly generated through the target test data and the data table to be constructed. The technical solution of the embodiment of the present invention can improve the efficiency of test data generation, improve the accuracy of test data generation, and save manpower and material resources by reusing the existing test data in the preset knowledge base. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1 A flowchart of a method for generating test data provided in Embodiment 1 of the present invention;

[0022] Figure 2 A flowchart of a method for generating test data provided in Embodiment 2 of the present invention;

[0023] Figure 3 A flowchart of a method for generating test data provided in Embodiment 3 of the present invention;

[0024] Figure 4 A flowchart of a method for generating test data provided in Embodiment 4 of the present invention;

[0025] Figure 5 A schematic diagram of the structure of a test data generating device provided in Embodiment 5 of the present invention;

[0026] Figure 6 A schematic diagram of the structure of an electronic device provided in Embodiment 6 of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] It should be noted that the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in the technical solution of the present disclosure are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0030] Embodiment 1

[0031] Figure 1 The flowchart of a method for generating test data provided in the first embodiment of the present invention can be applied to the scenario of testing the data governance function of a big data application product. In particular, the case of constructing test data required for application product testing. The method can be executed by a test data generation device, which can be implemented by software and / or hardware and configured in a computer or server.

[0032] like Figure 1 As shown, including:

[0033] Step 110: Obtain a data table to be constructed, wherein the data table to be constructed includes field information of test data to be generated.

[0034] The data table to be constructed is a test data table to be filled with content. The data table to be constructed includes field information of the test data, and the field information can represent the attributes and types of the required test data. Optionally, the field information can be a header of the data table to be constructed.

[0035] Specifically, according to the field information, target test data corresponding to the field information can be screened from the test data, and the target test data can be filled into the data table to be constructed to generate a test data table. The method for determining the target test data can be determined by the following content of the embodiment of the present invention.

[0036] Step 120: Obtain target test data in a preset knowledge base according to the field information, wherein the knowledge files in the preset knowledge base include object files and object relationship files, wherein the object files include test data of objects, and the object relationship files include test data of relationships between objects.

[0037] Among them, the preset knowledge base includes a knowledge file, and the knowledge file includes test data of each object. The attributes and type of the knowledge file correspond to the attributes and type of the test data of the object in the knowledge file. Therefore, the type and attribute of the test data in the knowledge file can be determined by the type or attribute of the knowledge file. Furthermore, there may be certain logical relationships between the objects themselves, such as subordinate relationships, inclusion relationships, parallel and hierarchical relationships, etc. Therefore, the test data of the object relationship file includes test data of the logical relationship between objects. Furthermore, the test data can be attribute parameters, type parameters and feature identifiers of the object.

[0038] Specifically, the target test data corresponding to the attributes and types represented by the field information can be determined from a preset database through the attributes and types represented by the field information.

[0039] Step 130: Determine a test data table according to the target test data and the data table to be constructed.

[0040] Optionally, according to the correspondence between the target test data and field information in the data table to be constructed, the target test data is filled into the data table to be constructed to obtain the test data table.

[0041] Specifically, the target test information may be filled into the row or column corresponding to the field information of the data table to be constructed, thereby generating a test data table.

[0042] For example, the field information may be fruit, and the target test data may be apple, peach, and pear. The field information is the header of column A of the data table to be constructed, so the target test data may be filled into column A to generate a test data table.

[0043] An embodiment of the present invention provides a method for generating test data. The method includes: obtaining a data table to be constructed, the data table to be constructed includes field information of the test data to be generated; obtaining target test data in a preset knowledge base according to the field information, the knowledge files in the preset knowledge base include object files and object relationship files, wherein the object files include test data of objects, and the object relationship files include test data of relationships between objects; determining a test data table according to the target test data and the data table to be constructed. Specifically, the target test data in the preset knowledge base can be accurately determined through the field information of the data table to be constructed, and then the test data table can be quickly generated through the target test data and the data table to be constructed. The technical solution of the embodiment of the present invention can improve the efficiency of test data generation, improve the accuracy of test data generation, and save manpower and material resources by reusing the existing test data in the preset knowledge base.

[0044] Embodiment 2

[0045] Figure 2 A second embodiment of the present invention provides a flow chart of a method for generating test data. Based on the above embodiment, this embodiment further defines a method for obtaining target test data in a preset knowledge base according to the field information.

[0046] like Figure 2 As shown, including:

[0047] Step 210: Obtain a data table to be constructed, wherein the data table to be constructed includes field information of test data to be generated.

[0048] Step 220: semantically match the field information with the attribute information of the knowledge file.

[0049] The attribute information of the knowledge file represents the attributes of the test data in the knowledge file, such as the test file type, category and field, etc. Furthermore, semantic matching is to analyze the text content of the field information and the attribute information to determine whether they are equivalent or similar. If they are equivalent or similar, the semantic matching is considered successful, otherwise it is unsuccessful.

[0050] Step 230: If the match is successful, the target test data is determined according to the test data in the knowledge file that matches the semantics of the field information.

[0051] Specifically, if the match is successful, it means that the attribute or type of the test data in the knowledge file is the same as the semantics of the field information, and the test data can be determined as the target test data.

[0052] Step 240: If the match fails, query the preset dictionary according to the field information that failed to match, and obtain the data generation method corresponding to the field information that failed to match.

[0053] The preset dictionary includes data generation methods corresponding to various field information in the art, and test data corresponding to the field information can be generated according to the data generation method. The data generation method can be implemented by a data generation script or a data call script, and the script has built-in data generation and call processes, and the test data corresponding to the method can be generated through the data generation method.

[0054] Specifically, since the test data required for this test may not exist in the preset knowledge base or the target test data in the preset knowledge base is insufficient, the match may fail. In this case, the preset dictionary can be queried to determine the data generation method corresponding to the field information, and then the test data corresponding to the field information can be generated according to the data generation method.

[0055] Step 250: Generate the target test data according to the data generation method corresponding to the field information that fails to match.

[0056] Specifically, when the match fails, the target test data corresponding to the field information can be generated by a data generation method corresponding to the field information to achieve the purpose of obtaining the target test data.

[0057] Optionally, the preset knowledge base also includes data configuration information; step 250 includes:

[0058] The data configuration information is queried according to the field information where the match fails, to obtain the target data configuration information.

[0059] The target test data is generated according to the data generation method and target data configuration information corresponding to the field information that failed to match.

[0060] Specifically, the data configuration information is used to generate target test data, and the data configuration information includes data requirements of the target test data, such as data format, data type and data identifier. Exemplarily, if the field information that fails to match is characterized as requiring test data about fruits, the data configuration information may be identifiers of different types of fruits, English names, fruit types and fruit characteristics, etc. Further, the target test data may be generated according to the data configuration information and the data generation method.

[0061] Step 260: Determine a test data table according to the target test data and the data table to be constructed.

[0062] The embodiment of the present invention provides a method for generating test data. For existing test data in a preset knowledge base that meets the test requirements, the test data in the preset knowledge base can be directly used. For test data that does not exist in the preset knowledge base, a data generation method can be obtained by querying a preset field, and the test data can be generated by the data generation method. Through the technical solution of the embodiment of the present invention, the test data is constructed in combination with the preset knowledge base and the preset dictionary, which can improve the generation efficiency of test data, improve the accuracy of test data generation, and save manpower and material resources.

[0063] Embodiment 3

[0064] Figure 3 This is a flow chart of a method for generating test data provided in Embodiment 3 of the present invention. This embodiment is based on the above embodiments and further supplements the method for supplementing the target test data.

[0065] like Figure 3 As shown, including:

[0066] Step 310: Obtain a data table to be constructed, wherein the data table to be constructed includes field information of test data to be generated.

[0067] Step 320: Obtain target test data in a preset knowledge base according to the field information, wherein the knowledge files in the preset knowledge base include object files and object relationship files, wherein the object files include test data of objects, and the object relationship files include test data of relationships between objects.

[0068] Step 330: For any data table to be constructed, obtain the number of data items to be generated in the current data table to be constructed.

[0069] Specifically, the data table to be constructed marks the number of data items required for this test data generation task, that is, this time, the target test data having the number of data items needs to be filled into the data table to be constructed.

[0070] Step 340: If the target number of test data items is less than the number of data items to be generated, then incremental test data is generated according to the data generation method corresponding to the field information in the current data table to be constructed.

[0071] Specifically, due to the incompleteness of the data in the preset knowledge base, the number of target test data may be less than the number of data to be generated. Therefore, it is necessary to newly generate some target test data to meet the quantity requirement of the test data.

[0072] Specifically, the incremental test data generation method may include:

[0073] The data configuration information is queried according to the field information to obtain the target data configuration information; and then, incremental test data of the missing quantity is generated according to the data generation method corresponding to the field information and the target data configuration information.

[0074] Optionally, after generating incremental test data, it also includes:

[0075] Determine a target knowledge file corresponding to the current data table to be constructed; and update the target knowledge file according to the incremental test data.

[0076] Among them, the target knowledge file is the file corresponding to the target test data.

[0077] Specifically, the target knowledge file corresponding to the target test data in the preset knowledge base can be determined through the field information of the data table to be constructed, and then the incremental test data can be merged into the target knowledge file to ensure the comprehensiveness of the target knowledge file data.

[0078] Step 350: Determine a test data table according to the target test data, incremental test data and the current data table to be constructed.

[0079] Specifically, the target test data and the incremental test data may be filled into corresponding positions of the data table to be constructed to generate a test data table, such as filling into the data column represented by the field information corresponding to the target test data.

[0080] The embodiment of the present invention provides a method for generating test data. When the amount of existing test data that meets the test requirements in a preset knowledge base is insufficient, a preset dictionary is queried according to field information to obtain a data generation method. The remaining amount of test data is constructed according to the data generation method as incremental data, and the preset knowledge base is updated according to the incremental data, so that the test data constructed each time can be reused in subsequent test data generation scenarios, thereby improving data utilization.

[0081] Embodiment 4

[0082] Figure 4 This is a flow chart of a method for generating test data provided in an embodiment of the present invention. This embodiment is based on the above embodiments and further optimizes the implementation details.

[0083] like Figure 4 As shown, including:

[0084] Step 401: Read a preset knowledge base.

[0085] Specifically, the preset database includes knowledge files, and the knowledge files include test data. Furthermore, the configuration information of the preset database can be read into the memory to facilitate subsequent calls.

[0086] Step 402: Input the required number of target test data.

[0087] Step 403: read the table structure of the data table to be constructed and parse the field information.

[0088] Among them, the field information can represent the type and attribute information of the required target test data. The field information can be the header or table name of the data table to be constructed. The target test data can be filled into the data column of the header corresponding to the field information to generate a test data table.

[0089] Step 404: Determine whether the field information matches the knowledge file of the preset knowledge base successfully.

[0090] Specifically, the field information may be semantically matched with the attribute information of the knowledge file. If the match is successful, step 405 is executed; otherwise, step 406 is executed.

[0091] Step 405: Determine whether the amount of test data in the knowledge file is greater than the required amount of target test outputs.

[0092] Specifically, if the number of test data in the knowledge file is less than the required number of target test data, it needs to be supplemented and step 406 is executed. Otherwise, step 409 is executed. A test data table is generated according to the test data and the data table to be constructed.

[0093] Step 406: Load each class of construction data.

[0094] Step 407: Construct target test data.

[0095] Specifically, the class of constructed data corresponds to the data generation method of the embodiment of the present invention, and the test data corresponding to the data generation method can be generated through the data generation method. Specifically, the target data configuration information corresponding to the field information can be used to generate the target test data through the target data configuration information and the data generation method.

[0096] Step 408: Update the constructed target test data into the knowledge base.

[0097] Specifically, the constructed target test data may be updated into the knowledge base to ensure the comprehensiveness of the data in the knowledge base.

[0098] Step 409: Generate a test data table.

[0099] A test data generation method provided by an embodiment of the present invention can improve the test data generation efficiency, improve the test data generation accuracy, and save manpower and material resources.

[0100] Embodiment 5

[0101] Figure 5 This is a schematic diagram of the structure of a test data generation device provided in Embodiment 5 of the present invention. Figure 5 As shown, the device comprises:

[0102] A data table acquisition module 510 is used to acquire a data table to be constructed, wherein the data table to be constructed includes field information of test data to be generated;

[0103] A data acquisition module 520 is used to acquire target test data in a preset knowledge base according to the field information, wherein the knowledge files in the preset knowledge base include object files and object relationship files, wherein the object files include test data of objects, and the object relationship files include test data of relationships between objects;

[0104] The test data generating module 530 is used to determine a test data table according to the target test data and the data table to be constructed.

[0105] An embodiment of the present invention provides a device for generating test data, which comprises: obtaining a data table to be constructed, wherein the data table to be constructed includes field information of the test data to be generated; obtaining target test data in a preset knowledge base according to the field information, wherein the knowledge files in the preset knowledge base include object files and object relationship files, wherein the object files include test data of objects, and the object relationship files include test data of relationships between objects; and determining a test data table according to the target test data and the data table to be constructed. Specifically, the target test data in the preset knowledge base can be accurately determined through the field information of the data table to be constructed, and then the test data table can be quickly generated through the target test data and the data table to be constructed. The technical solution of the embodiment of the present invention can improve the efficiency of test data generation, improve the accuracy of test data generation, and save manpower and material resources by reusing the existing test data in the preset knowledge base.

[0106] Optionally, the data acquisition module 520 includes:

[0107] A matching unit, used for semantically matching the field information with the attribute information of the knowledge file;

[0108] A success unit is used to determine the target test data according to the test data in the knowledge file that matches the semantics of the field information if the match is successful.

[0109] The data acquisition module 520 also includes:

[0110] A data generation method determination unit, configured to, if the match fails, query a preset dictionary based on the field information that failed to match, and obtain a data generation method corresponding to the field information that failed to match;

[0111] A generating unit is used to generate the target test data according to the data generating method corresponding to the field information that fails to match.

[0112] Optionally, the preset knowledge base also includes data configuration information;

[0113] The generation unit includes:

[0114] A data configuration information determination subunit, configured to query the data configuration information according to the field information where the match fails, to obtain target data configuration information;

[0115] A generating subunit is used to generate the target test data according to the data generating method and target data configuration information corresponding to the field information that failed to match.

[0116] Optionally, the test data generating module 530 further includes:

[0117] A quantity acquisition unit, used for acquiring the number of data items to be generated in the current data table to be constructed for any data table to be constructed;

[0118] An incremental generation unit, configured to generate incremental test data according to a data generation method corresponding to field information in the current data table to be constructed if the target test data number is less than the to-be-generated data number;

[0119] The table generating unit is used to determine the test data table according to the target test data, the incremental test data and the current data table to be constructed.

[0120] Optionally, the incremental generation unit includes:

[0121] A target knowledge file determination subunit is used to determine the target knowledge file corresponding to the current data table to be constructed;

[0122] An updating subunit is used to update the target knowledge file according to the incremental test data.

[0123] Optionally, the test data generating module 530 is specifically used to fill the target test data into the data table to be constructed according to the correspondence between the target test data and the field information in the data table to be constructed, so as to obtain the test data table.

[0124] The test data generating device provided in the embodiment of the present invention can execute the test data generating method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0125] Embodiment 6

[0126] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0127] like Figure 6As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0128] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0129] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a method for generating test data.

[0130] In some embodiments, the method for generating test data may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the method for generating test data described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the method for generating test data in any other appropriate manner (e.g., by means of firmware).

[0131] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0132] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0133] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0134] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0135] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0136] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0137] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0138] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for generating test data, characterized in that: include: Obtaining a data table to be constructed, wherein the data table to be constructed includes field information of test data to be generated; Acquire target test data in a preset knowledge base according to the field information, wherein the knowledge files in the preset knowledge base include object files and object relationship files, wherein the object files include test data of objects, and the object relationship files include test data of relationships between objects; A test data table is determined according to the target test data and the data table to be constructed.

2. The method according to claim 1, characterized in that The step of acquiring target test data in a preset knowledge base according to the field information includes: semantically matching the field information with the attribute information of the knowledge file; If the match is successful, the target test data is determined based on the test data in the knowledge file that matches the semantics of the field information.

3. The method according to claim 2, characterized in that Also includes: If the match fails, query the preset dictionary according to the field information that failed to match, and obtain the data generation method corresponding to the field information that failed to match; The target test data is generated according to the data generation method corresponding to the field information that fails to match.

4. The method according to claim 3, characterized in that The preset knowledge base also includes data configuration information; The method for generating the target test data according to the data generation method corresponding to the field information that fails to match comprises: Query the data configuration information according to the field information where the match fails, and obtain the target data configuration information; The target test data is generated according to the data generation method and target data configuration information corresponding to the field information that failed to match.

5. The method according to claim 1, characterized in that Before determining the test data table according to the target test data and the data table to be constructed, the method further includes: For any data table to be constructed, obtain the number of data items to be generated in the current data table to be constructed; If the target number of test data is less than the number of data to be generated, then generating incremental test data according to the data generation method corresponding to the field information in the current data table to be constructed; The step of determining the test data table according to the target test data and the data table to be constructed includes: A test data table is determined according to the target test data, the incremental test data and the current data table to be constructed.

6. The method according to claim 5, characterized in that After generating incremental test data, it also includes: Determine the target knowledge file corresponding to the current data table to be constructed; The target knowledge file is updated according to the incremental test data.

7. The method according to claim 1, characterized in that The step of determining the test data table according to the target test data and the data table to be constructed includes: According to the correspondence between the target test data and the field information in the data table to be constructed, the target test data is filled into the data table to be constructed to obtain the test data table.

8. A device for generating test data, characterized in that: include: A data table acquisition module is used to acquire a data table to be constructed, wherein the data table to be constructed includes field information of test data to be generated; A data acquisition module, used to acquire target test data in a preset knowledge base according to the field information, wherein the knowledge files in the preset knowledge base include object files and object relationship files, wherein the object files include test data of objects, and the object relationship files include test data of relationships between objects; The test data generating module is used to determine the test data table according to the target test data and the data table to be constructed.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the test data generation method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the test data generation method according to any one of claims 1 to 7 when executed.

11. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the method for generating test data according to any one of claims 1 to 7.

Citation Information

Cited By

  • Incremental test context generation method and system based on minimal patch graph

    CN120723659B