A method and device for generating test data

By generating new test data using a large language model, the problem of lack of randomness in manually written test data is solved, enabling more efficient and flexible software testing.

CN117827638BActive Publication Date: 2024-11-08THE PEOPLES BANK OF CHINA DIGITAL CURRENCY INST +1
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202311530082.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-16
Publication Date
2024-11-08
Estimated Expiration
2043-11-16

AI Technical Summary

Technical Problem

In existing technologies, manually written test data or scripts are influenced by the writer's knowledge background and writing habits, resulting in a lack of randomness in the test data, making it difficult to discover most problems in the software, and leading to low testing efficiency and high costs.

Method used

By receiving test results, we identify relevant test data and generate new test data using a large language model. We then combine data construction strategies and keyword tagging to adjust the data to meet specifications and generate test data with higher randomness.

Benefits of technology

It improves the randomness and efficiency of test data, reduces labor costs, enables more accurate identification of software problems, and enhances the flexibility and scalability of software testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117827638B_ABST
    Figure CN117827638B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for generating test data, and relates to the field of artificial intelligence technology. A specific implementation of the method for generating test data includes: in response to receiving a test result, determining test data associated with the problem included in the test result; determining a data construction strategy for the test data; inputting the test data and the data construction strategy into a pre-set large language model, and generating new test data using the large language model after the input is completed. This implementation generates new test data based on the test data and data construction strategy related to the problem in the test result, which can improve the randomness of the test data, is conducive to testing more problems, improving software testing efficiency, and reducing labor costs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method and device for generating test data. Background Art

[0002] Before software testing, test data needs to be prepared. The quality of test data often determines the effect of software testing. For example, test data with large data volume, rich data formats, and random data value ranges can help users find as many problems as possible and achieve better test results. When preparing test data, test data is usually written directly by humans, or test data is generated in batches according to manually written generation scripts.

[0003] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems:

[0004] Manually written test data or scripts are usually affected by the writer's knowledge background and writing habits, resulting in a lack of randomness in the test data. They can only test some problems in the software, and the software testing efficiency is low. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for generating test data, which can improve the randomness of the test data, help test more problems, and improve software testing efficiency.

[0006] To achieve the above object, according to a first aspect of an embodiment of the present invention, a method for generating test data is provided, comprising:

[0007] In response to receiving a test result, determining test data associated with a question included in the test result;

[0008] Determining a data construction strategy for the test data;

[0009] The test data and the data construction strategy are input into a preset large language model, and new test data is generated using the inputted large language model.

[0010] Optionally, determining the data construction strategy of the test data includes: screening out a target data construction strategy matching the test data from a preset data construction strategy set;

[0011] Before inputting the test data and the data construction strategy into a preset large language model, the method further includes: receiving a custom data construction strategy, and using the custom data construction strategy and the target data construction strategy as data construction strategies input into the large language model.

[0012] Optionally, before inputting the test data and the data construction strategy into a preset large language model, the method further comprises: identifying keywords included in the custom data construction strategy and the target data construction strategy, and marking the keywords;

[0013] Inputting the test data and the data construction strategy into a preset large language model includes: inputting the test data and a custom data construction strategy including marked keywords and a target data construction strategy into the large language model.

[0014] Optionally, the method further comprises:

[0015] In response to receiving the supplementary description, determining a target keyword matching the supplementary description from the keywords, and associating the supplementary description with the target keyword;

[0016] A supplementary description associated with the target keyword is input into the large language model.

[0017] Optionally, the method further comprises:

[0018] Determining whether the new test data meets the preset data specification;

[0019] In the case that the new test data does not conform to the data specification, in response to receiving the new data construction strategy, the new test data is adjusted according to the new data construction strategy so that the adjusted new test data conforms to the data specification.

[0020] Optionally, before receiving the test result, the method further includes:

[0021] In response to receiving the sample data, determining a data construction strategy for the sample data, inputting the sample data and the data construction strategy for the sample data into the large language model, and generating initial test data using the large language model;

[0022] The system to be tested is tested using the initial test data to obtain the test result.

[0023] Optionally, before inputting the test data and the data construction strategy into the preset large language model, the method further includes: in response to receiving the training data, classifying the training data according to the business field to which the training data belongs; using the classified multiple groups of training data to fine-tune the preset general large model respectively to obtain multiple large language models applied to different business fields; determining a target large language model from the multiple large language models according to the business field to which the test data belongs;

[0024] Inputting the test data and the data construction strategy into a preset large language model includes: inputting the test data and the data construction strategy into the target large language model.

[0025] According to a second aspect of an embodiment of the present invention, there is provided a device for generating test data, comprising:

[0026] A first determination module, configured to determine, in response to receiving a test result, test data associated with a question included in the test result;

[0027] A second determination module, used to determine a data construction strategy for the test data;

[0028] A generation module is used to input the test data and the data construction strategy into a preset large language model, and use the inputted large language model to generate new test data.

[0029] Optionally, determining the data construction strategy of the test data includes: screening out a target data construction strategy matching the test data from a preset data construction strategy set;

[0030] The device further comprises: a receiving module, configured to receive a custom data construction strategy, and use the custom data construction strategy and the target data construction strategy as data construction strategies input into the large language model.

[0031] Optionally, the device further comprises: a marking module, configured to identify keywords included in the custom data construction strategy and the target data construction strategy, and mark the keywords;

[0032] Inputting the test data and the data construction strategy into a preset large language model includes: inputting the test data and a custom data construction strategy including marked keywords and a target data construction strategy into the large language model.

[0033] Optionally, the device further comprises:

[0034] an associating module, configured to, in response to receiving the supplementary description, determine a target keyword matching the supplementary description from the keywords, and associate the supplementary description with the target keyword;

[0035] An input module is used to input the supplementary description associated with the target keyword into the large language model.

[0036] Optionally, the device further comprises:

