A test case generation method, device, equipment, medium and product

By generating a target high-dimensional vector set based on user historical interaction behavior data, the problem of low efficiency in the generation of test cases and inability to fit real usage scenarios in the prior art is solved, and a more efficient and more appropriate scenario test case generation is achieved.

CN119512968BActive Publication Date: 2025-04-29BEIJING CHJ AUTOMOTIVE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510052078.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-13
Publication Date
2025-04-29
Estimated Expiration
2045-01-13

AI Technical Summary

Technical Problem

The prior art is inefficient in generating test cases and cannot fit into real-life usage scenarios, resulting in the edge cases of the test function not being fully covered.

Method used

By obtaining user historical interaction behavior data, an initial high-dimensional vector set is generated, and filtering according to the similarity between the high-dimensional vector corresponding to the test condition data and the initial high-dimensional vector set is obtained. Generate test cases based on this collection.

Benefits of technology

The generated test cases are more in line with real usage scenarios, improving the authenticity and effectiveness of test cases, and improving the generation efficiency of test cases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119512968B_ABST
    Figure CN119512968B_ABST
Patent Text Reader

Abstract

The present invention discloses a test case generation method, device, equipment, medium and product. The method comprises: obtaining an initial high-dimensional vector set corresponding to a plurality of user historical interaction behavior data; screening the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain a target high-dimensional vector set; based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set, generating a test case corresponding to each target high-dimensional vector. Through the technical solution of the present invention, the authenticity and effectiveness of the test case can be improved, and the efficiency of generating the test case can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to a test case generation method, device, equipment, medium and product. Background Art

[0002] At present, in terms of generating test cases, it is usually necessary to rely on manually written test cases, that is, testers write test cases based on functional requirements text. However, in manually written test cases, due to the limited associative ability of testers, the edge cases of the test functions are not fully covered, and they cannot fit the actual usage scenarios. In addition, the labor cost of this method and the requirements for testers are high. In addition, in order to cover more functional scenarios, a lot of time is needed for manual writing, which increases the possibility of errors, resulting in low efficiency in generating test cases.

[0003] Currently, no effective solution has been proposed to address the above-mentioned problems of low efficiency in generating test cases and failure to fit real usage scenarios. Summary of the invention

[0004] The embodiments of the present invention provide a test case generation method, apparatus, device, medium and product, which automatically generate test cases based on user historical interaction behavior data. The generated test cases are more in line with actual usage scenarios, improve the authenticity and effectiveness of the test cases, and can improve the efficiency of test case generation.

[0005] According to one aspect of the present invention, there is provided a test case generation method, comprising:

[0006] Obtain an initial high-dimensional vector set corresponding to multiple users' historical interaction behavior data;

[0007] According to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, the initial high-dimensional vector set is screened to obtain a target high-dimensional vector set;

[0008] Based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set, a test case corresponding to each target high-dimensional vector is generated.

[0009] In some embodiments of the present invention, based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set, generating a test case corresponding to each target high-dimensional vector includes:

[0010] Obtaining user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set;

[0011] Inputting the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set and the first knowledge base into the target verification point supplement model to obtain a test sequence corresponding to each target high-dimensional vector, wherein the target verification point supplement model is obtained by training the initial verification point supplement model with the first sample set, wherein the first sample set includes: a first sample and a label corresponding to the first sample, wherein the first sample is an interaction behavior sequence sample with a missing verification point, and the label corresponding to the first sample is a complete interaction behavior sequence after the verification point is supplemented, and the first knowledge base includes: a verification point and associated interaction behavior data of the verification point;

[0012] The test sequences corresponding to each target high-dimensional vector and the second knowledge base are input into the target test case generation model to obtain the test cases corresponding to each target high-dimensional vector, wherein the second knowledge base includes: interaction behavior data and test cases corresponding to the interaction behavior data.

[0013] In some embodiments of the present invention, training the initial verification point supplement model by the first sample set includes:

[0014] Inputting the first sample in the first sample set into the initial verification point supplementation model to obtain a predicted interaction behavior sequence after the supplementation verification point;

[0015] According to the difference between the predicted interaction behavior sequence after the supplementary verification point and the complete interaction behavior sequence after the supplementary verification point, the parameters of the initial verification point supplementary model are trained to obtain the target verification point supplementary model.

[0016] In some embodiments of the present invention, obtaining an initial high-dimensional vector set corresponding to a plurality of user historical interaction behavior data includes:

[0017] Generate a training sample set based on multiple users' historical interaction behavior data;

[0018] The initial coding model is trained according to the training sample set to obtain a target coding model, wherein the initial coding model includes: an encoder;

[0019] Inputting the plurality of user historical interaction behavior data into the target coding model in sequence;

[0020] An initial high-dimensional vector set corresponding to each user's historical interaction behavior data output by the encoder of the target coding model is obtained.

[0021] In some embodiments of the present invention, before screening the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain the target high-dimensional vector set, the method further includes:

[0022] inputting the test condition data into the target coding model;

[0023] Obtain a high-dimensional vector corresponding to the test condition data output by the encoder of the target coding model.

[0024] In some embodiments of the present invention, each user's historical interaction behavior data includes: a historical interaction behavior sequence corresponding to each user, wherein the historical interaction behavior sequence corresponding to the user is an interaction behavior sequence obtained by sorting the historical interaction behavior sub-data collected within a preset time in chronological order;

[0025] Generate training sample sets based on multiple user historical interaction behavior data, including:

[0026] Determine the other user historical interaction behavior sub-data except the user historical interaction behavior sub-data corresponding to the Nth time point in each user historical interaction behavior sequence as training samples, and determine the user historical interaction behavior sub-data corresponding to the Nth time point as the label corresponding to the training sample, where N is a positive integer;

