Test data generation method and related device

By automatically generating forward and reverse resource packages that meet the test requirements, the problem of manual design of resource packages taking time and easy to miss specifications is solved, and the test coverage is improved.

CN119473902APending Publication Date: 2025-02-18AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411643541.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

After the program changes, manual design of forward and reverse resource packages that meet the specifications takes a long time and are prone to missed resource package specifications, resulting in low test coverage.

Method used

By setting the upper and lower limit information of the resource package level and size, creating folder levels and setting content limit requirements, we will automatically generate forward and reverse resource packages that meet the test requirements.

Benefits of technology

Reduces workload and test data generation time, reduces omissions in resource package specifications, and improves test coverage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473902A_ABST
    Figure CN119473902A_ABST
Patent Text Reader

Abstract

The invention discloses a test data generation method and a related device, and the method comprises the steps: setting the number of resource packet levels and the upper and lower limit information of the size of a resource packet according to a test demand, creating folder levels according to the number of resource packet levels, and setting the content limitation requirement of each folder level until all folder levels are set; and generating a forward resource packet and a reverse resource packet serving as test data based on the number of the resource packet levels, the upper and lower limit information of the size of the resource packet and the content limitation requirement of each folder level. According to the method and the device, the resource bundle specifications are limited according to the test requirements, so that the forward resource bundle and the reverse resource bundle meeting the test requirements can be automatically generated, compared with manual setting, the workload is reduced, the test data generation time is shortened, the occurrence of resource bundle specification omission is effectively reduced, and the test efficiency is improved. Therefore, the test coverage rate is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data generation, and more particularly to a test data generation method and related devices. Background Art

[0002] Program change refers to the operation of updating the version of the program after it is modified. At this time, you need to upload the updated resource package. Before uploading the resource package, you need to verify the standardization of the resource package to avoid uploading resource packages that do not meet the standards. In order to ensure the accuracy of the resource package verification results, it is necessary to test the system code of the verification resource package. When testing the system code, it is required to design various types of forward resource packages that meet the standards and reverse resource packages that do not meet the standards according to the specific specifications of the resource package, so as to verify whether the system code has correctly verified the resource package specifications.

[0003] For such test scenarios, testers are usually required to manually design forward resource packages and reverse resource packages according to resource package specifications. However, since there are many resource package specifications, when designing a reverse resource package, it is necessary to consider designing a corresponding reverse resource package for each resource package specification. This is not only labor-intensive and time-consuming, but also the manual design method is prone to omissions of resource package specifications, thereby reducing test coverage. Summary of the invention

[0004] In view of this, the present invention discloses a test data generation method and related devices to realize automatic generation of forward resource packages and reverse resource packages that meet the test requirements. Compared with manual settings, it not only reduces the workload and shortens the test data generation time, but also effectively reduces the occurrence of resource package specification omissions, thereby greatly improving the test coverage.

[0005] A test data generation method, comprising:

[0006] Set the resource package level and upper and lower limits of resource package size according to test requirements;

[0007] Create a folder hierarchy according to the number of resource package levels;

[0008] Setting content restriction requirements for each folder level until all folder levels are fully set;

[0009] Based on the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level, a positive resource package and a negative resource package are generated as test data.

[0010] Optionally, the setting of the content restriction requirement for each folder level until all the folder levels are completely set includes:

[0011] When the folder level is the first level, setting the folders that must be included in the first level and the folder naming convention;

[0012] Set the file suffix information that must be included in the first level.

[0013] Optionally, the setting of the content restriction requirement for each folder level until all the folder levels are completely set includes:

[0014] When the folder level is not the first level, setting subfolders that must be contained in each folder in the non-first level and subfolder naming specifications, wherein the non-first level is a level other than the first level;

[0015] The file suffix information that each folder in the non-first level must contain is set.

[0016] Optionally, the setting of the content restriction requirement for each folder level until all the folder levels are completely set includes:

[0017] According to the construction order of each of the folder levels, the content restriction requirements of each of the folder levels are set in turn until a target folder level that does not contain subfolders is set, and it is determined that all the content restriction requirements of all the folder levels have been set.

[0018] Optionally, the generating of the forward resource package and the reverse resource package as test data based on the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirement of each folder level includes:

[0019] The number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level are used as all the specification conditions of the resource package to generate the positive resource package containing all the specification conditions of the resource package.

[0020] Optionally, the generating of the forward resource package and the reverse resource package as test data based on the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirement of each folder level includes:

[0021] The number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level are used as all the standard conditions of the resource package. According to the control variable method, a reverse resource package covering all reverse conditions is generated for each resource package standard condition.

[0022] A test data generating device, comprising:

[0023] An information setting unit, used to set the number of resource package levels and upper and lower limits of resource package size according to test requirements;

[0024] A hierarchy creation unit, used to create a folder hierarchy according to the number of resource package hierarchies;

[0025] A level setting unit, used for setting content restriction requirements for each folder level until all the folder levels are completely set;

[0026] The data generating unit is used to generate a positive resource package and a reverse resource package as test data based on the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirement of each folder level.

[0027] A computer program product includes computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements the test data generating method described above.

[0028] An electronic device comprises at least one processor and a memory connected to the processor, wherein:

[0029] The memory is used to store computer programs;

[0030] The processor is used to execute the computer program so that the electronic device can implement the test data generating method described above.

[0031] A computer storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement the test data generating method described above.

[0032] As can be seen from the above technical solutions, the present invention discloses a test data generation method and related devices, which sets the number of resource package levels and upper and lower limit information of resource package size according to test requirements, creates folder levels according to the number of resource package levels, sets content restriction requirements for each folder level, until all folder levels are set, and generates positive resource packages and reverse resource packages as test data based on the number of resource package levels, upper and lower limit information of resource package size, and content restriction requirements for each folder level. The present invention can automatically generate positive resource packages and reverse resource packages that meet the test requirements by restricting the resource package specifications according to the test requirements. Compared with manual settings, it not only reduces the workload and shortens the test data generation time, but also effectively reduces the occurrence of omissions in resource package specifications, thereby greatly improving the test coverage. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the disclosed drawings without paying creative work.

[0034] Figure 1 A flow chart of a test data generating method disclosed in an embodiment of the present invention;

[0035] Figure 2 A schematic diagram of a first page display interface of a resource package type test data generator disclosed in an embodiment of the present invention;

[0036] Figure 3 A schematic diagram of a second page display interface of a resource package type test data generator disclosed in an embodiment of the present invention;

[0037] Figure 4 A schematic diagram of the structure of a test data generating device disclosed in an embodiment of the present invention;

[0038] Figure 5 The present invention is a schematic diagram of the structure of an electronic device disclosed in an embodiment of the present invention. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.

[0040] The embodiment of the present invention discloses a test data generation method and related devices to realize automatic generation of forward resource packages and reverse resource packages that meet test requirements. Compared with manual settings, it not only reduces the workload and shortens the test data generation time, but also effectively reduces the occurrence of resource package specification omissions, thereby greatly improving the test coverage.

[0041] See also Figure 1 , a flow chart of a test data generating method disclosed in an embodiment of the present invention, the method comprising:

[0042] Step S101: Set the resource package level number and upper and lower limits of the resource package size according to test requirements.

[0043] The number of resource package levels and the upper and lower limits of the resource package size are determined based on the test data required during the program change function test.

[0044] For example, the number of resource package levels is 2, and the upper and lower limit information of the resource package size is: the resource package size needs to be less than or equal to 5MB.

[0045] Step S102: Create a folder hierarchy according to the number of resource package levels.

[0046] The folder level refers to the hierarchical relationship of the folders in the storage structure. In this application, the number of folder levels is the same as the number of resource package levels. For example, if the number of resource package levels is 2, the corresponding folder level is also 2.

[0047] Step S103: Setting content restriction requirements for each folder level until all the folder levels are completely set.

[0048] In actual applications, content restriction requirements can be set for each folder level in the order of building the folder levels from low to high. Content restriction requirements include but are not limited to the folders contained in each folder level, folder naming specifications and folder sizes, and file suffixes that must be included.

[0049] Step S104: Generate a positive resource package and a negative resource package as test data based on the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level.

[0050] Among them, a positive resource package refers to a resource package that meets all the specification conditions of the resource package. In this application, all the specification conditions of the resource package include: the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level.

[0051] A reverse resource package refers to a resource package that has only one resource package specification condition that is not met, while all other resource package specification conditions are met.