[0037] A determination module, used to determine whether the new test data conforms to a preset data specification;

[0038] The adjustment module is used for adjusting the new test data according to the new data construction strategy in response to receiving the new data construction strategy when the new test data does not conform to the data specification, so that the adjusted new test data conforms to the data specification.

[0039] Optionally, the device further comprises:

[0040] an initial data generating module, configured to, in response to receiving sample data, determine a data construction strategy for the sample data, input the sample data and the data construction strategy for the sample data into the large language model, and generate initial test data using the large language model;

[0041] The testing module is used to test the system to be tested using the initial testing data to obtain the testing result.

[0042] Optionally, the device further comprises: a classification module, for classifying the training data according to the business field to which the training data belongs in response to receiving the training data; a fine-tuning module, for fine-tuning the pre-set general large model respectively using the classified multiple groups of training data to obtain multiple large language models applied to different business fields; a screening module, for determining a target large language model from the multiple large language models according to the business field to which the test data belongs;

[0043] Inputting the test data and the data construction strategy into a preset large language model includes: inputting the test data and the data construction strategy into the target large language model.

[0044] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, including:

[0045] one or more processors;

[0046] a storage device for storing one or more programs,

[0047] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any one of the above embodiments.

[0048] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method described in any one of the above embodiments is implemented.

[0049] An embodiment of the above invention has the following advantages or beneficial effects: generating new test data according to the test data and data construction strategy related to the problems in the test results can improve the randomness of the test data, which is conducive to testing more problems, improving software testing efficiency, and reducing labor costs; receiving a custom data construction strategy, inputting the custom data construction strategy and the target data construction strategy screened from the data construction strategy set into the large language model, and being able to more flexibly determine the data construction strategy; identifying keywords in the data construction strategy, marking the keywords, and enabling the large language model to more accurately segment the data construction strategy and more accurately understand the data construction strategy, thereby avoiding the large speech model from splitting the keywords; receiving supplementary descriptions of the keywords, associating the supplementary descriptions with the keywords, and marking the supplementary descriptions Inputting a large language model can enable the large language model to understand the meaning of keywords more accurately, and then generate new test data more accurately according to the data construction strategy; when the new test data does not meet the data specifications, the new test data can be adjusted according to the new data construction strategy, which can generate new test data more flexibly and reduce labor costs; initial test data is generated according to the data construction strategy of the sample data, test results are generated according to the initial test data, and the test data is used to generate new test data, which can obtain more reliable and effective new test data and improve software testing efficiency; the general large model is fine-tuned using training data from different business fields to obtain multiple large language models, and the target large language model is determined according to the business field of the test data, which can enable the target large language model to output more reliable and effective test data.

[0050] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0052] Figure 1 is a schematic diagram of the main process of the method for generating test data according to an embodiment of the present invention;

[0053] Figure 2 is a schematic diagram of the overall process of a method for generating test data according to a reference embodiment of the present invention;

[0054] Figure 3 is a flow chart of a method for generating test data according to a reference embodiment of the present invention;

[0055] Figure 4 is a schematic diagram of the main process of a method for generating test data according to a reference embodiment of the present invention;

[0056] Figure 5is a schematic diagram of the main process of a method for generating test data according to another reference embodiment of the present invention;

[0057] Figure 6 is a schematic diagram of the main process of a method for generating test data according to yet another reference embodiment of the present invention;

[0058] Figure 7 is a schematic diagram of main modules of a device for generating test data according to an embodiment of the present invention;

[0059] Figure 8 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0060] Fig. 9 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0061] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0062] It should be noted that in the technical solution of the present invention, the collection, use, storage, sharing and transfer of user personal information involved are in compliance with the provisions of relevant laws and regulations, and it is necessary to inform the user and obtain the user's consent or authorization. When applicable, the user's personal information is de-identified and / or anonymized and / or encrypted.

[0063] Before software testing, test data needs to be prepared. The quality of test data often determines the effect of software testing. For example, test data with large data volume, rich data formats, and random data value ranges can help users find as many problems as possible and achieve better test results. When preparing test data, test data is usually written directly by humans, or test data is generated in batches according to manually written generation scripts.

[0064] Manually written test data or scripts are usually affected by the writer's knowledge background and writing habits, resulting in a lack of randomness in the test data. Often, they can only detect a certain type of problem, making it difficult to test more problems in the software, and resulting in low software testing efficiency. At the same time, manually writing test data or scripts consumes a lot of manpower costs, is prone to writing errors, and reduces the efficiency of test data generation. When test requirements change, new test data or scripts need to be rewritten, making the R&D and maintenance costs of software testing high, and lacking flexibility and scalability.

[0065] In view of this, according to a first aspect of an embodiment of the present invention, a method for generating test data is provided.

[0066] Figure 1 FIG. 1 is a schematic diagram of the main process of the method for generating test data according to an embodiment of the present invention. Figure 1 As shown, the method for generating test data according to an embodiment of the present invention mainly includes the following steps S101 to S103.

[0067] Step S101 : in response to receiving a test result, determining test data associated with a question included in the test result.

[0068] The test result is the test result of the software or system. Specifically, the software or system is tested using a pre-set test data set to determine whether there is a problem with the software or system. The test data set is a collection of stored test data. For example, the test data set includes product query conditions. The product query conditions are input into the e-commerce software to determine whether all the queried products meet the product query conditions. For another example, the test data set includes delayed read and write scripts. The delayed read and write scripts are input into the storage system to determine whether the storage system can correctly run the delayed read and write scripts and delay data reading or data writing operations after receiving data read and write requests.

[0069] The test data in the test data set is input into the software or system, and the software or system processes the test data and outputs the corresponding test results, and the input test data and the output test results have an associated relationship. The test results include: test results that run normally and test results with problems. The execution subject of the embodiment of the present invention selects the test results with problems from all the test results, and determines the test data associated with the test results with problems according to the associated relationship between the output test results and the input test data.