[0027] A training sample set is generated according to the training samples and labels corresponding to the training samples.

[0028] In some embodiments of the present invention, before screening the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain the target high-dimensional vector set, the method further includes:

[0029] Obtaining the cosine similarity and / or Euclidean distance between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set;

[0030] The similarity between the high dimensional vector corresponding to the test condition data and each initial high dimensional vector in the initial high dimensional vector set is determined based on the cosine similarity and / or Euclidean distance between the high dimensional vector corresponding to the test condition data and each initial high dimensional vector in the initial high dimensional vector set.

[0031] In some embodiments of the present invention, the initial high-dimensional vector set is screened according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain a target high-dimensional vector set, including:

[0032] According to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, the initial high-dimensional vector set is screened to obtain a screened initial high-dimensional vector set;

[0033] Obtaining the occurrence frequency of the user historical interaction behavior data corresponding to each high-dimensional vector in the filtered initial high-dimensional vector set;

[0034] The filtered initial high-dimensional vector set is filtered according to the occurrence frequency of the user historical interaction behavior data corresponding to each high-dimensional vector to obtain a target high-dimensional vector set.

[0035] In some embodiments of the present invention, the user's historical interaction behavior data includes: interaction information, vehicle information and environment information.

[0036] According to another aspect of the present invention, there is provided a test case generating device, the device comprising:

[0037] An acquisition module is used to acquire an initial high-dimensional vector set corresponding to multiple user historical interaction behavior data;

[0038] A screening module, used for screening the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain a target high-dimensional vector set;

[0039] A generation module is used to generate test cases corresponding to each target high-dimensional vector based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set.

[0040] In some embodiments of the present invention, the generation module is specifically used to:

[0041] Obtaining user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set;

[0042] Inputting the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set and the first knowledge base into the target verification point supplement model to obtain a test sequence corresponding to each target high-dimensional vector, wherein the target verification point supplement model is obtained by training the initial verification point supplement model with the first sample set, wherein the first sample set includes: a first sample and a label corresponding to the first sample, wherein the first sample is an interaction behavior sequence sample with a missing verification point, and the label corresponding to the first sample is a complete interaction behavior sequence after the verification point is supplemented, and the first knowledge base includes: a verification point and associated interaction behavior data of the verification point;

[0043] The test sequences corresponding to each target high-dimensional vector and the second knowledge base are input into the target test case generation model to obtain the test cases corresponding to each target high-dimensional vector, wherein the second knowledge base includes: interaction behavior data and test cases corresponding to the interaction behavior data.

[0044] In some embodiments of the present invention, the generating module is further used to:

[0045] Inputting the first sample in the first sample set into the initial verification point supplementation model to obtain a predicted interaction behavior sequence after the supplementation verification point;

[0046] According to the difference between the predicted interaction behavior sequence after the supplementary verification point and the complete interaction behavior sequence after the supplementary verification point, the parameters of the initial verification point supplementary model are trained to obtain the target verification point supplementary model.

[0047] In some embodiments of the present invention, the acquisition module includes:

[0048] A training sample set generating unit, used to generate a training sample set according to a plurality of user historical interaction behavior data;

[0049] A target coding model determination unit is used to train an initial coding model according to the training sample set to obtain a target coding model, wherein the initial coding model includes: an encoder;

[0050] An input unit, used to sequentially input the plurality of user historical interaction behavior data into the target coding model;

[0051] The initial high-dimensional vector set acquisition unit is used to acquire an initial high-dimensional vector set corresponding to each user's historical interaction behavior data output by the encoder of the target coding model.

[0052] In some embodiments of the present invention, the test case generating device further includes:

[0053] An input module, configured to input the test condition data into the target coding model before screening the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain the target high-dimensional vector set;

[0054] The high-dimensional vector acquisition module corresponding to the test condition data is used to obtain the high-dimensional vector corresponding to the test condition data output by the encoder of the target coding model.

[0055] In some embodiments of the present invention, each user's historical interaction behavior data includes: a historical interaction behavior sequence corresponding to each user, wherein the historical interaction behavior sequence corresponding to the user is an interaction behavior sequence obtained by sorting the historical interaction behavior sub-data collected within a preset time in chronological order;

[0056] The training sample set generation unit is specifically used for:

[0057] Determine the other user historical interaction behavior sub-data except the user historical interaction behavior sub-data corresponding to the Nth time point in each user historical interaction behavior sequence as training samples, and determine the user historical interaction behavior sub-data corresponding to the Nth time point as the label corresponding to the training sample, where N is a positive integer;

[0058] A training sample set is generated according to the training samples and labels corresponding to the training samples.

[0059] In some embodiments of the present invention, the test case generating device further includes:

[0060] a cosine similarity and / or Euclidean distance acquisition module, used to obtain the cosine similarity and / or Euclidean distance between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set before screening the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain the target high-dimensional vector set;

[0061] A similarity determination module is used to determine the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set based on the cosine similarity and / or Euclidean distance between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set.

[0062] In some embodiments of the present invention, the screening module is specifically used to:

[0063] According to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, the initial high-dimensional vector set is screened to obtain a screened initial high-dimensional vector set;

[0064] Obtaining the occurrence frequency of the user historical interaction behavior data corresponding to each high-dimensional vector in the filtered initial high-dimensional vector set;

[0065] The filtered initial high-dimensional vector set is filtered according to the occurrence frequency of the user historical interaction behavior data corresponding to each high-dimensional vector to obtain a target high-dimensional vector set.

[0066] In some embodiments of the present invention, the user's historical interaction behavior data includes: interaction information, vehicle information and environment information.