[0052] In summary, the present invention discloses a test data generation method, which sets the number of resource package levels and upper and lower limit information of resource package size according to test requirements, creates a folder level according to the number of resource package levels, sets content restriction requirements for each folder level, until all folder levels are fully set, and generates positive resource packages and reverse resource packages as test data based on the number of resource package levels, upper and lower limit information of resource package size, and content restriction requirements for each folder level. The present invention can automatically generate positive resource packages and reverse resource packages that meet the test requirements by restricting the resource package specifications according to the test requirements. Compared with manual settings, it not only reduces the workload and shortens the test data generation time, but also effectively reduces the occurrence of omissions in resource package specifications, thereby greatly improving the test coverage.

[0053] In one embodiment, step S103 may specifically include:

[0054] When the folder level is the first level, setting the folders that must be included in the first level and the folder naming convention;

[0055] Set the file suffix information that must be included in the first level.

[0056] The folders that must be included in the first level are determined according to actual test requirements. For example, the folders that must be included in the first level may be: "app", "deploy", and "rollback".

[0057] The file suffix information that must be included in the first level is also determined according to actual test requirements. For example, the file suffix information that must be included in the first level is stg. Of course, the file suffix information that must be included in the first level may not be included, which is determined by specific actual needs.

[0058] In one embodiment, step S103 may specifically include:

[0059] When the folder level is not the first level, setting subfolders that must be contained in each folder in the non-first level and subfolder naming specifications, wherein the non-first level is a level other than the first level;

[0060] The file suffix information that each folder in the non-first level must contain is set.

[0061] In the present application, when the folder level is a level other than the first level, that is, a non-first level, what is set are the subfolders that each folder in the non-first level must contain and the subfolder naming convention.

[0062] The subfolders that each folder in the non-first level must contain and the file suffix information that each folder in the non-first level must contain are determined according to actual test requirements. Of course, each folder in the non-first level may also have no subfolders and / or file suffix information, and the present invention is not limited thereto.

[0063] In one embodiment, step S103 may specifically include:

[0064] According to the construction order of each of the folder levels, the content restriction requirements of each of the folder levels are set in turn until a target folder level that does not contain subfolders is set, and it is determined that all the content restriction requirements of all the folder levels have been set.

[0065] For example, after setting the content restriction requirements for the first level, when you need to set the content restriction requirements for the second level, the process is as follows:

[0066] Determine whether the second level contains subfolders;

[0067] If the second level does not contain subfolders, the second level is used as the target folder level, and no content restriction requirements are set for the target folder level. At this time, it is determined that all content restriction requirements for all folder levels have been set, and the subsequent forward resource package and reverse resource package generation process is executed;

[0068] If the second level contains subfolders, set content restriction requirements for the second level, and after the setting is completed, determine whether the third level contains subfolders;

[0069] If the third level does not contain any subfolders, the third level is used as the target folder level, and no content restriction requirements are set for the target folder level. At this time, it is determined that all content restriction requirements for all folder levels have been set, and the subsequent forward resource package and reverse resource package generation process is executed;

[0070] If the third level contains subfolders, set content restriction requirements for the third level. After the setting is completed, continue to determine whether the fourth level contains subfolders. Repeat this process until the target folder level that does not contain subfolders is reached. Ensure that the content restriction requirements for all folder levels are set, and execute the subsequent forward resource package and reverse resource package generation process.

[0071] To facilitate understanding of the test data generation process, the present invention is described below using the test data required in the program change function test process as an example.

[0072] The program change resource package has the following requirements:

[0073] The resource pack level is 2.

[0074] The resource pack size needs to be less than 5MB.

[0075] Create two folder levels according to the number of resource pack levels, namely level 1 and level 2.

[0076] In level 1, the resource package contains the required app folder, deploy folder, and rollback folder.

[0077] The deploy folder and rollback folder must contain files with the same name and the suffix .stg.

[0078] The present invention designs a resource package type test data generator for the test data generation process.

[0079] See also Figure 2, a schematic diagram of the first page display interface of the resource package type test data generator provided in an embodiment of the present invention, wherein there are input boxes for "number of resource package levels" and "upper and lower limits of resource package size" on the first page, and "2" is entered in "number of levels"; "5" is entered in "upper limit of resource package size"; and "0" is entered in "lower limit of resource package size".

[0080] There is an information input box for Level 1 on the first page. You need to enter the content restriction requirements for Level 1, including the required folders and file suffix information in the level. The folder naming convention limits the input of folder names. If the entered folder name does not comply with the folder naming convention, the folder name will display an input error prompt message, or the folder name input will fail.