[0070] Exemplarily, the execution subject of the embodiment of the present invention inputs pre-set test data A1, test data A2, and test data A3 into the software, and obtains test results B1, test result B2, and test result B3, respectively, wherein test result B1 is "memory overflow when the software processes test data A1", test result B2 is "the software runs normally", and test result B3 is "the software deadlocks when processing test data A3"; it can be seen from the above test results that test result B1 and test result B3 are test results with problems, and test result B2 is a test result that runs normally; therefore, the test data associated with the test results with problems is determined to include: test data A1 and test data A3.

[0071] Based on the correlation between test results and test data, the test data associated with the problematic test results can be quickly and accurately determined, which can provide a data basis for generating new data; the determined test data is test data that can detect problems, so generating new test data based on these test data can improve the problem hit rate of the new test data, enable the new test data to detect more problems, and facilitate improving test efficiency.

[0072] Step S102, determining a data construction strategy for the test data.

[0073] The data construction strategy is a strategy for generating new test data using the test data determined by step S101 (i.e., the test data associated with the problematic test results). The data construction strategy causes differences between the new test data and the test data. For example, the new test data and the test data have different numerical values, different numerical ranges, different data structures, different data types, different included data fields, etc.

[0074] After determining the test data, the execution subject of the embodiment of the present invention determines the data construction strategy of the test data. Exemplarily, multiple data construction strategies are pre-set, including: increasing or decreasing the value of the test data, expanding or reducing the value range of the test data, converting the integer data in the test data into the data of the string type, converting the test data encapsulated by the array into the test data encapsulated by the linked list, adding or deleting the data field in the test data, etc.; pre-setting the matching relationship between the data construction strategy and the data type and the data structure, each data type and each data structure matches one or more data construction strategies; determining the target data type and target data structure of the test data, and determining the data construction strategy matching the target data type and the target data structure in the pre-set multiple data construction strategies according to the above matching relationship; specifically, when the target data type is an integer or a floating point type, determining the data construction strategy of the test data includes: increasing or decreasing the value of the test data, expanding or reducing the value range of the test data, etc.; when the target data structure is a linked list, determining the data construction strategy of the test data includes: converting the test data encapsulated by the linked list into the test data encapsulated by the mapping table, converting the test data encapsulated by the linked list into the test data encapsulated by the array, etc.

[0075] It should be noted that the data construction strategy is configurable, and the execution subject of the embodiment of the present invention adds a new data construction strategy, deletes or modifies the stored data construction strategy according to the strategy modification request. The matching relationship between the data construction strategy and the data type and data structure is configurable, and the execution subject of the embodiment of the present invention adds a new matching relationship, deletes or modifies the stored matching relationship according to the matching relationship modification request.

[0076] Determining the corresponding data construction strategy according to the data type or data structure of the test data can quickly and accurately determine the data construction strategy; the data construction strategy is configurable, and the matching relationship between the data construction strategy and the data type and data structure is configurable, which can meet different new test data generation requirements, facilitate more flexible generation of new test data, and improve the scalability of new test data generation.

[0077] According to a reference embodiment of the present invention, when determining the data construction strategy of the test data, the target data construction strategy that matches the test data is screened out from the pre-set data construction strategy set. The data construction strategy set is a collection of stored data construction strategies. Exemplarily, the data construction strategies included in the data construction set are classified according to business fields. After receiving the test data, the execution subject of the embodiment of the present invention determines the business field to which the test data belongs, and determines the data construction strategy that matches the test data according to the business field; for example, the test data includes the data field "blockchain", indicating that the test data belongs to the blockchain business field, therefore, the data construction strategy classified as "blockchain business field" is screened out from the data construction strategy set; for another example, the test data includes the data field "transport", indicating that the test data belongs to the warehousing and logistics business field, therefore, the data construction strategy classified as "warehousing and logistics business field" is screened out from the data construction strategy set. It should be noted that the matching relationship between the business field and the data construction strategy is configurable.

[0078] Before inputting the test data and the data construction strategy into the preset large language model, the method further includes: receiving a custom data construction strategy. Exemplarily, the user sends a data construction strategy viewing request to the execution subject of the embodiment of the present invention, and the execution subject of the embodiment of the present invention displays the data construction strategy of the test data on the front-end interface for the user to browse; when the user believes that the data construction strategy has test limitations, the user sends the custom data construction strategy to the execution subject of the embodiment of the present invention through the front-end interface or command line tool, and the execution subject of the embodiment of the present invention receives the custom data construction strategy sent by the user, and uses the custom data construction strategy and the target data construction strategy as the data construction strategy for input into the large language model.

[0079] Preferably, before the custom data construction strategy is input into the large language model, the method further includes determining whether the custom data construction strategy meets the preset verification conditions, that is, using the verification conditions to verify the custom data construction strategy, the verification conditions include: the custom data construction strategy meets the preset sentence structure (for example, "subject-verb-object" structure: data field C1 and data field C2 are positively correlated, "subject-verb-object-object" structure: the value range of data field C3 is between value D1 and value D2, "verb-object" structure: the value of data field C4 is fixed to value D3), the length of the custom data construction strategy is less than the preset length threshold, the custom data construction strategy does not have special symbols (for example, wavy lines, currency symbols), etc. If the custom data construction strategy meets the preset verification conditions, the custom construction strategy is input into the large language model; if the custom data construction strategy does not meet the preset verification conditions, a prompt message is sent to the user, indicating that there is a problem with the custom data construction strategy sent by the user, and the user is asked to modify the custom data construction strategy, and if the modified custom data construction strategy meets the verification conditions, the modified custom data construction strategy is input into the large language model. It should be noted that the verification conditions are configurable.