[0067] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0068] at least one processor; and

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

[0070] The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the test case generation method described in any embodiment of the present invention.

[0071] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the test case generation method described in any embodiment of the present invention when executed.

[0072] According to another aspect of the present invention, a computer program product is provided. When the computer program is executed by a processor, the test case generating method as described in any one of the embodiments of the present invention is implemented.

[0073] The technical solution of this embodiment is to first obtain an initial high-dimensional vector set corresponding to multiple user historical interaction behavior data; then screen the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain a target high-dimensional vector set; finally, based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set, generate test cases corresponding to each target high-dimensional vector. The generated test cases are more in line with the actual usage scenarios, improve the authenticity and effectiveness of the test cases, and can improve the efficiency of test case generation.

[0074] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0076] Figure 1 is a flow chart of a first test case generation method in an embodiment of the present invention;

[0077] Figure 2 is a flow chart of a second test case generation method in an embodiment of the present invention;

[0078] Figure 3 is a structural schematic diagram of a test case generating device in an embodiment of the present invention;

[0079] Figure 4 It is a structural schematic diagram of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

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

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

[0082] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0083] Embodiment 1

[0084] Figure 1 This is a flowchart of a first test case generation method provided by an embodiment of the present invention. This embodiment is applicable to the case of test case generation. The method can be executed by a test case generation device in an embodiment of the present invention. The device can be implemented in software and / or hardware. Figure 1 As shown, the method specifically comprises the following steps:

[0085] S101. Obtain an initial high-dimensional vector set corresponding to multiple user historical interaction behavior data.

[0086] In this embodiment, the user's historical interaction behavior data is the user's multimodal data based on time series. The method for obtaining multiple users' historical interaction behavior data can be: deploying a cockpit tracking system on different types of vehicles, and obtaining the historical interaction behavior data generated by different users when operating different models through the cockpit tracking system. The method for obtaining multiple users' historical interaction behavior data can also be: equipping different types of vehicles with intelligent agents, and obtaining the historical interaction behavior data generated by users operating the intelligent agents. The intelligent agent can be a mobile terminal with interactive functions, such as smart glasses, mobile phones, tablets, etc.

[0087] In this embodiment, the high-dimensional vector can provide a comprehensive description of the interaction behavior. The initial high-dimensional vector set includes: the initial high-dimensional vector corresponding to the historical interaction behavior data of each user, for example, the initial high-dimensional vector set includes: the initial high-dimensional vector a1 corresponding to the historical interaction behavior data of user A1, the initial high-dimensional vector a2 corresponding to the historical interaction behavior data of user A2, the initial high-dimensional vector a3 corresponding to the historical interaction behavior data of user A3, etc.

[0088] In this embodiment, the method for obtaining the initial high-dimensional vector set corresponding to the historical interaction behavior data of multiple users can be: obtaining the historical interaction behavior data of multiple users, inputting the historical interaction behavior data of multiple users into the target coding model in sequence, and determining the initial high-dimensional vector set corresponding to the historical interaction behavior data of multiple users according to the high-dimensional vector output by the encoder of the target coding model. The method for obtaining the initial high-dimensional vector set corresponding to the historical interaction behavior data of multiple users can also be: obtaining the historical interaction behavior data generated by different users when operating different models through the cockpit point-burying system, dividing the collected historical interaction behavior data of multiple users, obtaining the historical interaction behavior data corresponding to each user, sorting the historical interaction behavior data corresponding to each user according to the time of collecting the historical interaction behavior data, obtaining the historical interaction behavior sequence corresponding to each user, inputting the historical interaction behavior sequence corresponding to each user into the target coding model in sequence, determining the initial high-dimensional vector corresponding to each user's historical interaction behavior sequence according to the high-dimensional vector output by the encoder of the target coding model, and generating the initial high-dimensional vector set according to the initial high-dimensional vector corresponding to each user's historical interaction behavior sequence.

[0089] Optionally, the user's historical interaction behavior data includes: interaction information, vehicle information and environment information.

[0090] In this embodiment, the interaction information includes: interaction mode, interaction object and interaction scene. Interaction mode includes: single mode and multi-mode. Single mode includes: voice, touch, gesture, etc. Interaction object includes: vehicle computer function and intelligent entity function. Vehicle computer function includes: system function and vehicle adjustment function. Interaction scene includes: single person scene and multi-person scene. Vehicle information includes: energy status and driving status. Energy status includes: power, fuel and charging status. Driving status includes: vehicle speed, gear and driving mode. Environmental information includes: time, weather, road and traffic conditions, etc.

[0091] In a specific example, the historical interaction behavior data is: [

[0093] [Voice + gesture, window adjustment, single-person scene],

[0094] [Battery 30%, fuel 120km, low speed driving],

[0095] [Rainy day, 17 degrees Celsius, night, ring road, congestion],

[0096] ].

[0097] In this embodiment, the user historical interaction behavior data includes multiple types of data, and the test cases generated based on the multiple types of measured data can cover multiple interaction modes and environmental states, ensuring comprehensive scenario coverage.

[0098] Optionally, an initial high-dimensional vector set corresponding to multiple user historical interaction behavior data is obtained, including:

[0099] Generate a training sample set based on multiple users' historical interaction behavior data.

[0100] In this embodiment, a training sample set may be generated based on historical interaction behavior data of multiple users as follows: based on the collection time of each historical behavior data, the historical behavior data of multiple users are sorted in chronological order to obtain a historical interaction behavior sequence of each user, part of the historical interaction behavior sequences in the historical interaction behavior sequence of each user is determined as training samples, and the remaining part of the interaction behavior sequences is determined as labels corresponding to the training samples, and a training sample set is generated based on the training samples and the labels corresponding to the training samples.