[0081] If there are multiple folders and / or file suffixes, you can touch "+" to add them. If there is no file suffix, you can fill in "None". In this embodiment, according to the test requirements, three folders "app", "deploy", and "rollback" are added to the "Folders that must be included" column; and "None" is entered in the "File suffixes that must be included".

[0082] After completing the information on the first page, proceed to the second page. Figure 3 , a schematic diagram of the second page display interface of the resource package type test data generator provided in an embodiment of the present invention, in which the system program of the resource package type test data generator automatically generates an information entry module for the folder according to the folder name information input on the first page, each information entry module contains subfolders that the folder must contain and file suffix information that each folder must contain, wherein the folder naming specification restricts the input of the folder name, if the input folder name does not comply with the folder naming specification, the folder name will display a prompt message indicating that the input is incorrect, or the folder name is not successfully input.

[0083] This embodiment includes: an app information entry module, a deploy information entry module and a rollback information entry module.

[0084] For example, in the app information entry module, the columns "Folders that must be included" and "File suffixes that must be included" in the app folder are both "None".

[0085] In the deploy information entry module, enter "None" in the "Folders that must be included" column in the deploy folder and "stg" in the "File suffixes that must be included" column.

[0086] In the rollback information entry module, enter "None" in the "Folders that must be included" column of the rollback folder and "stg" in the "File suffixes that must be included" column.

[0087] It should be noted that, in actual applications, the system program automatically executes subsequent steps based on information such as the number of resource package levels set on the first page. This embodiment only includes two levels, so the system program automatically completes all required operations on the second page. At the bottom of the second page, there are three operation buttons: "Previous Step", "Generate Forward Resource Package", and "Generate Reverse Resource Package", which are convenient for executing subsequent operations according to user instructions.

[0088] In one embodiment, step S104 may specifically include:

[0089] The number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level are used as all the specification conditions of the resource package to generate the positive resource package containing all the specification conditions of the resource package.

[0090] It should be noted that the positive resource package in this application refers to a resource package that meets all the specification conditions of all resource packages in the test requirements.

[0091] In one embodiment, step S104 may further include:

[0092] The number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level are used as all the standard conditions of the resource package. According to the control variable method, a reverse resource package covering all reverse conditions is generated for each resource package standard condition.

[0093] Among them, the controlled variable method is a testing method, which means that only the element being tested is changed during the test process, while keeping other elements unchanged.

[0094] The present application adopts a control variable method, and generates a corresponding reverse resource package for the reverse condition of a resource package specification condition each time, thereby generating a reverse resource package covering all reverse conditions.

[0095] Corresponding to the above method embodiment, the present invention also discloses a test data generating device.

[0096] See also Figure 4 , a schematic diagram of the structure of a test data generating device disclosed in an embodiment of the present invention, the device may include:

[0097] The information setting unit 201 is used to set the resource package level number and the upper and lower limit information of the resource package size according to the test requirements.

[0098] The number of resource package levels and the upper and lower limits of the resource package size are determined based on the test data required during the program change function test.

[0099] For example, the number of resource package levels is 2, and the upper and lower limit information of the resource package size is: the resource package size needs to be less than or equal to 5MB.

[0100] The hierarchy creation unit 202 is used to create a folder hierarchy according to the number of resource package hierarchies.

[0101] The folder level refers to the hierarchical relationship of the folders in the storage structure. In this application, the number of folder levels is the same as the number of resource package levels. For example, if the number of resource package levels is 2, the corresponding folder level is also 2.

[0102] The level setting unit 203 is used to set the content restriction requirements of each folder level until all the folder levels are completely set.

[0103] In actual applications, content restriction requirements can be set for each folder level in the order of building the folder levels from low to high. Content restriction requirements include but are not limited to the folders contained in each folder level, folder naming specifications and folder sizes, and file suffixes that must be included.

[0104] The data generating unit 204 is configured to generate a positive resource package and a negative resource package as test data based on the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirement of each folder level.

[0105] Among them, a positive resource package refers to a resource package that meets all the specification conditions of the resource package. In this application, all the specification conditions of the resource package include: the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level.

[0106] A reverse resource package refers to a resource package that has only one resource package specification condition that is not met, while all other resource package specification conditions are met.