[0080] Receiving a custom data construction strategy and inputting the custom data construction strategy and the target data construction strategy selected from the data construction strategy set into the large language model can more flexibly determine the data construction strategy; verifying the data construction strategy can ensure the correctness of the data construction strategy, avoid inputting data construction strategies that cannot be correctly parsed into the large language model, and ensure the efficiency of generating new test data.

[0081] Step S103: input the test data and the data construction strategy into a preset large language model, and use the inputted large language model to generate new test data.

[0082] After determining the test data and the data construction strategy of the test data corresponding to the test data, the test data and the corresponding data construction strategy are input into a large language model (LLM). The large language model is an artificial intelligence model with data generation capability. The large language model uses the data construction strategy as a prompt word, understands the semantics contained in the data construction strategy, and adjusts the test data according to the semantics contained in the data construction strategy, so that the adjusted test data conforms to the semantics contained in the data construction strategy. The large language model outputs the adjusted test data conforming to the semantics contained in the data construction strategy as new test data, and the execution subject of the embodiment of the present invention receives the new test data output by the large language model.

[0083] Exemplarily, the test data includes: test data E1, test data E2, test data E3 and test data E4; the data construction strategy includes: the test data "E1" and the test data "E2" are positively correlated, increase at the same time or decrease at the same time, the data of the test data "E3" is fixed to "0.8" or "0.9", and the value of the test data "E4" increases and the increasing range is "2 to 3"; the above test data and data construction strategy are input into the large language model to obtain multiple new test data, including: new test data constructed from the test data "E1" and the test data "E2": "E1+1", "E2+2" or "E1-3", "E2-4", new test data constructed from the test data "E3": "0.8" or "0.9", new test data constructed from the test data "E4": "2", "2.1", "2.11", "2.2", etc.

[0084] Using a large language model that has input test data and data construction strategies to generate new test data can improve the randomness of the new test data, avoid the new test data being restricted by knowledge background and writing habits, and improve the fairness of the new test data so that the new test data includes the data range indicated by the data construction strategy. In addition, the large language model generates new test data faster, and the speed of generating new test data does not decrease as the amount of new test data increases, further ensuring the efficiency of generating new test data.

[0085] According to a reference embodiment of the present invention, before the test data and the data construction strategy are input into the preset large language model, the method further includes: identifying the keywords included in the custom data construction strategy and the target data construction strategy. For example, a keyword list is preset, the keyword list is a collection of stored keywords, and the keyword list includes keywords such as "data set", "delay", "synchronization", "backup", etc., and the keyword list is used to match the custom data construction strategy and the target data construction strategy, and the keywords stored in the keyword list are filtered out from the custom data construction strategy and the target data construction strategy. For another example, the user uses a target symbol (for example, double quotes, single quotes, etc.) to mark the keywords of the custom data construction strategy and the keywords of the target data construction strategy, and the execution subject of the embodiment of the present invention traverses the custom data construction strategy and the target data construction strategy, finds the target included therein, and determines the keyword according to the target. After determining the keyword, the execution subject of the embodiment of the present invention marks the keyword, for example, using special characters such as brackets, asterisks, and pound signs to mark the keyword. In the case where the keyword is "data set", the keyword is marked as: (keyword), *keyword*, #keyword#, etc. In the case where the keyword has been marked according to the marking method of the execution subject of the embodiment of the present invention, the keyword is no longer marked.

[0086] After identifying and marking the keywords of the custom data construction strategy and the target data construction strategy, the test data and the custom data construction strategy and the target data construction strategy including the marked keywords are input into the large language model.

[0087] Marking keywords can prompt the large language model to no longer split keywords when performing natural language processing on the data construction strategy, and inform the large language model that these keywords are "Tokens" (data units of language models that cannot be split) that are no longer split; this helps the large language model to quickly and accurately understand keywords and quickly and accurately generate new test data.

[0088] According to another referenceable embodiment of the present invention, the method further includes: receiving a supplementary description, which is an explanation and description of a keyword. For example, when the keyword is "delay", the user sends a supplementary description of "delay" to the execution subject of the embodiment of the present invention through the front-end interface: "The delay in the data construction strategy is the delay in the blockchain network communication scenario". The supplementary description is a provision on the application scenario, scope of application, etc. of the keyword, so that the meaning of the keyword in the data construction strategy is different from the general meaning of the keyword. After receiving the supplementary description, the execution subject of the embodiment of the present invention determines the target keyword matching the supplementary description from the keyword, and associates the supplementary description with the target keyword, for example, adding the supplementary description to the end or beginning of the data construction strategy including the target keyword. For another example, after the supplementary description is input into the large language model, a comparison table of keywords and supplementary descriptions is generated in the language model. When the large language model needs to understand the keywords in the data construction strategy, the comparison table is queried, and the exact meaning of the keyword in the current context is determined according to the supplementary description of the keyword. After associating the target keyword with the supplementary description, the supplementary description associated with the target keyword is input into the large language model.

[0089] Exemplarily, data construction strategy F1 is "delay 100ms for each site access request", and the supplementary description is "the delay in data construction strategy F1 is the delay in the blockchain network communication scenario". The above data construction strategy and supplementary description are associated, that is, the supplementary description is added to the end of the data construction strategy, and the data construction strategy F2 is obtained as "delay 100ms for each site access request, and the delay is the delay in the blockchain network communication scenario".

[0090] Receiving supplementary descriptions of keywords, associating the supplementary descriptions with the keywords, and inputting the supplementary descriptions into the large language model can enable the large language model to more accurately understand the meanings of the keywords, and then more accurately construct strategies based on the understood data and generate new test data.