[0101] In this embodiment, the number of historical interaction behaviors in the training sample may be greater than the number of historical interaction behaviors in the label corresponding to the training sample, the number of historical interaction behaviors in the training sample may also be less than the number of historical interaction behaviors in the label corresponding to the training sample, and the number of historical interaction behaviors in the training sample may be equal to the number of historical interaction behaviors in the label corresponding to the training sample. The embodiment of the present invention does not limit this.

[0102] An initial coding model is trained according to the training sample set to obtain a target coding model, wherein the initial coding model includes: an encoder.

[0103] In this embodiment, the initial encoding model may adopt an encoder-only Transformer model.

[0104] In this embodiment, the initial coding model is trained according to the training sample set, and the target coding model can be obtained by: inputting the training samples in the training sample set into the initial coding model to obtain a predicted interaction behavior sequence, and training the parameters of the initial coding model according to the difference between the predicted interaction behavior sequence and the labels corresponding to the training samples to obtain the target coding model.

[0105] The plurality of user historical interaction behavior data are sequentially input into the target coding model.

[0106] In a specific example, the historical interaction behavior data of user A1 is input into the target coding model; the historical interaction behavior data of user A2 is input into the target coding model; the historical interaction behavior data of user A3 is input into the target coding model, and so on, and the collected historical interaction behavior data of all users are input into the target coding model.

[0107] An initial high-dimensional vector set corresponding to each user's historical interaction behavior data output by the encoder of the target coding model is obtained.

[0108] In this embodiment, the encoder in the Transformer is an important component in the field of natural language processing. It is responsible for converting the input sequence (such as text) into a set of feature vectors, which are then used for various downstream tasks. The encoder consists of multiple identical layers, each of which contains two sublayers: a multi-head self-attention mechanism and a feedforward fully connected network. The encoder in the Transformer introduces position encoding, which is a method of adding a specific encoding vector to each position in the input sequence to represent the absolute or relative position of the position. Encoding is usually performed in the form of sine and cosine functions. By adding position encoding to the input sequence, the encoder in the Transformer can solve the problem of sequence position information and help the model better understand the order relationship in the sequence. In order to effectively transmit information and alleviate the problem of gradient disappearance, residual connections and layer normalization are introduced in the encoder. Residual connection refers to the operation of adding the input sequence directly to the output of the sublayer so that the gradient and information can be better transmitted during the training process. Through the residual connection, the information in the input sequence can be more smoothly transmitted to the subsequent sublayers, avoiding information loss. The normalization layer is an operation that normalizes the output of the sublayer, which can stabilize the learning of the model during training, increase the convergence speed of the model, and improve the generalization ability of the model.

[0109] In a specific example, the initial encoding model includes: embedding layer, feature fusion layer, position encoding layer, multi-layer encoder layer and output layer from input to output. Each encoder layer includes: multi-head self-attention mechanism layer, feedforward neural network, residual connection layer and normalization layer. First, the categorical features (such as interaction mode, interaction object, interaction scene, charging status, driving mode, road, weather, traffic conditions, etc.) in the training samples are mapped to embedding vectors through the embedding layer, and the numerical features (battery, fuel, temperature, time, vehicle speed, gear) are processed by standardization; in the feature fusion layer, the embedding vector is combined with the numerical feature. Then, positional encoding is added to introduce the sequential information of historical interaction behavior. Next, the processed data is input into multiple encoder layers (EncoderLayers), each of which contains: Multi-Head Self-Attention Mechanism, which is used to capture the dependencies between behaviors; Feed-Forward Neural Network, which performs nonlinear transformations on features; and Residual Connections and Normalization Layers to stabilize training and accelerate convergence. The output layer contains a classification prediction layer (for predicting categorical features) and a regression prediction layer (for predicting numerical features) for the masked behaviors. The initial encoding model is trained by minimizing the loss (such as cross entropy, mean square error) between the predicted value and the true value (the label corresponding to the training sample) to learn the patterns and relationships in the historical interaction behavior data.

[0110] In this embodiment, by converting multiple user historical interaction behavior data into high-dimensional vectors, it is possible to perform deep feature extraction on the user historical interaction behavior data, retain sequence information, and capture the complex relationship between interaction behaviors, thereby improving the efficiency and accuracy of the subsequent screening process.

[0111] Optionally, before screening the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain the target high-dimensional vector set, the method further includes:

[0112] The test condition data is input into the target coding model.

[0113] In this embodiment, the test condition data may be a test requirement to be tested, which may be used to characterize a standard rule for testing a vehicle. For example, the test condition data may be scenario requirement information of a test case to be generated that is related to a vehicle design specification.

[0114] In this embodiment, the test condition data are spliced ​​and the spliced ​​test condition data are input into the target coding model.

[0115] Obtain a high-dimensional vector corresponding to the test condition data output by the encoder of the target coding model.

[0116] In this embodiment, the output of the encoder of the target coding model is a high-dimensional vector. After the test condition data is input into the target coding model, the output of the encoder of the target coding model is a high-dimensional vector corresponding to the test condition data.

[0117] It should be noted that the target encoding model can transform each feature in the test condition data into a vector using the same embedding method, and use the same encoder to combine the above vectors into a high-dimensional vector.

[0118] The technical solution provided by the embodiment of the present invention can perform deep feature extraction on the test condition data by converting the test condition data into a high-dimensional vector, thereby improving the efficiency and accuracy of the subsequent screening process.

