Test data generation method and device, equipment and storage medium
By using preset data assembly models and data generation models for data processing in test data generation, the problem of low generation efficiency and degree of automation in the existing technology is solved, efficient and automated test data generation is achieved, and modular design is supported. and flexibility.
Patent Information
- Application Number
- CN202410889077.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-04
- Publication Date
- 2024-11-15
AI Technical Summary
The generation efficiency and automation of existing test data generation methods are low, making it difficult to meet the needs of complex test scenarios.
By obtaining functional data of the network system, pre-processing and generating data using preset data assembly models and data generation models, including data standardization and vectorization processing, generating accuracy judgments and generating target test data, and using modular design to improve efficiency and flexibility.
It realizes efficient and automated test data generation, improves generation efficiency and automation, supports modular design and flexibility, and adapts to different needs and styles.
Smart Images

Figure CN118964170A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a test data generation method, device, equipment and storage medium. Background Art
[0002] Test data generation technology is a method used to automatically generate test data in software testing, with the purpose of verifying the correctness and robustness of software applications. With the continuous development of artificial intelligence and automation technology, test data generation technology is becoming more and more advanced, capable of handling more complex test scenarios and providing strong support for the testing phase in the software development life cycle.
[0003] Traditionally, when generating test data, a large amount of test data is usually generated randomly, or test data that meets specific requirements is generated under specific constraints. However, the above methods have the problem of low generation efficiency and low automation when generating test data. Summary of the invention
[0004] The present application aims to at least solve the technical problems existing in the prior art. To this end, the first aspect of the present application proposes a test data generation method, the method comprising:
[0005] Acquire multiple current function data in the network system; wherein the current function data is obtained based on the functions of the network system and / or the requirements for describing each function;
[0006] Input multiple current function data into the preset data assembly model, process the current function data by calling the preset data generation model, and generate a processing result; wherein the processing result includes the current test data and the current accuracy corresponding to the current test data;
[0007] The current test data is judged based on the current accuracy, a judgment result is generated, and the target test data is generated according to the judgment result.
[0008] In a possible implementation, a plurality of current function data are input into a preset data assembly model, and the current function data are processed by calling the preset data generation model to generate a processing result, including:
[0009] Inputting a plurality of current functional data into a preset data assembly model, performing data preprocessing operations on the current functional data, and generating data preprocessing results; wherein the data preprocessing operations include data standardization processing and vectorization processing;
[0010] The data preprocessing results are processed by calling the preset data generation model to generate the processing results.
[0011] In a possible implementation, the process of constructing the preset data generation model includes:
[0012] Obtain a training set of functional data in a network system;
[0013] The functional data training set is input into the initial data generation model for training to generate a preset data generation model.
[0014] In a possible implementation, obtaining a function data training set in a network system includes:
[0015] Obtaining an original function data set and an expanded function data set in the network system; wherein the original function data set is a common data set for testing various functions in the network system, and the expanded function data set is a data set obtained through manual annotation;
[0016] Perform data standardization on the original functional data set and the expanded functional data set to generate a standardized data set;
[0017] The standardized data set is processed by graph representation using a preset graph data structure to generate a graph representation result;
[0018] The data in the graph representation result is vectorized to generate a functional data training set.
[0019] In a possible implementation, the original function data set and the expanded function data set are subjected to data standardization processing to generate a standardized data set, including:
[0020] The original functional data set and the expanded functional data set are fused to generate a fused data set;
[0021] Performing hierarchical identification processing on the fused data set to obtain multiple hierarchies; wherein the multiple hierarchies include a function layer, a function point layer and a meta-function layer, the function layer includes at least one function point layer, and the function point layer includes at least one meta-function layer;
[0022] For each meta-function in the meta-function layer, determine the weight corresponding to the meta-function;
[0023] Based on the weights, data corresponding to each meta-functional layer and the preset accuracy, a standardized data set is generated.
[0024] In a possible implementation, the function data training set is input into the initial data generation model for training to generate a preset data generation model, including:
[0025] Input the functional data training set into the initial data generation model for training, and obtain the actual comprehensive evaluation index of the model and the actual test data of the output; wherein the actual comprehensive evaluation index is calculated based on the functional evaluation index of the model and the preset manual evaluation score, the functional evaluation index is calculated based on the semantic evaluation index of the model and the weight of the meta-function under the corresponding function of the actual test data, and the semantic evaluation index is calculated based on the grammatical correctness, semantic coherence and word order of the actual test data;
[0026] If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, a preset data generation model is generated.
[0027] In a possible implementation, if the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, a preset data generation model is generated, including:
[0028] If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, an intermediate data generation model is generated;
[0029] After evaluating, optimizing, packaging and parameterizing the intermediate data generation model, a preset data generation model is generated.
[0030] A second aspect of the present application provides a test data generating device, the device comprising:
[0031] An acquisition module, used to acquire a plurality of current function data in the network system; wherein the current function data is obtained based on the functions of the network system and / or the requirements for describing each function;
[0032] A processing module, used to input a plurality of current function data into a preset data assembly model, process the current function data by calling the preset data generation model, and generate a processing result; wherein the processing result includes the current test data and the current accuracy rate corresponding to the current test data;
[0033] The generation module is used to judge the current test data based on the current accuracy, generate a judgment result, and generate target test data according to the judgment result.
[0034] In a possible implementation manner, the processing module is specifically used to:
[0035] Inputting a plurality of current functional data into a preset data assembly model, performing data preprocessing operations on the current functional data, and generating data preprocessing results; wherein the data preprocessing operations include data standardization processing and vectorization processing;
[0036] The data preprocessing results are processed by calling the preset data generation model to generate the processing results.
[0037] In a possible implementation manner, the test data generating device is further used for:
[0038] Obtain a training set of functional data in a network system;
[0039] The functional data training set is input into the initial data generation model for training to generate a preset data generation model.
[0040] In a possible implementation manner, the test data generating device is further used for:
[0041] Obtaining an original function data set and an expanded function data set in the network system; wherein the original function data set is a common data set for testing various functions in the network system, and the expanded function data set is a data set obtained through manual annotation;
[0042] Perform data standardization on the original functional data set and the expanded functional data set to generate a standardized data set;
[0043] The standardized data set is processed by graph representation using a preset graph data structure to generate a graph representation result;
[0044] The data in the graph representation result is vectorized to generate a functional data training set.
[0045] In a possible implementation manner, the test data generating device is further used for:
[0046] The original functional data set and the expanded functional data set are fused to generate a fused data set;
[0047] Performing hierarchical identification processing on the fused data set to obtain multiple hierarchies; wherein the multiple hierarchies include a function layer, a function point layer and a meta-function layer, the function layer includes at least one function point layer, and the function point layer includes at least one meta-function layer;
[0048] For each meta-function in the meta-function layer, determine the weight corresponding to the meta-function;
[0049] Based on the weights, data corresponding to each meta-functional layer and the preset accuracy, a standardized data set is generated.
[0050] In a possible implementation manner, the test data generating device is further used for:
[0051] Input the functional data training set into the initial data generation model for training, and obtain the actual comprehensive evaluation index of the model and the actual test data of the output; wherein the actual comprehensive evaluation index is calculated based on the functional evaluation index of the model and the preset manual evaluation score, the functional evaluation index is calculated based on the semantic evaluation index of the model and the weight of the meta-function under the corresponding function of the actual test data, and the semantic evaluation index is calculated based on the grammatical correctness, semantic coherence and word order of the actual test data;
[0052] If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, a preset data generation model is generated.
[0053] In a possible implementation manner, the test data generating device is further used for:
[0054] If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, an intermediate data generation model is generated;
[0055] After evaluating, optimizing, packaging and parameterizing the intermediate data generation model, a preset data generation model is generated.
[0056] The third aspect of the present application proposes an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the test data generation method as described in the first aspect.
[0057] In a fourth aspect, the present application proposes a computer-readable storage medium, in which at least one instruction, at least one program, a code set or an instruction set is stored. The at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by a processor to implement the test data generation method as described in the first aspect.
[0058] The embodiments of the present application have the following beneficial effects:
[0059] The test data generation method provided by the embodiment of the present application includes: obtaining multiple current function data in the network system, wherein the current function data is obtained based on the function of the network system and / or the requirements for describing each function, inputting multiple current function data into the preset data assembly model, processing the current function data by calling the preset data generation model, generating a processing result, wherein the processing result includes the current test data and the current accuracy corresponding to the current test data, judging the current test data based on the current accuracy, generating a judgment result, and generating target test data according to the judgment result. This scheme can directly generate all corresponding target test data at one time for multiple current function data input through the preset data assembly model and the preset data generation model, without manual intervention, thereby improving the efficiency and automation of generating target test data; in addition, each model adopts a modular design, so that the model is highly cohesive and low-coupled as a whole, and at the same time, the generation of overall test data is realized in a modular way, and improvements or migrations can be made for a certain link, and the improvement can be completed within a controllable cost; at the same time, preference settings can also be reserved, so that people with different preferences, different risk preferences, and different styles can set the style of the generated target test data by themselves, which has high flexibility. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Figure 1 A block diagram of a computer device provided in an embodiment of the present application;
[0061] Figure 2 A flowchart of a test data generation method provided in an embodiment of the present application;
[0062] Figure 3 A flowchart of the steps for generating a processing result provided in an embodiment of the present application;
[0063] Figure 4 A flowchart of the steps of constructing a preset data generation model provided in an embodiment of the present application;
[0064] Figure 5 A flowchart of the steps for obtaining a functional data training set provided in an embodiment of the present application;
[0065] Figure 6 A flowchart of the steps for generating a standardized data set provided in an embodiment of the present application;
[0066] Figure 7 A flowchart of the steps for generating a preset data generation model provided in an embodiment of the present application;
[0067] Figure 8 A structural block diagram of a test data generating device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0068] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0069] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, "multiple" means two or more. In addition, the use of "based on" or "according to" means openness and inclusiveness, because the process, steps, calculations or other actions "based on" or "according to" one or more of the conditions or values may be based on additional conditions or values beyond the described values in practice.
[0070] The test data generation method provided in the present application can be applied to a computer device (electronic device), which can be a server or a terminal, wherein the server can be a single server or a server cluster composed of multiple servers. The embodiments of the present application do not specifically limit this. The terminal can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices.
[0071] Take the computer device as a server as an example. Figure 1 A block diagram of a server is shown, such as Figure 1 As shown, the server may include a processor and a memory connected via a system bus. The processor of the server is used to provide computing and control capabilities. The memory of the server includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. When the computer program is executed by the processor, a test data generation method is implemented.
[0072] Those skilled in the art will understand that Figure 1 The structure shown in the figure is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the server to which the solution of the present application is applied. Optionally, the server may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.
[0073] It should be noted that the execution subject of the embodiments of the present application may be a computer device or a test data generating apparatus. The following method embodiments are described using a computer device as the execution subject.
[0074] Figure 2 A flow chart of the steps of a test data generation method provided in an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:
[0075] Step 202: Acquire multiple current function data in the network system.
[0076] The current function data is obtained based on the functions of the network system and / or the requirements for describing each function. In other words, the requirements are used to describe the functions very clearly. The functions of the network system may include multiple functions, such as a login function, a new function, etc.
[0077] When performing software testing, it is necessary to automatically generate test data corresponding to each function so that the test process can be carried out through the test data. Before generating the test data, it is necessary to obtain multiple current function data in the network system so as to determine which functions need to generate corresponding test data.
[0078] Step 204: input a plurality of current function data into a preset data assembly model, process the current function data by calling the preset data generation model, and generate a processing result.
[0079] After obtaining multiple current function data in the network system, the multiple current function data can be input into the preset data assembly model, and the current function data can be processed by calling the preset data generation model to generate a processing result. The processing result can include the current test data and the current accuracy corresponding to the current test data.
[0080] In some optional embodiments, Figure 3 As shown, Figure 3 A flowchart of steps for generating a processing result provided in an embodiment of the present application includes:
[0081] Step 302: Input a plurality of current function data into a preset data assembly model, perform data preprocessing operations on the current function data, and generate data preprocessing results.
[0082] Step 304: Process the data preprocessing result by calling a preset data generation model to generate a processing result.
[0083] Among them, the data preprocessing operation may include but is not limited to data standardization processing and vectorization processing. Optionally, data standardization processing can be performed on multiple current functional data first, and then vectorization processing can be performed through vector engineering, so that the vectorized data is used as the data preprocessing result and input into the preset data generation model for processing, and finally the processing result is generated.
[0084] In some optional embodiments, the above-mentioned preset data generation model needs to be pre-built, such as Figure 4 As shown, Figure 4 A flowchart of the steps of constructing a preset data generation model provided in an embodiment of the present application includes:
[0085] Step 402: Obtain a training set of functional data in the network system.
[0086] Among them, Figure 5 As shown, Figure 5 A flowchart of the steps of obtaining a functional data training set provided in an embodiment of the present application includes:
[0087] Step 502: Acquire the original function data set and the expanded function data set in the network system.
[0088] The original function data set is a common data set for testing various functions in the network system, and the expanded function data set is a data set obtained through manual annotation, that is, a manually written test data set.
[0089] Step 504: Perform data standardization processing on the original function data set and the expanded function data set to generate a standardized data set.
[0090] After obtaining the original functional data set and the expanded functional data set, data standardization processing may be performed first to generate a standardized data set.
[0091] In some optional embodiments, Figure 6 As shown, Figure 6 A flowchart of steps for generating a standardized data set provided in an embodiment of the present application includes:
[0092] Step 602: Fuse the original function data set and the expanded function data set to generate a fused data set.
[0093] Step 604: perform level identification processing on the fused data set to obtain multiple levels.
[0094] Step 606: Determine the weight corresponding to each meta-function in the meta-function layer.
[0095] Step 608: Generate a standardized data set based on the weight, the data corresponding to each meta-functional layer and the preset accuracy.
[0096] When the original function data set and the expanded function data set are fused, a weighted fusion method can be used. For example, the original function data set and the expanded function data set can be weighted fused according to a weight of 1:k0, where k0 is a constant and can be determined in advance by an expert. Of course, other types of fusion processing methods can also be used, and the embodiments of the present application do not specifically limit this.
[0097] Next, the fused data set may be subjected to hierarchical identification processing to obtain multiple hierarchies. The multiple hierarchies may include a function layer, a function point layer, and a meta-function layer, wherein a function layer includes at least one function point layer, and a function point layer includes at least one meta-function layer. Optionally, the fused data set may be subjected to word segmentation processing first, and then the hierarchical identification processing may be performed according to the word segmentation processing result.
[0098] It should be noted that the multiple levels may include at least one function layer, at least one function point layer and at least one meta-function layer. Exemplarily, for a newly added function, the newly added function corresponds to the function layer. Filling in the phone number under the newly added function is one of the function points, so filling in the phone number corresponds to the function point layer. Filling in the phone number function point may also include multiple meta-functions such as verifying the legitimacy of the phone number, verifying the uniqueness of the phone number, and verifying that the phone number is not empty, so these meta-functions all correspond to the meta-function layer.
[0099] In addition, it is also necessary to determine the weight corresponding to each meta-function in the meta-function layer, and the weight can be pre-set according to the importance of the meta-function. In addition, it is also necessary to correspond each meta-function layer to the data in the fusion data set and set the corresponding preset accuracy, which represents the accuracy of the test data to be generated, and can be set to 100% by default. Finally, a standardized data set can be generated based on the weight, the data corresponding to each meta-function layer, and the preset accuracy.
[0100] It should be noted that, for the above-mentioned step of inputting multiple current functional data into the preset data assembly model and performing data preprocessing operations on the current functional data, the process of data preprocessing is the same as the process of standardization and vectorization when obtaining the functional data training set in the network system, so as to facilitate alignment with the above-mentioned preset data generation model in subsequent calculations.
[0101] Step 506: Use a preset graph data structure to perform graph representation processing on the standardized data set to generate a graph representation result.
[0102] Among them, according to the above-mentioned standardized data set, the standardized data set can be processed by graph representation using a preset graph data structure to generate a graph representation result. Thus, the preset graph data structure and the node content represent the data features, and the edges represent the relationship between the data features. By using graph representation, it is helpful to avoid duplication of the bottom structure in the multi-layer structure and to calculate the business similarity of each upper-layer function.
[0103] Step 508: vectorize the data in the graph representation result to generate a functional data training set.
[0104] Among them, a pre-trained word vector model can be used to vectorize the data in the graph representation result, so as to map each word into a vector and generate a functional data training set. Optionally, the pre-trained word vector model can be a model such as Word2Vec, FastText, or other types of models, which is not specifically limited in the embodiments of the present application.
[0105] Step 404: input the function data training set into the initial data generation model for training to generate a preset data generation model.
[0106] Among them, you can choose to use the Long Short-Term Memory (LSTM) network as a template to build an initial data generation model. And you need to initialize various parameters, including the number of layers of the LSTM network, the number of units in each layer, the dimensions of the input and output layers, the weights and biases of the input gate, forget gate, and output gate, as well as the preset comprehensive evaluation index threshold eval_indi0 and the test data compliance threshold y0. The test data compliance threshold is the proportion of data that meets the preset comprehensive evaluation index threshold eval_indi0 in all generated test data, which can be set to 80% initially.
[0107] In addition, it is also necessary to construct evaluation indicators for the model, which can be divided into three parts, namely semantic evaluation indicators, functional evaluation indicators and comprehensive evaluation indicators.
[0108] Among them, the semantic evaluation index is an evaluation index calculated by the system according to a specific mechanism, which is used to measure the grammatical correctness, semantic coherence and word order of the generated test data. The value of the semantic evaluation index eval_indi_self(i) = min(rp1(i), rp2(i), rp3(i)). Among them, rp1(i), rp2(i), rp3(i) respectively represent the values of grammatical correctness, semantic coherence and word order of the i-th test data generated. Its value can be calculated separately using the spatial similarity algorithm. For example, the cosine similarity algorithm can be used to calculate the similarity relationship between a certain generated test data and the data in the fused data set.
[0109] When calculating the above grammatical correctness value, a certain generated test data and the data in the fused data set can be first segmented, and the segmented words corresponding to different components such as subject, predicate, and object can be determined, and then the similarity between the generated test data and the data in the fused data set under the same components can be calculated. For example, the similarity between the segmented words corresponding to the subject in the generated test data and the segmented words corresponding to the subject in the data of the fused data set can be calculated. Similarly, the segmented words corresponding to other components can also be calculated in a similar way, and finally the grammatical correctness value can be obtained based on multiple similarities.
[0110] When calculating the above semantic coherence value, the semantic information of the generated test data may be extracted and then similarity calculation may be performed with the semantic information of the data in the fused data set to obtain the semantic coherence value.
[0111] When calculating the value of the above-mentioned word order, we can first perform word segmentation on a certain generated test data and the data in the fused data set, and determine the word segmentations corresponding to different components such as subject, predicate, and object. Then, combined with the position order of each component in the data, calculate the similarity between the test data generated under the same component and the data in the fused data set, so as to obtain the value of the word order.
[0112] The function evaluation index is calculated based on the semantic evaluation index of the model and the weight of the meta-function under the corresponding function of the actual test data. The value of the function evaluation index is eval_indi_func(i) = eval_indi_self(i)*atom_w_vec(k), where atom_w_vec(k) represents the mean value of the weight of each meta-function under the corresponding function of the i-th test data.
[0113] The actual comprehensive evaluation index is calculated based on the functional evaluation index of the model and the preset manual evaluation score. The value of the actual comprehensive evaluation index is eval_indi(i)=eval_indi_func(i)*w(i), where w(i) represents the preset manual evaluation score, which can be determined based on the importance and experience of the business system function, personal preference and other parameters.
[0114] Then, the functional data training set can be input into the initial data generation model for training to generate a preset data generation model. Figure 7 As shown, Figure 7 A flowchart of the steps of generating a preset data generation model provided in an embodiment of the present application includes:
[0115] Step 702: Input the function data training set into the initial data generation model for training, and obtain the actual comprehensive evaluation index of the model and the actual test data output.
[0116] Step 704: If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, a preset data generation model is generated.
[0117] Among them, the actual comprehensive evaluation index is calculated based on the functional evaluation index of the model and the preset manual evaluation score. The functional evaluation index is calculated based on the semantic evaluation index of the model and the weight of the meta-function under the corresponding function of the actual test data. The semantic evaluation index is calculated based on the grammatical correctness, semantic coherence and word order of the actual test data. The specific calculation process is the same as the process of constructing the evaluation index of the model mentioned above.
[0118] Therefore, the functional data training set can be input into the initial data generation model for training to obtain the actual comprehensive evaluation index of the model and the actual test data of the output. If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, the preset data generation model is generated; if the actual comprehensive evaluation index does not meet the preset comprehensive evaluation index threshold, the parameters such as the weights and bias of the input gate, forget gate and output gate of the model can be optimized until the conditions are met.
[0119] Next, if the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, an intermediate data generation model is generated, and after evaluation and optimization, packaging and parameterization of the intermediate data generation model, a preset data generation model is generated.
[0120] Specifically, the functional data test set can be used to evaluate and optimize the intermediate data generation model. Finally, the evaluated and optimized model is packaged and parameterized to generate a preset data generation model.
[0121] The output of the preset data generation model may include the current test data corresponding to each function, and may also include data such as the meta-function corresponding to the current test data, the actual comprehensive evaluation index of the current test data, etc.
[0122] Step 206: judge the current test data based on the current accuracy, generate a judgment result, and generate target test data according to the judgment result.
[0123] After obtaining the current accuracy rate corresponding to the current test data, the current accuracy rate may be compared with the preset accuracy rate to determine whether the current test data generated for the current functional data meets the requirements.
[0124] Optionally, if the current accuracy rate is lower than the preset accuracy rate, it is considered that the generated current test data does not meet the requirements, and it is necessary to manually write test data and use the written test data as target test data; if the current accuracy rate is not lower than the preset accuracy rate, it is considered that the generated current test data meets the requirements, and the current test data can be directly used as the target test data.
[0125] In addition, a timing mechanism can be designed to regularly extract the test data written by users into the extended data set. When the preset data generation model needs to be updated and upgraded in the later stage, the latest extended data set can be used to upgrade and update the model. As a result, as the extended data set of the preset data generation model becomes more and more complete, its accuracy will become higher and higher, and the need for manual intervention will become less and less, which is in line with the long tail theory, and the effect of generating test data will become better and better.
[0126] The present application provides a test data generation method, which includes: obtaining multiple current function data in a network system, wherein the current function data is obtained based on the function of the network system and / or the requirements for describing each function, inputting multiple current function data into a preset data assembly model, processing the current function data by calling the preset data generation model, generating a processing result, wherein the processing result includes the current test data and the current accuracy corresponding to the current test data, judging the current test data based on the current accuracy, generating a judgment result, and generating target test data according to the judgment result. This scheme can directly generate all corresponding target test data at one time for multiple current function data input through the preset data assembly model and the preset data generation model, without manual intervention, thereby improving the efficiency and automation of generating target test data; in addition, each model adopts a modular design, so that the model is highly cohesive and low-coupled as a whole, and at the same time, the generation of overall test data is realized in a modular way, and improvements or migrations can be made for a certain link, and the improvement can be completed within a controllable cost; at the same time, preference settings can also be reserved, so that people with different preferences, different risk preferences, and different styles can set the style of the generated target test data by themselves, which has high flexibility.
[0127] Figure 8 A structural block diagram of a test data generating device provided in an embodiment of the present application.
[0128] like Figure 8 As shown, the test data generating device 800 includes:
[0129] The acquisition module 802 is used to acquire a plurality of current function data in the network system; wherein the current function data is obtained based on the functions of the network system and / or the requirements for describing each function.
[0130] The processing module 804 is used to input multiple current functional data into the preset data assembly model, process the current functional data by calling the preset data generation model, and generate processing results; wherein the processing results include current test data and the current accuracy corresponding to the current test data.
[0131] The generating module 806 is used to judge the current test data based on the current accuracy, generate a judgment result, and generate target test data according to the judgment result.
[0132] Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be described in detail here. Each module in the above test data generating device can be implemented in whole or in part by software, hardware, and a combination thereof. Each of the above modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations of each of the above modules.
[0133] In one embodiment of the present application, a computer device is provided, the computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0134] Acquire multiple current function data in the network system; wherein the current function data is obtained based on the functions of the network system and / or the requirements for describing each function;
[0135] Input multiple current function data into the preset data assembly model, process the current function data by calling the preset data generation model, and generate a processing result; wherein the processing result includes the current test data and the current accuracy corresponding to the current test data;
[0136] The current test data is judged based on the current accuracy, a judgment result is generated, and the target test data is generated according to the judgment result.
[0137] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:
[0138] Inputting a plurality of current functional data into a preset data assembly model, performing data preprocessing operations on the current functional data, and generating data preprocessing results; wherein the data preprocessing operations include data standardization processing and vectorization processing;
[0139] The data preprocessing results are processed by calling the preset data generation model to generate the processing results.
[0140] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:
[0141] Obtain a training set of functional data in a network system;
[0142] The functional data training set is input into the initial data generation model for training to generate a preset data generation model.
[0143] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:
[0144] Obtaining an original function data set and an expanded function data set in the network system; wherein the original function data set is a common data set for testing various functions in the network system, and the expanded function data set is a data set obtained through manual annotation;
[0145] Perform data standardization on the original functional data set and the expanded functional data set to generate a standardized data set;
[0146] The standardized data set is processed by graph representation using a preset graph data structure to generate a graph representation result;
[0147] The data in the graph representation result is vectorized to generate a functional data training set.
[0148] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:
[0149] The original functional data set and the expanded functional data set are fused to generate a fused data set;
[0150] Performing hierarchical identification processing on the fused data set to obtain multiple hierarchies; wherein the multiple hierarchies include a function layer, a function point layer and a meta-function layer, the function layer includes at least one function point layer, and the function point layer includes at least one meta-function layer;
[0151] For each meta-function in the meta-function layer, determine the weight corresponding to the meta-function;
[0152] Based on the weights, data corresponding to each meta-functional layer and the preset accuracy, a standardized data set is generated.
[0153] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:
[0154] Input the functional data training set into the initial data generation model for training, and obtain the actual comprehensive evaluation index of the model and the actual test data of the output; wherein the actual comprehensive evaluation index is calculated based on the functional evaluation index of the model and the preset manual evaluation score, the functional evaluation index is calculated based on the semantic evaluation index of the model and the weight of the meta-function under the corresponding function of the actual test data, and the semantic evaluation index is calculated based on the grammatical correctness, semantic coherence and word order of the actual test data;
[0155] If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, a preset data generation model is generated.
[0156] In one embodiment of the present application, when the processor executes the computer program, the processor further implements the following steps:
[0157] If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, an intermediate data generation model is generated;
[0158] After evaluating, optimizing, packaging and parameterizing the intermediate data generation model, a preset data generation model is generated.
[0159] The computer device provided in the embodiment of the present application has similar implementation principles and technical effects to those of the above-mentioned method embodiment, and will not be described in detail here.
[0160] In one embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0161] Acquire multiple current function data in the network system; wherein the current function data is obtained based on the functions of the network system and / or the requirements for describing each function;
[0162] Input multiple current function data into the preset data assembly model, process the current function data by calling the preset data generation model, and generate a processing result; wherein the processing result includes the current test data and the current accuracy corresponding to the current test data;
[0163] The current test data is judged based on the current accuracy, a judgment result is generated, and the target test data is generated according to the judgment result.
[0164] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0165] Inputting a plurality of current functional data into a preset data assembly model, performing data preprocessing operations on the current functional data, and generating data preprocessing results; wherein the data preprocessing operations include data standardization processing and vectorization processing;
[0166] The data preprocessing results are processed by calling the preset data generation model to generate the processing results.
[0167] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0168] Obtain a training set of functional data in a network system;
[0169] The functional data training set is input into the initial data generation model for training to generate a preset data generation model.
[0170] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0171] Obtaining an original function data set and an expanded function data set in the network system; wherein the original function data set is a common data set for testing various functions in the network system, and the expanded function data set is a data set obtained through manual annotation;
[0172] Perform data standardization on the original functional data set and the expanded functional data set to generate a standardized data set;
[0173] The standardized data set is processed by graph representation using a preset graph data structure to generate a graph representation result;
[0174] The data in the graph representation result is vectorized to generate a functional data training set.
[0175] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0176] The original functional data set and the expanded functional data set are fused to generate a fused data set;
[0177] Performing hierarchical identification processing on the fused data set to obtain multiple hierarchies; wherein the multiple hierarchies include a function layer, a function point layer and a meta-function layer, the function layer includes at least one function point layer, and the function point layer includes at least one meta-function layer;
[0178] For each meta-function in the meta-function layer, determine the weight corresponding to the meta-function;
[0179] Based on the weights, data corresponding to each meta-functional layer and the preset accuracy, a standardized data set is generated.
[0180] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0181] Input the functional data training set into the initial data generation model for training, and obtain the actual comprehensive evaluation index of the model and the actual test data of the output; wherein the actual comprehensive evaluation index is calculated based on the functional evaluation index of the model and the preset manual evaluation score, the functional evaluation index is calculated based on the semantic evaluation index of the model and the weight of the meta-function under the corresponding function of the actual test data, and the semantic evaluation index is calculated based on the grammatical correctness, semantic coherence and word order of the actual test data;
[0182] If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, a preset data generation model is generated.
[0183] In one embodiment of the present application, when the computer program is executed by a processor, the following steps are further implemented:
[0184] If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, an intermediate data generation model is generated;
[0185] After evaluating, optimizing, packaging and parameterizing the intermediate data generation model, a preset data generation model is generated.
[0186] The computer-readable storage medium provided in this embodiment has similar implementation principles and technical effects to those of the above method embodiments, and will not be described in detail here.
[0187] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0188] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0189] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A test data generation method, characterized in that: The method comprises: Acquire multiple current function data in the network system; wherein the current function data is obtained based on the functions of the network system and / or requirements for describing each function; Input the multiple current function data into the preset data assembly model, process the current function data by calling the preset data generation model, and generate a processing result; wherein the processing result includes the current test data and the current accuracy corresponding to the current test data; The current test data is judged based on the current accuracy, a judgment result is generated, and target test data is generated according to the judgment result.
2. The method according to claim 1, characterized in that The inputting the plurality of current function data into the preset data assembly model, processing the current function data by calling the preset data generation model, and generating a processing result includes: Inputting the plurality of current function data into a preset data assembly model, performing data preprocessing operations on the current function data, and generating data preprocessing results; wherein the data preprocessing operations include data standardization processing and vectorization processing; The data preprocessing result is processed by calling a preset data generation model to generate the processing result.
3. The method according to claim 1 or 2, characterized in that: The process of constructing the preset data generation model includes: Obtain a training set of functional data in a network system; The functional data training set is input into the initial data generation model for training to generate the preset data generation model.
4. The method according to claim 3, characterized in that The step of obtaining a functional data training set in the network system comprises: Acquire an original function data set and an expanded function data set in the network system; wherein the original function data set is a common data set when testing various functions in the network system, and the expanded function data set is a data set obtained by manual annotation; Performing data standardization processing on the original functional data set and the expanded functional data set to generate a standardized data set; Using a preset graph data structure to perform graph representation processing on the standardized data set to generate a graph representation result; Vectorization is performed on the data in the graph representation result to generate the functional data training set.
5. The method according to claim 4, characterized in that The step of performing data standardization on the original function data set and the expanded function data set to generate a standardized data set includes: Performing fusion processing on the original functional data set and the expanded functional data set to generate a fused data set; Performing hierarchical identification processing on the fused data set to obtain multiple hierarchies; wherein the multiple hierarchies include a function layer, a function point layer and a meta-function layer, the function layer includes at least one function point layer, and the function point layer includes at least one meta-function layer; For each meta-function in the meta-function layer, determining a weight corresponding to the meta-function; Based on the weights, the data corresponding to each of the meta-functional layers and the preset accuracy, the standardized data set is generated.
6. The method according to claim 4, characterized in that The step of inputting the functional data training set into the initial data generation model for training to generate the preset data generation model comprises: The functional data training set is input into the initial data generation model for training, and the actual comprehensive evaluation index of the model and the actual test data of the output are obtained; wherein the actual comprehensive evaluation index is calculated based on the functional evaluation index of the model and the preset manual evaluation score, the functional evaluation index is calculated based on the semantic evaluation index of the model and the weight of the meta-function under the corresponding function of the actual test data, and the semantic evaluation index is calculated based on the grammatical correctness, semantic coherence and word order of the actual test data; If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, the preset data generation model is generated.
7. The method according to claim 6, characterized in that If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, generating the preset data generation model includes: If the actual comprehensive evaluation index meets the preset comprehensive evaluation index threshold, an intermediate data generation model is generated; After evaluating and optimizing, packaging and parameterizing the intermediate data generation model, the preset data generation model is generated.
8. A test data generating device, characterized in that: The device comprises: An acquisition module, used to acquire a plurality of current function data in the network system; wherein the current function data is obtained based on the functions of the network system and / or the requirements for describing each function; A processing module, used for inputting the multiple current function data into a preset data assembly model, processing the current function data by calling the preset data generation model, and generating a processing result; wherein the processing result includes current test data and a current accuracy rate corresponding to the current test data; A generation module is used to judge the current test data based on the current accuracy, generate a judgment result, and generate target test data according to the judgment result.
9. An electronic device, characterized in that: The electronic device includes a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the test data generation method as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set is loaded and executed by the processor to implement the test data generation method as described in any one of claims 1-7.