[0091] According to another embodiment of the present invention, the method further includes: judging whether the new test data meets the preset data specification, the data specification is used to evaluate whether the test data can be used for software testing or system testing, and the data specification is the regulation of the test data in terms of data structure, data type, data length, data volume, etc. For example, the data specification includes: the data volume of the new test data is greater than or equal to 100, the test data is encapsulated using a mapping table, the number of characters included in each test data is less than or equal to 50, etc. In the case where the new test data does not meet the data specification, a prompt message is sent to the user, prompting the user that "the new test data does not meet the data specification and needs to be regenerated", and showing the user which data specifications the new test data violates. After the user modifies the data construction strategy according to the data specification, the new data construction strategy is sent to the execution subject of the embodiment of the present invention, and the execution subject of the embodiment of the present invention inputs the received new data construction strategy into the large language model, uses the large language model to adjust the new test data based on the new data construction strategy, receives the adjusted new test data output by the large language model, and continues to adjust the adjusted new test data when it does not meet the data specification until the new test data meets the data specification. In the case where the new test data meets the data specification, the new test data is applied to software testing or system testing.

[0092] Exemplarily, the number of new test data is 80, which is encapsulated using a linked list and does not conform to a pre-set data specification; a prompt is sent to the user, and the new data construction strategy sent by the user is "generate new test data according to the previous data construction strategy, and the number of new test data is 100, and the new test data is encapsulated using a mapping table"; the execution subject of the embodiment of the present invention inputs the above-mentioned new data construction strategy into the large language model to obtain new test data encapsulated using a mapping table and the number is 100.

[0093] When the new test data does not meet the data specifications, the new test data can be adjusted according to the new data construction strategy, which can generate new test data more flexibly, reduce labor costs, avoid manual adjustment of test data, and improve the efficiency of generating new test data.

[0094] According to another reference embodiment of the present invention, before inputting the test data and the data construction strategy into the preset large language model, the method further includes: receiving training data, which can be an open source training data set on the Internet or a manually compiled training data set. The user sends the training data to the execution subject of the embodiment of the present invention, and the execution subject of the embodiment of the present invention classifies the training data according to the business field to which the training data belongs, and obtains multiple groups of training data. For example, the fields representing the business field included in the training data are read to determine the business field to which the training data belongs, and the training data is classified according to the business field; since each training data can belong to one or more business fields, the same training data can be in one or more groups of training data. Use the classified multiple groups of training data to fine-tune the preset general large model respectively, and obtain multiple large language models applied to different business fields.

[0095] After receiving the test data, determine the business domain to which the test data belongs, for example, read the field representing the business domain included in the test data to determine the business domain to which the test data belongs. According to the business domain to which the test data belongs, determine the target large language model from multiple large language models; input the test data and the corresponding data construction strategy into the target large language model, and use the target large language model to generate new test data according to the test data and the data construction strategy. Exemplarily, the general large model is trained respectively using the training data of the blockchain business field, the warehousing and logistics business field, and the e-commerce business field, to obtain a large language model G1 suitable for blockchain business, a large language model G2 suitable for warehousing and logistics business, and a large language model G3 suitable for e-commerce business. The test data includes the data field "e-business", indicating that the test data belongs to the e-commerce business field. Therefore, the test data and the corresponding data construction strategy are input into the large language model G3, and the large language model G3 is used to output new test data according to the test data and the corresponding data construction strategy.

[0096] The general large model is fine-tuned using training data from different business fields to obtain multiple large language models. The target large language model is determined according to the business field of the test data, which enables the target large language model to output more reliable and effective test data.

[0097] According to a reference embodiment of the present invention, before receiving the test results, the method further includes: receiving sample data, which is a sample of test data. In the case where there is no test data in the early stage of the test phase, the user needs to independently write a sample of test data. The user sends sample data to the execution subject of the embodiment of the present invention, and the execution subject of the embodiment of the present invention receives the sample data, determines the data construction strategy of the sample data according to the business field, data structure, data type and other factors of the sample data, inputs the sample data and the data construction strategy of the sample data into the large language model, and generates initial test data using the large language model. The initial test data is used to test the system to be tested or the software to be tested to obtain the test results. According to the test results, the test data associated with the problem in the test results can be determined, and then according to the method of the embodiment of the present invention, the test data is used to generate new test data, and the system to be tested or the software to be tested is continued to be tested to find problems in the system to be tested or the software to be tested.

[0098] Generating initial test data according to the data construction strategy of sample data, generating test results based on the initial test data, and using the test data to generate new test data can obtain more reliable and effective new test data and improve software testing efficiency.

[0099] Figure 2 FIG. 1 is a schematic diagram of the overall process of a method for generating test data according to a reference embodiment of the present invention. Figure 2 As shown, first, the user writes sample data and sends the sample data to the execution subject of the embodiment of the present invention, and the execution subject of the embodiment of the present invention determines the corresponding data construction strategy 1 according to the sample data. Exemplarily, the sample data is shown in Table 1, specifically including: sample number, data field, field value and sample description.

[0100] Table 1

[0101]

[0102] Exemplarily, the data construction strategy 1 of the sample data is shown in Table 2. The data construction strategy 1 includes two data field strategies, one data volume strategy and one supplementary description.

[0103] Table 2

[0104]

[0105] The above sample data and data construction strategy 1 are input into the test data generation platform. The test data generation platform includes a general large model. The test data generation platform trains the general large model according to the training data of different business fields to obtain multiple large language models such as large language model 1, large language model 2, and large language model 3. When the business field to which the sample data belongs matches the business field to which the large language model 1 is applicable, the sample data and the corresponding data construction strategy 1 are input into the large language model 1, and the large language model 1 outputs the test data. Exemplarily, the output test data is shown in Table 3. Each test data has the same data field and different field values. The field value has a certain degree of randomness and fairness, and is not affected by the user's knowledge background or writing habits.

[0106] Table 3

[0107]

[0108] The test data is input into the system to be tested or the software to be tested, the system or software is tested, and the test result 1 is output, and the test result 1 includes the test result of normal operation and the test result of the feedback problem. For example, the feedback problem includes system crash, stop running, etc. The target test data associated with the feedback problem is queried to determine the data construction strategy 2 of the target test data. Exemplarily, the data construction strategy 2 is shown in Table 4, and the data construction strategy 2 includes two data field strategies and one data volume strategy.