[0119] Optionally, the historical interaction behavior data of each user includes: a historical interaction behavior sequence corresponding to each user, wherein the historical interaction behavior sequence corresponding to the user is an interaction behavior sequence obtained by sorting the historical interaction behavior sub-data collected within a preset time in chronological order;

[0120] Generate training sample sets based on multiple user historical interaction behavior data, including:

[0121] The other user historical interaction behavior sub-data except the user historical interaction behavior sub-data corresponding to the Nth time point in each user historical interaction behavior sequence are determined as training samples, and the user historical interaction behavior sub-data corresponding to the Nth time point is determined as the label corresponding to the training sample, where N is a positive integer.

[0122] In this embodiment, a cockpit tracking system is deployed on different types of vehicles, and the cockpit tracking system is used to obtain the historical interaction behavior sub-data generated by different users when operating different models. The collected historical interaction behavior sub-data of multiple users are divided to obtain a set of historical interaction behavior sub-data corresponding to each user, and the historical interaction behavior sub-data corresponding to each user are sorted according to the time when the historical interaction behavior sub-data is collected to obtain a historical interaction behavior sequence corresponding to each user. In a specific example, the historical interaction behavior sequence of user A1 includes: historical interaction behavior sub-data collected at the first time point, historical interaction behavior sub-data collected at the second time point, historical interaction behavior sub-data collected at the third time point, and historical interaction behavior sub-data collected at the fourth time point. The historical interaction behavior sequence consisting of the historical interaction behavior sub-data collected at the first time point, the historical interaction behavior sub-data collected at the second time point, and the historical interaction behavior sub-data collected at the fourth time point is determined as a training sample. The historical interaction behavior sub-data collected at the third time point is determined as the label corresponding to the training sample.

[0123] A training sample set is generated according to the training samples and labels corresponding to the training samples.

[0124] The technical solution provided by the embodiment of the present invention masks the user historical behavior sub-data corresponding to the Nth time point in the historical interaction behavior sequence, generates a training sample set, trains the initial coding model, obtains the target coding model, and then converts the test condition data and each user's historical interaction behavior sequence into a high-dimensional vector based on the trained target coding model. It is possible to perform deep feature extraction on the test condition data and each user's historical interaction behavior sequence, thereby improving the efficiency and accuracy of the subsequent screening process.

[0125] S102 . Screen the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain a target high-dimensional vector set.

[0126] In this embodiment, according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, the initial high-dimensional vector set is screened to obtain the target high-dimensional vector set in a manner that: obtain the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, determine the initial high-dimensional vector in the initial high-dimensional vector set whose similarity is greater than the similarity threshold as the target high-dimensional vector, and generate the target high-dimensional vector set according to the target high-dimensional vector. According to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, the initial high-dimensional vector set is screened to obtain the target high-dimensional vector set in a manner that: obtain the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, obtain the occurrence frequency of the user historical interaction behavior data corresponding to the initial high-dimensional vector whose similarity is greater than the similarity threshold, determine the initial high-dimensional vector whose occurrence frequency is greater than the frequency threshold and whose similarity is greater than the similarity threshold as the target high-dimensional vector, and generate the target high-dimensional vector set according to the target high-dimensional vector.

[0127] Optionally, before screening the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain the target high-dimensional vector set, the method further includes:

[0128] Obtain the cosine similarity and / or Euclidean distance between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set.

[0129] In this embodiment, cosine similarity is a method for measuring the similarity between two vectors. It evaluates their similarity by calculating the cosine value of the angle between the two vectors. Cosine similarity is an effective similarity measurement method that only depends on the direction information of the vector and is not affected by the length of the vector. This makes it very robust when processing vectors of different lengths.

[0130] In this embodiment, the Euclidean distance represents each data point as a vector in a high-dimensional space, and then calculates the straight-line distance between the two vectors. The smaller the calculated value is, the closer the two vectors are, and the higher the similarity is.

[0131] The similarity between the high dimensional vector corresponding to the test condition data and each initial high dimensional vector in the initial high dimensional vector set is determined based on the cosine similarity and / or Euclidean distance between the high dimensional vector corresponding to the test condition data and each initial high dimensional vector in the initial high dimensional vector set.

[0132] In this embodiment, the similarity between the high dimensional vector corresponding to the test condition data and each initial high dimensional vector in the initial high dimensional vector set is determined based on the cosine similarity and Euclidean distance between the high dimensional vector corresponding to the test condition data and each initial high dimensional vector in the initial high dimensional vector set, and the weight corresponding to the cosine similarity and the weight corresponding to the Euclidean distance.

[0133] The technical solution provided by the embodiment of the present invention determines the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set through cosine similarity and / or Euclidean distance, and then screens based on the similarity, thereby screening out user historical interaction behavior data that is more consistent with the test condition data.

[0134] Optionally, the initial high-dimensional vector set is screened according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain a target high-dimensional vector set, including:

[0135] According to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, the initial high-dimensional vector set is screened to obtain a screened initial high-dimensional vector set.

[0136] In this embodiment, the similarity between the initial high-dimensional vectors in the screened initial high-dimensional vector set and the high-dimensional vectors corresponding to the test condition data is greater than a similarity threshold. The similarity threshold may be a preset value, which is not limited in the embodiment of the present invention.

[0137] In this embodiment, the initial high-dimensional vector set is screened according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, and the method for obtaining the screened initial high-dimensional vector set can be: obtaining the initial high-dimensional vectors in the initial high-dimensional vectors whose similarity with the high-dimensional vector corresponding to the test condition data is greater than a similarity threshold, and determining the screened initial high-dimensional vector set according to the initial high-dimensional vectors in the initial high-dimensional vectors whose similarity is greater than the similarity threshold.