[0107] In summary, the present invention discloses a test data generation device, which sets the number of resource package levels and upper and lower limit information of resource package size according to test requirements, creates folder levels according to the number of resource package levels, sets content restriction requirements for each folder level, until all folder levels are set, and generates positive resource packages and negative resource packages as test data based on the number of resource package levels, upper and lower limit information of resource package size, and content restriction requirements for each folder level. The present invention can automatically generate positive resource packages and negative resource packages that meet the test requirements by restricting the resource package specifications according to the test requirements. Compared with manual settings, it not only reduces the workload and shortens the test data generation time, but also effectively reduces the occurrence of omissions in resource package specifications, thereby greatly improving the test coverage.

[0108] In one embodiment, the level setting unit 203 may be specifically used to:

[0109] When the folder level is the first level, setting the folders that must be included in the first level and the folder naming convention;

[0110] Set the file suffix information that must be included in the first level.

[0111] The folders that must be included in the first level are determined according to actual test requirements. For example, the folders that must be included in the first level may be: "app", "deploy", and "rollback".

[0112] The file suffix information that must be included in the first level is also determined according to actual test requirements. For example, the file suffix information that must be included in the first level is stg. Of course, the file suffix information that must be included in the first level may not be included, which is determined by specific actual needs.

[0113] In one embodiment, the level setting unit 203 may be specifically used to:

[0114] When the folder level is not the first level, setting subfolders that must be contained in each folder in the non-first level and subfolder naming specifications, wherein the non-first level is a level other than the first level;

[0115] The file suffix information that each folder in the non-first level must contain is set.

[0116] In the present application, when the folder level is a level other than the first level, that is, a non-first level, what is set are the subfolders that each folder in the non-first level must contain and the subfolder naming convention.

[0117] The subfolders that each folder in the non-first level must contain and the file suffix information that each folder in the non-first level must contain are determined according to actual test requirements. Of course, each folder in the non-first level may also have no subfolders and / or file suffix information, and the present invention is not limited thereto.

[0118] In one embodiment, the level setting unit 203 may be specifically used to:

[0119] According to the construction order of each of the folder levels, the content restriction requirements of each of the folder levels are set in turn until a target folder level that does not contain subfolders is set, and it is determined that all the content restriction requirements of all the folder levels have been set.

[0120] For example, after setting the content restriction requirements for the first level, when you need to set the content restriction requirements for the second level, the process is as follows:

[0121] Determine whether the second level contains subfolders;

[0122] If the second level does not contain subfolders, the second level is used as the target folder level, and no content restriction requirements are set for the target folder level. At this time, it is determined that all content restriction requirements for all folder levels have been set, and the subsequent forward resource package and reverse resource package generation process is executed;

[0123] If the second level contains subfolders, set content restriction requirements for the second level, and after the setting is completed, determine whether the third level contains subfolders;

[0124] If the third level does not contain any subfolders, the third level is used as the target folder level, and no content restriction requirements are set for the target folder level. At this time, it is determined that all content restriction requirements for all folder levels have been set, and the subsequent forward resource package and reverse resource package generation process is executed;

[0125] If the third level contains subfolders, set content restriction requirements for the third level. After the setting is completed, continue to determine whether the fourth level contains subfolders. Repeat this process until the target folder level that does not contain subfolders is reached. Ensure that the content restriction requirements for all folder levels are set, and execute the subsequent forward resource package and reverse resource package generation process.

[0126] In one embodiment, the data generating unit 204 may be specifically used to:

[0127] The number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level are used as all the specification conditions of the resource package to generate the positive resource package containing all the specification conditions of the resource package.

[0128] It should be noted that the positive resource package in this application refers to a resource package that meets all the specification conditions of all resource packages in the test requirements.

[0129] In one embodiment, the data generating unit 204 may be specifically used to:

[0130] The number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level are used as all the standard conditions of the resource package. According to the control variable method, a reverse resource package covering all reverse conditions is generated for each resource package standard condition.

[0131] Among them, the controlled variable method is a testing method, which means that only the element being tested is changed during the test process, while keeping other elements unchanged.

[0132] The present application adopts a control variable method, and generates a corresponding reverse resource package for the reverse condition of a resource package specification condition each time, thereby generating a reverse resource package covering all reverse conditions.

[0133] Corresponding to the above embodiment, an electronic device is also provided in the embodiment of the present application. Figure 5 As shown, it shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present application. The electronic device in the embodiments of the present application may include but is not limited to fixed terminals such as mobile phones, laptops, PDAs (Personal Digital Assistants), PADs (Portable Application Devices), desktop computers, etc. Figure 5 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0134] like Figure 5 As shown, the electronic device may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 301, which can perform various appropriate actions and processes according to the program stored in the ROM 302 or the program loaded from the storage device 308 to the RAM 303. When the electronic device is powered on, the RAM 303 also stores various programs and data required for the operation of the electronic device. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.