[0109] Table 4

[0110]

[0111] The above target test data and data construction strategy 2 are input into the test data generation platform. When the business domain to which the target test data belongs matches the business domain to which the large language model 2 is applicable, the target test data and the corresponding data construction strategy 2 are input into the large language model 2, and the large language model 2 outputs new test data. The new test data is input into the system to be tested or the software to be tested, and the system or software is tested, and the test result, i.e., test result 2, can be obtained again. The target test data can be further determined according to the feedback problems in the test result 2, and new test data can be further generated according to the above steps. Repeating the above steps can generate test data more randomly, more fairly, and more efficiently, which is conducive to discovering problems in the system or software and improving the efficiency of system testing or software testing. The user only needs to write a small amount of sample data at the beginning of the test phase, and the execution subject of the embodiment of the present invention continuously generates test data, test systems or software according to the sample data, realizes the automated test process, reduces labor costs, and reduces the development cost and maintenance cost of the test process.

[0112] Figure 3FIG. 1 is a flow chart of a method for generating test data according to a reference embodiment of the present invention. Figure 3 As shown, firstly, data construction strategy 1 is determined according to the sample data input by the user, test data 1 is generated according to the sample data and data construction strategy 1, and the system to be tested or the software to be tested is tested using test data 1 to obtain normal test results and test results with problems, and the test data 1 associated with the normal test results is marked as test data 1-success, and the test data 1 associated with the test results with problems is marked as test data 1-error. The corresponding data construction strategy 2 is determined according to test data 1-error, and test data 2 is generated according to test data 1-error and data construction strategy 2. Then, test data 2 is used to test the system to be tested or the software to be tested, and normal test results and test results with problems are obtained. Repeat the above steps, generate new test data according to the test data associated with the test results with problems, and continuously test the system to be tested or the software to be tested until the problems in the system to be tested or the software to be tested cannot be tested out.

[0113] Figure 4 FIG. 1 is a schematic diagram of the main process of a method for generating test data according to a reference embodiment of the present invention. Figure 4 As shown, the method for generating test data may include:

[0114] Step S401, in response to receiving a test result, determining test data associated with a question included in the test result;

[0115] Step S402, selecting a target data construction strategy that matches the test data from a preset data construction strategy set;

[0116] Step S403, receiving a custom data construction strategy, and using the custom data construction strategy and the target data construction strategy as the data construction strategy input into the large language model;

[0117] Step S404, input the test data and the data construction strategy into a preset large language model, and use the inputted large language model to generate new test data;

[0118] Step S405, determine whether the new test data meets the data specification, if so, jump to step S408, otherwise, jump to step S406;

[0119] Step S406, sending a prompt message to the user, indicating the non-compliance of the new test data;

[0120] Step S407, in response to receiving the new data construction strategy, adjusting the new test data according to the new data construction strategy so that the adjusted new test data conforms to the data specification;

[0121] Step S408: Use the new test data to test the system or software.

[0122] The specific implementation content of the method for generating test data of the above-mentioned reference embodiment of the present invention has been described in detail in the above-mentioned method for generating test data, so the repeated content will not be described again here.

[0123] Figure 5 FIG. 1 is a schematic diagram of the main process of a method for generating test data according to another reference embodiment of the present invention. Figure 5 As shown, the method for generating test data may include:

[0124] Step S501, in response to receiving a test result, determining test data associated with a question included in the test result;

[0125] Step S502, determining a data construction strategy for the test data;

[0126] Step S503, identifying keywords included in the data construction strategy and marking the keywords;

[0127] Step S504, in response to receiving the supplementary description, determining a target keyword matching the supplementary description from the keywords, and associating the supplementary description with the target keyword;

[0128] Step S505, input the test data, the data construction strategy including the marked keywords and the supplementary description into a preset large language model;

[0129] Step S506, using the large language model after the input is completed to generate new test data;

[0130] Step S507: Use the new test data to test the system and software.

[0131] The specific implementation content of the test data generation method of another reference embodiment of the present invention has been described in detail in the test data generation method described above, so the repeated content will not be described again here.

[0132] Figure 6 FIG. 1 is a schematic diagram of the main process of a method for generating test data according to another reference embodiment of the present invention. Figure 6 As shown, the method for generating test data may include:

[0133] Step S601, in response to receiving the training data, classifying the training data according to the business field to which the training data belongs;

[0134] Step S602, using the classified multiple sets of training data to fine-tune the pre-set general large model respectively, to obtain multiple large language models applied to different business fields;

[0135] Step S603, in response to receiving the sample data, determining a data construction strategy for the sample data, inputting the sample data and the data construction strategy for the sample data into a corresponding large language model, and generating initial test data using the large language model;

[0136] Step S604, using the initial test data to test the system to be tested, and obtaining the test result;

[0137] Step S605, determining the test data associated with the questions included in the test results;

[0138] Step S606, determining a data construction strategy for test data;

[0139] Step S607, determining a target large language model from a plurality of large language models according to the business domain to which the test data belongs;

[0140] Step S608, input the test data and the data construction strategy into a preset target large language model, and use the target large language model after the input is completed to generate new test data;

[0141] Step S609: Use the new test data to test the system to be tested and obtain the test result.

[0142] The specific implementation content of the method for generating test data of another reference embodiment of the present invention has been described in detail in the above-mentioned method for generating test data, so the repeated content will not be described again here.

[0143] Figure 7 is a schematic diagram of the main modules of the device for generating test data according to an embodiment of the present invention, such as Figure 7 As shown, the test data generating device 700 mainly includes:

[0144] A first determination module 701, configured to determine, in response to receiving a test result, test data associated with a question included in the test result;

[0145] A second determination module 702, used to determine a data construction strategy for the test data;

[0146] The generating module 703 is used to input the test data and the data construction strategy into a preset large language model, and use the inputted large language model to generate new test data.