[0138] The occurrence frequency of the user historical interaction behavior data corresponding to each high-dimensional vector in the filtered initial high-dimensional vector set is obtained.

[0139] In this embodiment, the method for obtaining the frequency of occurrence of user historical interaction behavior data corresponding to each high-dimensional vector in the filtered initial high-dimensional vector set can be: collecting multiple user historical interaction behavior data, obtaining the frequency of occurrence of each user historical interaction behavior data, storing the user historical interaction behavior data and the frequency of occurrence of the user historical interaction behavior data in correspondence, and after similarity-based filtering, querying the frequency of occurrence of user historical interaction behavior data corresponding to each high-dimensional vector in the filtered initial high-dimensional vector set.

[0140] It should be noted that the cockpit tracking system is deployed on different types of vehicles, and the historical interaction behavior sub-data generated by different users when operating different models are obtained through the cockpit tracking system. The collected historical interaction behavior sub-data of multiple users are divided to obtain a set of historical interaction behavior sub-data corresponding to each user. According to the time when the historical interaction behavior sub-data is collected, the historical interaction behavior sub-data corresponding to each user is sorted to obtain the historical interaction behavior sequence corresponding to each user. The historical interaction behavior sequence corresponding to each user may be repeated, and the number of repetitions of the historical interaction behavior sequence corresponding to each user, that is, the frequency of occurrence, is obtained.

[0141] The filtered initial high-dimensional vector set is filtered according to the occurrence frequency of the user historical interaction behavior data corresponding to each high-dimensional vector to obtain a target high-dimensional vector set.

[0142] In this embodiment, the filtered initial high-dimensional vector set is secondary screened according to the frequency of occurrence of the user historical interaction behavior data corresponding to each high-dimensional vector, and the method for obtaining the target high-dimensional vector set can be: the high-dimensional vector corresponding to the user historical interaction behavior data with an occurrence frequency greater than the frequency threshold in the filtered initial high-dimensional vector set is determined as the target high-dimensional vector, thereby obtaining the target high-dimensional vector set.

[0143] It should be noted that the ones with high frequency of occurrence can be selected as test cases, and other historical interaction behavior data can be used as supplements or references.

[0144] The technical solution provided by the embodiment of the present invention obtains a target high-dimensional vector set by first screening the initial high-dimensional vector set based on similarity and then performing a secondary screening based on the frequency of occurrence. This can ensure the executable nature of the test cases generated based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set, thereby improving the test coverage.

[0145] S103: Generate test cases corresponding to each target high-dimensional vector based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set.

[0146] In this embodiment, based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set, a method for generating test cases corresponding to each target high-dimensional vector can be: determining a test sequence corresponding to each target high-dimensional vector in the target high-dimensional vector set according to the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set and a first knowledge base; determining a test case corresponding to each target high-dimensional vector according to the test sequence corresponding to each target high-dimensional vector in the target high-dimensional vector set and a second knowledge base.

[0147] The technical solution of this embodiment is to first obtain an initial high-dimensional vector set corresponding to multiple user historical interaction behavior data; then screen the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain a target high-dimensional vector set; finally, based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set, generate test cases corresponding to each target high-dimensional vector. The generated test cases are more in line with the real cockpit interaction scene, improve the authenticity and effectiveness of the test cases, and can improve the efficiency of test case generation.

[0148] Embodiment 2

[0149] Figure 2 It is a flowchart of the second test case generation method in the embodiment of the present invention, and this embodiment is optimized based on the above embodiment. In this embodiment, based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set, the test cases corresponding to each target high-dimensional vector are generated, including: obtaining the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set; inputting the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set and the first knowledge base into the target verification point supplement model to obtain the test sequence corresponding to each target high-dimensional vector, the target verification point supplement model is obtained by training the initial verification point supplement model with the first sample set, the first sample set includes: the first sample and the label corresponding to the first sample, the first sample is the interaction behavior sequence sample with missing verification points, the label corresponding to the first sample is the complete interaction behavior sequence after the verification points are supplemented, the first knowledge base includes: the verification point and the associated interaction behavior data of the verification point; the test sequence corresponding to each target high-dimensional vector and the second knowledge base are input into the target test case generation model to obtain the test case corresponding to each target high-dimensional vector, the second knowledge base includes: the interaction behavior data and the test case corresponding to the interaction behavior data. As Figure 2 As shown, the method specifically comprises the following steps:

[0150] S201. Obtain an initial high-dimensional vector set corresponding to multiple user historical interaction behavior data.

[0151] S202: Screen the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain a target high-dimensional vector set.

[0152] S203: Obtain user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set.

[0153] In this embodiment, after multiple user historical interaction behavior data are sequentially input into the target coding model and an initial high-dimensional vector set corresponding to each user historical interaction behavior data output by the encoder of the target coding model is obtained, each initial high-dimensional vector in the initial high-dimensional vector set and the corresponding user historical interaction behavior data are stored, and the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set can be obtained by querying the above storage content.

[0154] S204: Input the user historical interaction behavior data and the first knowledge base corresponding to each target high-dimensional vector in the target high-dimensional vector set into the target verification point supplement model to obtain a test sequence corresponding to each target high-dimensional vector.

[0155] In this embodiment, the target verification point supplement model is obtained by training the initial verification point supplement model with a first sample set, and the first sample set includes: a first sample and a label corresponding to the first sample, the first sample is an interactive behavior sequence sample with missing verification points, and the label corresponding to the first sample is a complete interactive behavior sequence after the verification points are supplemented.

[0156] In this embodiment, the initial verification point supplementary model may be: a large language model, which is used to understand and analyze the natural language input by the user, such as a multimodal large language model, a text recognition large language model, etc.