[0135] Typically, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a memory card, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although Figure 5 An electronic device having various devices is shown, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0136] An embodiment of the present application also provides a computer program product including computer-readable instructions. When the computer-readable instructions are executed on an electronic device, the electronic device implements any test data generation method provided in the embodiment of the present application.

[0137] A computer-readable storage medium is also provided in an embodiment of the present application. The storage medium carries one or more computer programs. When the one or more computer programs are executed by an electronic device, the electronic device can implement any test data generation method provided in the embodiment of the present application.

[0138] It should also be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the drawings of the device embodiments provided by the present application, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines.

[0139] Through the description of the above implementation mode, the technicians in the field can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course, it can also be implemented by special hardware including special integrated circuits, special CPUs, special memories, special components, etc. In general, all functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be various, such as analog circuits, digital circuits or special circuits. However, for the present application, software program implementation is a better implementation mode in more cases. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer floppy disk, a U disk, a mobile hard disk, a ROM, a RAM, a disk or an optical disk, etc., including a number of instructions to enable a computer device (which can be a personal computer, a training device, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0140] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.

[0141] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website, computer, training equipment, or data center to another website, computer, training equipment, or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device, data center, etc. that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD (Digital Versatile Disc, Digital Versatile Disc)), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0142] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0143] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.

[0144] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A test data generation method, characterized in that: include: Set the resource package level and upper and lower limits of resource package size according to test requirements; Create a folder hierarchy according to the number of resource package levels; Setting content restriction requirements for each folder level until all folder levels are fully set; Based on the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level, a positive resource package and a negative resource package are generated as test data.

2. The test data generation method according to claim 1, characterized in that: The step of setting the content restriction requirements for each folder level until all the folder levels are fully set includes: When the folder level is the first level, setting the folders that must be included in the first level and the folder naming convention; Set the file suffix information that must be included in the first level.

3. The test data generating method according to claim 1 or 2, characterized in that: The step of setting the content restriction requirements for each folder level until all the folder levels are fully set includes: When the folder level is not the first level, setting subfolders that must be contained in each folder in the non-first level and subfolder naming specifications, wherein the non-first level is a level other than the first level; The file suffix information that each folder in the non-first level must contain is set.

4. The test data generating method according to claim 1 or 3, characterized in that: The step of setting the content restriction requirements for each folder level until all the folder levels are fully set includes: According to the construction order of each of the folder levels, the content restriction requirements of each of the folder levels are set in turn until a target folder level that does not contain subfolders is set, and it is determined that all the content restriction requirements of all the folder levels have been set.

5. The test data generating method according to claim 1, characterized in that: The generating of the positive resource package and the negative resource package as test data based on the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level includes: The number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level are used as all the specification conditions of the resource package to generate the positive resource package containing all the specification conditions of the resource package.

6. The test data generating method according to claim 1 or 5, characterized in that: The generating of the positive resource package and the negative resource package as test data based on the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level includes: The number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirements of each folder level are used as all the standard conditions of the resource package. According to the control variable method, a reverse resource package covering all reverse conditions is generated for each resource package standard condition.

7. A test data generating device, characterized in that: include: An information setting unit, used to set the number of resource package levels and upper and lower limits of resource package size according to test requirements; A hierarchy creation unit, used to create a folder hierarchy according to the number of resource package hierarchies; A level setting unit, used for setting content restriction requirements for each folder level until all the folder levels are fully set; The data generating unit is used to generate a positive resource package and a reverse resource package as test data based on the number of resource package levels, the upper and lower limit information of the resource package size, and the content restriction requirement of each folder level.

8. A computer program product, characterized in that The method comprises computer-readable instructions, and when the computer-readable instructions are executed on an electronic device, the electronic device implements the test data generating method according to any one of claims 1 to 6.

9. An electronic device, characterized in that: The method comprises at least one processor and a memory connected to the processor, wherein: The memory is used to store computer programs; The processor is used to execute the computer program so that the electronic device can implement the test data generating method according to any one of claims 1 to 6.

10. A computer storage medium, characterized in that: The storage medium carries one or more computer programs, and when the one or more computer programs are executed by an electronic device, the electronic device can implement the test data generating method as described in any one of claims 1 to 6.