[0147] According to a reference embodiment of the present invention, determining the data construction strategy of the test data includes: selecting a target data construction strategy matching the test data from a preset data construction strategy set;

[0148] The test data generating device 700 further includes: a receiving module, configured to receive a custom data construction strategy, and use the custom data construction strategy and the target data construction strategy as data construction strategies input into the large language model.

[0149] According to another reference embodiment of the present invention, the test data generating device 700 further includes: a marking module, which is used to identify keywords included in the custom data construction strategy and the target data construction strategy, and mark the keywords;

[0150] Inputting the test data and the data construction strategy into a preset large language model includes: inputting the test data and a custom data construction strategy including marked keywords and a target data construction strategy into the large language model.

[0151] According to another reference embodiment of the present invention, the test data generating device 700 further includes:

[0152] an associating module, configured to, in response to receiving the supplementary description, determine a target keyword matching the supplementary description from the keywords, and associate the supplementary description with the target keyword;

[0153] An input module is used to input the supplementary description associated with the target keyword into the large language model.

[0154] According to another reference embodiment of the present invention, the test data generating device 700 further includes:

[0155] A determination module, used to determine whether the new test data conforms to a preset data specification;

[0156] The adjustment module is used for adjusting the new test data according to the new data construction strategy in response to receiving the new data construction strategy when the new test data does not conform to the data specification, so that the adjusted new test data conforms to the data specification.

[0157] According to another reference embodiment of the present invention, the test data generating device 700 further includes:

[0158] an initial data generating module, configured to, in response to receiving sample data, determine a data construction strategy for the sample data, input the sample data and the data construction strategy for the sample data into the large language model, and generate initial test data using the large language model;

[0159] The testing module is used to test the system to be tested using the initial testing data to obtain the testing result.

[0160] According to a reference embodiment of the present invention, the test data generating device 700 further includes: a classification module, which is used to classify the training data according to the business field to which the training data belongs in response to receiving the training data; a fine-tuning module, which is used to use the classified multiple groups of training data to respectively fine-tune the pre-set general large model to obtain multiple large language models applied to different business fields; a screening module, which is used to determine the target large language model from the multiple large language models according to the business field to which the test data belongs;

[0161] Inputting the test data and the data construction strategy into a preset large language model includes: inputting the test data and the data construction strategy into the target large language model.

[0162] It should be noted that the specific implementation content of the test data generating device in the embodiment of the present invention has been described in detail in the test data generating method described above, so the repeated content will not be described again here.

[0163] According to the technical solution of the embodiment of the present invention, new test data is generated according to the test data and data construction strategy related to the problems in the test results, which can improve the randomness of the test data, help to test more problems, improve software testing efficiency, and reduce labor costs; receive a custom data construction strategy, input the custom data construction strategy and the target data construction strategy screened from the data construction strategy set into the big language model, and more flexibly determine the data construction strategy; identify keywords in the data construction strategy, mark the keywords, and enable the big language model to more accurately segment the data construction strategy and understand the data construction strategy more accurately, thereby avoiding the big voice model from splitting the keywords; receive supplementary instructions for the keywords, associate the supplementary instructions with the keywords, and input the supplementary instructions into the big language model The model can enable the large language model to understand the meaning of keywords more accurately, and then generate new test data more accurately according to the data construction strategy; when the new test data does not meet the data specifications, the new test data is adjusted according to the new data construction strategy, which can generate new test data more flexibly and reduce labor costs; the initial test data is generated according to the data construction strategy of the sample data, the test results are generated according to the initial test data, and the test data is used to generate new test data, which can obtain more reliable and effective new test data and improve software testing efficiency; the general large model is fine-tuned using training data from different business fields to obtain multiple large language models, and the target large language model is determined according to the business field of the test data, which can enable the target large language model to output more reliable and effective test data.

[0164] According to a third aspect of an embodiment of the present invention, there is provided an electronic device, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the method provided by the first aspect of the embodiment of the present invention.

[0165] According to a fourth aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method provided by the first aspect of the embodiment of the present invention is implemented.

[0166] Figure 8 An exemplary system architecture 800 is shown to which the method for generating test data or the apparatus for generating test data according to the embodiment of the present invention can be applied.

[0167] like Figure 8 As shown, system architecture 800 may include terminal devices 801, 802, 803, a network 804, and a server 805. Network 804 is used to provide a medium for communication links between terminal devices 801, 802, 803 and server 805. Network 804 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0168] The user can use the terminal devices 801, 802, 803 to interact with the server 805 through the network 804 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 801, 802, 803, such as data testing applications, system testing applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0169] The terminal devices 801 , 802 , and 803 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0170] The server 805 may be a server that provides various services, such as a background management server (for example only) that supports the generation request of test data sent by the upstream terminal devices 801, 802, and 803. In response to receiving the test result, the background management server may determine the test data associated with the question included in the test result; determine the data construction strategy of the test data; input the test data and the data construction strategy into a preset large language model, and generate new test data using the large language model after the input is completed; and feedback the generation status of the test data (for example only) to the terminal device.

[0171] It should be noted that the test data generation method provided in the embodiment of the present invention is generally executed by the server 805, and accordingly, the test data generation device is generally set in the server 805. The test data generation method provided in the embodiment of the present invention can also be executed by the terminal devices 801, 802, and 803, and accordingly, the test data generation device can be set in the terminal devices 801, 802, and 803.

[0172] It should be understood that Figure 8 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0173] Reference below Fig. 9 , which shows a schematic diagram of the structure of a computer system 900 of a terminal device suitable for implementing an embodiment of the present invention. Fig. 9 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0174] like Fig. 9As shown, the computer system 900 includes a central processing unit (CPU) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage part 908 into a random access memory (RAM) 903. In the RAM 903, various programs and data required for the operation of the system 900 are also stored. The CPU 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0175] The following components are connected to the I / O interface 905: an input section 906 including a keyboard, a mouse, etc.; an output section 907 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, a modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to the I / O interface 905 as needed. A removable medium 911, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 910 as needed, so that a computer program read therefrom is installed into the storage section 908 as needed.