[0157] In this embodiment, the target verification point supplement model may be: a large language model after training, and the target verification point supplement model may be used to supplement the missing verification points, thereby obtaining a complete interaction behavior sequence after the supplemented verification points.

[0158] In this embodiment, the first sample set may be obtained by obtaining a complete interaction behavior sequence, deleting some verification points in the complete interaction behavior sequence as the first sample, and determining the complete interaction behavior sequence before deleting the verification points as the label corresponding to the first sample.

[0159] In this embodiment, the first knowledge base includes: verification points and associated interactive behavior data of the verification points. For example, the first knowledge base includes: verification point "Verification: Song Switch": appears after the action of "clicking the next control on the media bar".

[0160] S205 , input the test sequence corresponding to each target high-dimensional vector and the second knowledge base into a target test case generation model to obtain a test case corresponding to each target high-dimensional vector.

[0161] In this embodiment, the second knowledge base includes: interactive behavior data and test cases corresponding to the interactive behavior data. The test cases corresponding to the interactive behavior data may be in XML format, and it should be noted that the test cases have natural language annotations.

[0162] The technical solution provided in this embodiment first supplements the user's historical interactive behavior data with verification points to obtain a complete test sequence, and then inputs the complete test sequence and the second knowledge base into the target test case generation model to obtain a test case, that is, a test script. It can convert real interactive behavior data into test cases to obtain test cases that are more in line with real usage scenarios, and automatically generate test cases in the above manner without manual writing, which can reduce labor costs and improve testing efficiency.

[0163] Optionally, the initial validation point supplement model is trained by the first sample set, including:

[0164] The first sample in the first sample set is input into the initial verification point supplementation model to obtain a predicted interaction behavior sequence after the supplementation of the verification point.

[0165] In this embodiment, the first sample set includes: a first sample and a label corresponding to the first sample, wherein the first sample is an interactive behavior sequence sample with missing verification points, and the label corresponding to the first sample is a complete interactive behavior sequence after supplementing the verification points.

[0166] According to the difference between the predicted interaction behavior sequence after the supplementary verification point and the complete interaction behavior sequence after the supplementary verification point, the parameters of the initial verification point supplementary model are trained to obtain the target verification point supplementary model.

[0167] In this embodiment, based on the loss function, the difference between the predicted interaction behavior sequence after the supplementary verification point and the label corresponding to the first sample is determined, and the parameters of the initial verification point supplementation model are trained according to the difference between the predicted interaction behavior sequence after the supplementary verification point and the label corresponding to the first sample to obtain the target verification point supplementation model.

[0168] The technical solution provided in this embodiment obtains a target verification point supplement model by training an initial verification point supplement model, and then supplements the user's historical interaction behavior data based on the target verification point supplement model to obtain a more complete test sequence.

[0169] The technical solution provided by the present embodiment obtains an initial high-dimensional vector set corresponding to multiple users' historical interaction behavior data; screens the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain a target high-dimensional vector set; inputs the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set and the first knowledge base into a target verification point supplement model to obtain a test sequence corresponding to each target high-dimensional vector; inputs the test sequence corresponding to each target high-dimensional vector and the second knowledge base into a target test case generation model to obtain a test case corresponding to each target high-dimensional vector, thereby generating test cases that are more in line with actual usage scenarios.

[0170] Embodiment 3

[0171] Figure 3 This is a schematic diagram of the structure of a test case generation device provided by an embodiment of the present invention. This embodiment is applicable to the case of test case generation. The device can be implemented in software and / or hardware. The device can be integrated in any device that provides a test case generation function, such as Figure 3 As shown, the test case generating device specifically includes: an acquisition module 301, a screening module 302 and a generating module 303.

[0172] The acquisition module is used to obtain an initial high-dimensional vector set corresponding to multiple user historical interaction behavior data;

[0173] A screening module, used for screening the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain a target high-dimensional vector set;

[0174] A generation module is used to generate test cases corresponding to each target high-dimensional vector based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set.

[0175] The above-mentioned product can execute the test case generation method provided by any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.

[0176] Embodiment 4

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

[0178] like Figure 4 As shown, the electronic device 60 includes at least one processor 61, and a memory connected to the at least one processor 61 in communication, such as a read-only memory (ROM) 62, a random access memory (RAM) 63, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 61 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 62 or the computer program loaded from the storage unit 68 to the random access memory (RAM) 63. In the RAM 63, various programs and data required for the operation of the electronic device 60 can also be stored. The processor 61, the ROM 62, and the RAM 63 are connected to each other via a bus 64. An input / output (I / O) interface 65 is also connected to the bus 64.

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

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

[0181] In some embodiments, the test case generation method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 68. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 60 via the ROM 62 and / or the communication unit 69. When the computer program is loaded into the RAM 63 and executed by the processor 61, one or more steps of the test case generation method described above may be performed. Alternatively, in other embodiments, the processor 61 may be configured to execute the test case generation method in any other appropriate manner (e.g., by means of firmware).

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

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

[0184] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

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

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

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

[0188] In one embodiment, the embodiment of the present invention further includes a computer program product, the computer program product includes a computer program, and when the computer program is executed by a processor, the test case generation method of any embodiment of the present invention is implemented.

[0189] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present invention, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

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

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

Claims

1. A test case generation method, characterized in that: include: Obtain an initial high-dimensional vector set corresponding to multiple users' historical interaction behavior data; According to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, the initial high-dimensional vector set is screened to obtain a target high-dimensional vector set; Based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set, generating a test case corresponding to each target high-dimensional vector; Based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set, a test case corresponding to each target high-dimensional vector is generated, including: determining a test sequence corresponding to each target high-dimensional vector in the target high-dimensional vector set according to the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set and a first knowledge base, determining a test case corresponding to each target high-dimensional vector according to the test sequence corresponding to each target high-dimensional vector in the target high-dimensional vector set and a second knowledge base, the first knowledge base including: verification points and associated interaction behavior data of the verification points, and the second knowledge base including: interaction behavior data and test cases corresponding to the interaction behavior data.

2. The method according to claim 1, characterized in that Determining a test sequence corresponding to each target high-dimensional vector in the target high-dimensional vector set according to the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set and the first knowledge base, and determining a test case corresponding to each target high-dimensional vector according to the test sequence corresponding to each target high-dimensional vector in the target high-dimensional vector set and the second knowledge base, including: Obtaining user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set; Inputting the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set and the first knowledge base into a target verification point supplement model to obtain a test sequence corresponding to each target high-dimensional vector, wherein the target verification point supplement model is obtained by training an initial verification point supplement model with a first sample set, wherein the first sample set includes: a first sample and a label corresponding to the first sample, wherein the first sample is an interaction behavior sequence sample with a missing verification point, and the label corresponding to the first sample is a complete interaction behavior sequence after the verification point is supplemented; The test sequences corresponding to each target high-dimensional vector and the second knowledge base are input into the target test case generation model to obtain the test cases corresponding to each target high-dimensional vector.

3. The method according to claim 2, characterized in that The initial validation point supplement model is trained by the first sample set, including: Inputting the first sample in the first sample set into the initial verification point supplementation model to obtain a predicted interaction behavior sequence after the supplementation verification point; According to the difference between the predicted interaction behavior sequence after the supplementary verification point and the complete interaction behavior sequence after the supplementary verification point, the parameters of the initial verification point supplementary model are trained to obtain the target verification point supplementary model.

4. The method according to any one of claims 1 to 3, characterized in that Get the initial high-dimensional vector set corresponding to multiple user historical interaction behavior data, including: Generate a training sample set based on multiple users' historical interaction behavior data; The initial coding model is trained according to the training sample set to obtain a target coding model, wherein the initial coding model includes: an encoder; Inputting the plurality of user historical interaction behavior data into the target coding model in sequence; An initial high-dimensional vector set corresponding to each user's historical interaction behavior data output by the encoder of the target coding model is obtained.

5. The method according to claim 4, characterized in that Before the initial high-dimensional vector set is screened according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain the target high-dimensional vector set, the method further includes: inputting the test condition data into the target coding model; Obtain a high-dimensional vector corresponding to the test condition data output by the encoder of the target coding model.

6. The method according to claim 4, characterized in that The historical interaction behavior data of each user includes: a historical interaction behavior sequence corresponding to each user, wherein the historical interaction behavior sequence corresponding to the user is an interaction behavior sequence obtained by sorting the historical interaction behavior sub-data collected within a preset time in chronological order; Generate a training sample set based on multiple user historical interaction behavior data, including: Determine the other user historical interaction behavior sub-data except the user historical interaction behavior sub-data corresponding to the Nth time point in each user historical interaction behavior sequence as training samples, and determine the user historical interaction behavior sub-data corresponding to the Nth time point as the label corresponding to the training sample, where N is a positive integer; A training sample set is generated according to the training samples and labels corresponding to the training samples.

7. The method according to any one of claims 1 to 3, characterized in that Before the initial high-dimensional vector set is screened according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain the target high-dimensional vector set, the method further includes: Obtaining the cosine similarity and / or Euclidean distance between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set; The similarity between the high dimensional vector corresponding to the test condition data and each initial high dimensional vector in the initial high dimensional vector set is determined based on the cosine similarity and / or Euclidean distance between the high dimensional vector corresponding to the test condition data and each initial high dimensional vector in the initial high dimensional vector set.

8. The method according to any one of claims 1 to 3, characterized in that According to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, the initial high-dimensional vector set is screened to obtain a target high-dimensional vector set, including: According to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set, the initial high-dimensional vector set is screened to obtain a screened initial high-dimensional vector set; Obtaining the occurrence frequency of the user historical interaction behavior data corresponding to each high-dimensional vector in the filtered initial high-dimensional vector set; The filtered initial high-dimensional vector set is filtered according to the occurrence frequency of the user historical interaction behavior data corresponding to each high-dimensional vector to obtain a target high-dimensional vector set.

9. The method according to any one of claims 1 to 3, characterized in that: User historical interaction behavior data includes: interaction information, vehicle information and environment information.

10. A test case generating device, characterized in that: include: An acquisition module is used to acquire an initial high-dimensional vector set corresponding to multiple user historical interaction behavior data; A screening module, used for screening the initial high-dimensional vector set according to the similarity between the high-dimensional vector corresponding to the test condition data and each initial high-dimensional vector in the initial high-dimensional vector set to obtain a target high-dimensional vector set; A generation module, used to generate test cases corresponding to each target high-dimensional vector based on the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set; The generation module is specifically used to: determine the test sequence corresponding to each target high-dimensional vector in the target high-dimensional vector set according to the user historical interaction behavior data corresponding to each target high-dimensional vector in the target high-dimensional vector set and the first knowledge base; determine the test case corresponding to each target high-dimensional vector in the target high-dimensional vector set according to the test sequence corresponding to each target high-dimensional vector in the target high-dimensional vector set and the second knowledge base, the first knowledge base including: verification points and associated interaction behavior data of the verification points, and the second knowledge base including: interaction behavior data and test cases corresponding to the interaction behavior data.

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

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

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

Citation Information

Patent Citations

  • Test case generation method and device, electronic equipment and storage medium

    CN117573507A