[0176] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 909, and / or installed from the removable medium 911. When the computer program is executed by the central processing unit (CPU) 901, the above-mentioned functions defined in the system of the embodiment of the present invention are executed.

[0177] It should be noted that the computer-readable medium shown in the embodiment of the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In an embodiment of the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In an embodiment of the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0178] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0179] The modules involved in the embodiments of the present invention may be implemented by software or hardware. The modules described may also be set in a processor, for example, may be described as: a processor includes a first determination module, a second determination module, and a generation module, wherein the names of these modules do not constitute a limitation on the modules themselves under certain circumstances, for example, the first determination module may also be described as a "module for determining test data associated with problems included in the test results".

[0180] As another aspect, an embodiment of the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device implements the following method: in response to receiving a test result, determining test data associated with the problem included in the test result; determining a data construction strategy for the test data; inputting the test data and the data construction strategy into a pre-set large language model, and generating new test data using the large language model after the input is completed.

[0181] According to the technical solution of the embodiment of the present invention, new test data is generated according to the test data and data construction strategy related to the problems in the test results, which can improve the randomness of the test data, help to test more problems, improve software testing efficiency, and reduce labor costs; receive a custom data construction strategy, input the custom data construction strategy and the target data construction strategy screened from the data construction strategy set into the big language model, and more flexibly determine the data construction strategy; identify keywords in the data construction strategy, mark the keywords, and enable the big language model to more accurately segment the data construction strategy and understand the data construction strategy more accurately, thereby avoiding the big voice model from splitting the keywords; receive supplementary instructions for the keywords, associate the supplementary instructions with the keywords, and input the supplementary instructions into the big language model The model can enable the large language model to understand the meaning of keywords more accurately, and then generate new test data more accurately according to the data construction strategy; when the new test data does not meet the data specifications, the new test data is adjusted according to the new data construction strategy, which can generate new test data more flexibly and reduce labor costs; the initial test data is generated according to the data construction strategy of the sample data, the test results are generated according to the initial test data, and the test data is used to generate new test data, which can obtain more reliable and effective new test data and improve software testing efficiency; the general large model is fine-tuned using training data from different business fields to obtain multiple large language models, and the target large language model is determined according to the business field of the test data, which can enable the target large language model to output more reliable and effective test data.

[0182] The above specific implementations do not constitute a limitation on the protection scope of the embodiments of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.

Claims

1. A method for generating test data, characterized in that: include: In response to receiving a test result, determining test data associated with a question included in the test result; Determining a data construction strategy for the test data; Inputting the test data and the data construction strategy into a preset large language model, and using the large language model after the input is completed to generate new test data; Before receiving the test result, the method further includes: In response to receiving the sample data, determining a data construction strategy for the sample data, inputting the sample data and the data construction strategy for the sample data into the large language model, and generating initial test data using the large language model; The system to be tested is tested using the initial test data to obtain the test result.

2. The method according to claim 1, characterized in that: Determining the data construction strategy of the test data includes: selecting a target data construction strategy matching the test data from a preset data construction strategy set; Before inputting the test data and the data construction strategy into a preset large language model, the method further includes: receiving a custom data construction strategy, and using the custom data construction strategy and the target data construction strategy as data construction strategies input into the large language model.

3. The method according to claim 2, characterized in that Before inputting the test data and the data construction strategy into a preset large language model, the method further includes: identifying keywords included in the custom data construction strategy and the target data construction strategy, and marking the keywords; Inputting the test data and the data construction strategy into a preset large language model includes: inputting the test data and a custom data construction strategy including marked keywords and a target data construction strategy into the large language model.

4. The method according to claim 3, characterized in that The method further comprises: In response to receiving the supplementary description, determining a target keyword matching the supplementary description from the keywords, and associating the supplementary description with the target keyword; A supplementary description associated with the target keyword is input into the large language model.

5. The method according to claim 1, characterized in that The method further comprises: Determining whether the new test data meets the preset data specification; In the case that the new test data does not conform to the data specification, in response to receiving the new data construction strategy, the new test data is adjusted according to the new data construction strategy so that the adjusted new test data conforms to the data specification.

6. The method according to claim 1, characterized in that Before inputting the test data and the data construction strategy into the preset large language model, the method further includes: in response to receiving the training data, classifying the training data according to the business field to which the training data belongs; using the classified multiple groups of training data to fine-tune the preset general large model respectively to obtain multiple large language models applied to different business fields; determining a target large language model from the multiple large language models according to the business field to which the test data belongs; Inputting the test data and the data construction strategy into a preset large language model includes: inputting the test data and the data construction strategy into the target large language model.

7. A test data generating device, characterized in that: include: A first determination module, configured to determine, in response to receiving a test result, test data associated with a question included in the test result; A second determination module, used to determine a data construction strategy for the test data; A generation module, used for inputting the test data and the data construction strategy into a preset large language model, and using the inputted large language model to generate new test data; The device also includes: an initial data generating module, configured to, in response to receiving sample data, determine a data construction strategy for the sample data, input the sample data and the data construction strategy for the sample data into the large language model, and generate initial test data using the large language model; The testing module is used to test the system to be tested using the initial testing data to obtain the testing result.

8. An electronic device, characterized in that: include: One or more processors; A storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.

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

Citation Information

Patent Citations

  • Regression testing selection method and device for frame-based application program

    CN102110048A

  • Regression test method and device

    CN109783341A

  • Automated regression testing method, associated device and computer program product

    CN112650688A

  • Method and device for generating test data

    CN113220591A

  • Document visual language reasoning method based on layout perception prompt

    CN116822634A