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

By desensitizing user behavior data and using test case generation models to generate test cases, the problem that the existing technology cannot protect user privacy while ensuring the quality of test cases, and high-quality test case generation is achieved.

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

Patent Information

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

AI Technical Summary

Technical Problem

Existing test case generation methods cannot guarantee the quality of test cases while protecting user privacy.

Method used

By obtaining user behavior data, determining the noise generation algorithm based on the data properties, generating noise data for data desensitization processing, obtaining desensitization data, and generating corresponding test cases using the test case generation model.

Benefits of technology

While protecting user privacy, sufficient information is retained for subsequent analysis or research, thereby ensuring the quality of the test cases and the accuracy of the test.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119473911A_ABST
    Figure CN119473911A_ABST
Patent Text Reader

Abstract

The invention discloses a test case generation method and device, electronic equipment and a storage medium. The method comprises the steps of obtaining user behavior data, and determining a noise generation algorithm based on data properties of the user behavior data; generating noise data based on the noise generation algorithm and a preset privacy budget, and performing data desensitization processing based on the noise data and the user behavior data to obtain desensitized data; based on the desensitization data, using a test case generation model to generate a test case corresponding to the user behavior data; wherein the test case generation model is obtained by training on the basis of historical user behavior data and test cases corresponding to the historical user behavior data. According to the method, data desensitization is carried out on the user behavior data, the test case is generated based on the desensitization data, and sufficient information is reserved for subsequent analysis or research use while user privacy is protected, so that the quality of the test case is ensured, and the test accuracy is ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a test case generation method, device, electronic equipment and storage medium. Background Art

[0002] A test case is a collection of input data and expected results for software testing. A good test case should be able to cover as many software functions and boundary conditions as possible to comprehensively evaluate the performance and stability of the software.

[0003] However, existing test case generation methods cannot ensure the quality of test cases while protecting user privacy. Summary of the invention

[0004] The present invention provides a test case generation method, device, electronic device and storage medium, which can protect user privacy while ensuring the quality of the test case.

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

[0006] Acquire user behavior data, and determine a noise generation algorithm based on data properties of the user behavior data;

[0007] Generate noise data based on the noise generation algorithm and the preset privacy budget, and perform data desensitization processing based on the noise data and the user behavior data to obtain desensitized data;

[0008] Based on the desensitized data, a test case generation model is used to generate a test case corresponding to the user behavior data; wherein the test case generation model is trained based on historical user behavior data and test cases corresponding to the historical user behavior data.

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

[0010] A noise generation algorithm determination module, used to obtain user behavior data and determine a noise generation algorithm based on the data properties of the user behavior data;

[0011] A data desensitization module, used to generate noise data based on the noise generation algorithm and a preset privacy budget, and perform data desensitization processing based on the noise data and the user behavior data to obtain desensitized data;

[0012] A test case generation module is used to generate test cases corresponding to the user behavior data based on the desensitized data using a test case generation model; wherein the test case generation model is trained based on historical user behavior data and test cases corresponding to the historical user behavior data.

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

[0014] at least one processor; and

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

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

[0017] 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.

[0018] The technical solution of the embodiment of the present invention obtains user behavior data, determines a noise generation algorithm based on the data properties of the user behavior data; generates noise data based on the noise generation algorithm and a preset privacy budget, performs data desensitization processing based on the noise data and the user behavior data to obtain desensitized data; and generates test cases corresponding to the user behavior data using a test case generation model based on the desensitized data. Desensitizing the user behavior data protects user privacy while retaining sufficient information for subsequent analysis or research, thereby ensuring the quality of the test cases and the accuracy of the test.

[0019] 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

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

[0021] Figure 1 is a flow chart of a test case generation method provided in Embodiment 1 of the present invention;

[0022] Figure 2 is a structural schematic diagram of a test case generating device provided in Embodiment 2 of the present invention;

[0023] Figure 3It is a structural schematic diagram of an electronic device provided in Embodiment 3 of the present invention. DETAILED DESCRIPTION

[0024] 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.

[0025] 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.

[0026] The acquisition, storage and / or processing of data in the technical solutions involved in this application comply with the relevant provisions of national laws and regulations.

[0027] Embodiment 1

[0028] Figure 1 1 is a flow chart of a test case generation method provided by the first embodiment of the present invention. This embodiment is applicable to test case generation. The method can be executed by a test case generation device. The test case generation device can be implemented in the form of hardware and / or software. The test case generation device can be configured in a computer, a server, etc. Figure 1 As shown, the method includes:

[0029] S110: Acquire user behavior data, and determine a noise generation algorithm based on data properties of the user behavior data.

[0030] Among them, user behavior data refers to the operation data of the user in the software. Specifically, user behavior data includes but is not limited to operations such as clicking, sliding, and inputting, which are not limited here. In an embodiment of the present invention, a data collection module is set in the software to automatically capture user behavior data. Furthermore, the noise generation algorithm is determined based on the data properties of the user behavior data. Among them, the data properties include discrete data and continuous data. The noise generation algorithm is an algorithm for generating random or pseudo-random data, which (i.e., noise) is added to the original data to cover up or blur the true value of the original data. The noise generation algorithm includes but is not limited to the Laplace mechanism, Gaussian mechanism, exponential mechanism, etc.; among them, the Laplace mechanism and Gaussian mechanism are applicable to continuous data, and the exponential mechanism is applicable to discrete data.

[0031] In some embodiments, after acquiring the user behavior data, the method further includes: preprocessing the user behavior data, and performing data enhancement operations on the preprocessed user behavior data; the data enhancement operations include one or more of sequence rearrangement, time delay, parameter perturbation, scenario simulation, and reverse engineering.

[0032] In an embodiment of the present invention, the user behavior data is preprocessed, and the preprocessing includes but is not limited to cleaning, deduplication and format conversion. Further, the preprocessed user behavior data is subjected to data enhancement operations. Specifically, the user behavior data can be sequenced and rearranged, for example, a series of click operations of the user are reordered to generate new data samples. This method can increase the diversity and generalization ability of the data. It is also possible to introduce time delays in the user behavior data to simulate the user's operations at different time points. For example, an operation can be delayed for a few seconds before being executed to generate different data samples. It is also possible to perform parameter perturbations on the parameters in the user behavior data, for example, changing the click position or sliding speed to generate different data samples. It is also possible to simulate different user scenarios to generate data. For example, simulate user behavior data in scenarios such as different devices, network environments, and user identities. It is also possible to reversely generate relevant user behavior data based on known software defects or abnormal behavior patterns. This method can help generate representative abnormal data samples.

[0033] For example, taking user click data as an example, it is assumed that the user click sequence before the data enhancement operation is:

[0034] 1. Click the "Home" button;

[0035] 2. Click the "Search" button;

[0036] 3. Input the text "Sample Text";

[0037] 4. Click the "Search" button.

[0038] Through data enhancement operations, various transformations can be performed on the original user click data to generate more data samples. For example:

[0039] 1. Reverse order:

[0040] 1. Click the "Search" button;

[0041] 2. Input the text "Sample Text";

[0042] 3. Click the "Search" button;

[0043] 4. Click the "Home" button.

[0044] 2. Time delay:

[0045] 1. Click the "Home" button (execute immediately);

[0046] 2. Wait for 3 seconds and click the "Search" button;

[0047] 3. Wait for 2 seconds and enter the text "Sample Text";

[0048] 4. Wait for 1 second and click the "Search" button.

[0049] 3. Parameter perturbation:

[0050] After entering text, delay the click by 1 second. When clicking the "Search" button, slightly change the click position.

[0051] 4. Situation simulation:

[0052] To simulate a poor network connection, delay the execution of each action. To simulate the use of a tablet device, simulate the click location on a large screen.

[0053] Reverse Engineering:

[0054] Simulates repeated or rapid click behavior based on known software bug patterns.

[0055] The embodiment of the present invention can effectively enhance the user behavior data by preprocessing the user behavior data and performing data enhancement operations on the preprocessed user behavior data, thereby generating more data samples, expanding the data set of the user behavior data, and improving the diversity and generalization ability of the data.

[0056] S120: Generate noise data based on the noise generation algorithm and a preset privacy budget, and perform data desensitization processing based on the noise data and the user behavior data to obtain desensitized data.

[0057] Among them, the preset privacy budget represents the maximum allowed noise level, which determines the degree of data desensitization. The higher the preset privacy budget, the less noise is added, the higher the fidelity of the data, but the greater the risk of privacy leakage; conversely, the lower the preset privacy budget, the more noise is added, the higher the degree of privacy protection of the data, but the availability of the data may be reduced. In an embodiment of the present invention, a noise generation algorithm is used to generate noise data that matches the data scale and dimension based on the preset privacy budget. Further, data desensitization is performed based on the noise data and user behavior data to obtain desensitized data. Among them, the desensitized data is the data after the user behavior data is desensitized.

[0058] Based on the above embodiment, optionally, generating noise data based on the noise generation algorithm and a preset privacy budget includes: determining the noise amount based on the preset privacy budget and query sensitivity; and generating noise data based on the noise generation algorithm and the noise amount.

[0059] The amount of noise refers to the amount of noise data, which is determined by a preset privacy budget. In an embodiment of the present invention, the amount of noise is determined based on a preset privacy budget and query sensitivity. Query sensitivity indicates the sensitivity of a query function to data changes. Sensitivity is usually defined as the maximum amount of change that may occur in a query result when any single data item changes. The amount of noise is directly related to the privacy budget and query sensitivity. For example, taking the Laplace mechanism as an example, the calculation formula for the amount of noise is as follows:

[0060] σ=Δf / ε

[0061] Among them, σ represents the amount of noise, Δf represents the query sensitivity, and ε represents the privacy budget. It can be understood that under a given privacy budget, the higher the query sensitivity, the greater the amount of noise required; conversely, the lower the query sensitivity, the smaller the amount of noise required.

[0062] Further, noise data is generated based on the noise generation algorithm and the noise amount. Exemplarily, in the Laplace mechanism, a random number generator satisfying the Laplace distribution can be used to generate noise data.

[0063] On the basis of the above embodiment, optionally, the data desensitization processing is performed based on the noise data and the user behavior data to obtain the desensitized data, including: standardizing the user behavior data; adding the noise data to the standardized user behavior data based on a preset desensitization strategy to obtain the desensitized data.

[0064] In an embodiment of the present invention, the user behavior data is standardized, and noise data is added to the user behavior data based on a preset desensitization strategy to obtain desensitized data. The preset desensitization strategy may be to add the user behavior data and the noise data, or to mix the user behavior data and the noise data in a preset ratio.

[0065] For example, taking user click data as an example, the desensitized data is as follows:

[0066] User ID Timestamp Click Location Click on the element 1 1623721030 99.5,201.5 link1 1 1623721040 198.5,302.5 link2 2 1623721050 48.5,151.5 link3 2 1623721060 297.5,398.5 link4

[0067] In some embodiments, optionally, after obtaining the desensitized data, the method further includes: determining the difference between the two adjacent data sets based on the probability distribution of the two adjacent data sets in the desensitized data; wherein the probability distribution refers to the probability distribution that the random variables in the two adjacent data sets belong to any subset of the desensitized data; when the difference between the two adjacent data sets is greater than a preset difference threshold, adjusting the preset privacy budget, and re-performing desensitization processing based on the adjusted privacy budget.

[0068] Among them, adjacent data sets may refer to a set of adjacent data points in a time series, or a data area that is adjacent in space. In an embodiment of the present invention, after obtaining the desensitized data, the desensitization effect is tested. Specifically, the difference between the two adjacent data sets is determined based on the probability distribution of the two adjacent data sets in the desensitized data. If the difference between the two adjacent data sets is greater than the preset difference threshold, it means that the difference between the adjacent data sets is too large, which may lead to excessive desensitization of the data. The preset privacy budget is further adjusted, and the user behavior data is desensitized again. Repeat the above operations until the difference between the adjacent data sets is less than the preset difference threshold, or other preset stop conditions are met. Among them, the preset stop condition may be reaching a preset upper limit on the number of iterations.

[0069] Specifically, the calculation formula for the difference between two adjacent data sets is as follows:

[0070]

[0071] Where D(P, Q) represents the difference between two adjacent data sets, P and Q are two adjacent data sets in the masked data, P(X∈S) represents the probability of the random variable X∈S in the data set P, Q(X∈S) represents the probability of the random variable X∈S in the data set Q, and S is any subset of the masked data R.

[0072] S130. Based on the desensitized data, use a test case generation model to generate a test case corresponding to the user behavior data; wherein the test case generation model is trained based on historical user behavior data and test cases corresponding to the historical user behavior data.

[0073] The test case generation model may be a machine learning model, and the test case generation model is trained based on historical user behavior data and test cases corresponding to the historical user behavior data. In an embodiment of the present invention, based on the desensitized data, a test case generation model is used to generate a test case corresponding to the user behavior data. The test case includes test steps, expected results, and verification conditions.

[0074] On the basis of the above embodiment, optionally, based on the desensitized data, a test case corresponding to the user behavior data is generated using a test case generation model, including: inputting the desensitized data into the test case generation model to generate at least one test case corresponding to the user behavior data, and the test case covers the business scenarios and user behavior paths corresponding to the user behavior data.

[0075] In an embodiment of the present invention, the desensitized data is used as input to the test case generation model to generate at least one test case corresponding to the user behavior data. It should be noted that the generated test cases cover various business scenarios and user behavior paths corresponding to the user behavior data. For example, in an e-commerce application, the test cases may include various steps such as user browsing products, adding to shopping carts, checkout, and payment.

[0076] In some embodiments, optionally, after generating a test case corresponding to the user behavior data, the method further includes: executing the test case based on an automated testing tool to generate a test result.

[0077] In an embodiment of the present invention, an automated testing tool is selected, and test cases are automatically executed based on the automated testing tool to generate test results, and the test results are displayed in the form of a visual report or dashboard. In this embodiment, software performance and potential defects can be understood through the visual test results, providing a basis for software product optimization.

[0078] In some embodiments, the test cases may also be continuously optimized based on the test results to improve the effectiveness of the test.

[0079] The technical solution of this embodiment obtains user behavior data, determines a noise generation algorithm based on the data properties of the user behavior data; generates noise data based on the noise generation algorithm and a preset privacy budget, performs data desensitization processing based on the noise data and the user behavior data to obtain desensitized data; and generates test cases corresponding to the user behavior data using a test case generation model based on the desensitized data. Desensitizing the user behavior data protects user privacy while retaining sufficient information for subsequent analysis or research, thereby ensuring the quality of the test cases and the accuracy of the test.

[0080] Embodiment 2

[0081] Figure 2 It is a structural schematic diagram of a test case generating device provided in Embodiment 2 of the present invention.

[0082] like Figure 2 As shown, the device comprises:

[0083] A noise generation algorithm determination module 210 is used to obtain user behavior data and determine a noise generation algorithm based on the data properties of the user behavior data;

[0084] A data desensitization module 220, configured to generate noise data based on the noise generation algorithm and a preset privacy budget, and perform data desensitization processing based on the noise data and the user behavior data to obtain desensitized data;

[0085] The test case generation module 230 is used to generate test cases corresponding to the user behavior data based on the desensitized data using a test case generation model; wherein the test case generation model is trained based on historical user behavior data and test cases corresponding to the historical user behavior data.

[0086] The technical solution of this embodiment obtains user behavior data, determines a noise generation algorithm based on the data properties of the user behavior data; generates noise data based on the noise generation algorithm and a preset privacy budget, performs data desensitization processing based on the noise data and the user behavior data to obtain desensitized data; and generates test cases corresponding to the user behavior data using a test case generation model based on the desensitized data. Desensitizing the user behavior data protects user privacy while retaining sufficient information for subsequent analysis or research, thereby ensuring the quality of the test cases and the accuracy of the test.

[0087] Based on the above embodiment, optionally, the device further includes a preprocessing module, which is used to:

[0088] The user behavior data is preprocessed, and a data enhancement operation is performed on the preprocessed user behavior data; the data enhancement operation includes one or more of sequence rearrangement, time delay, parameter perturbation, scenario simulation and reverse engineering.

[0089] Based on the above embodiment, optionally, the data desensitization module 220 includes a noise generation unit, which is used to:

[0090] determining an amount of noise based on the preset privacy budget and query sensitivity;

[0091] Noise data is generated based on the noise generation algorithm and the noise amount.

[0092] Based on the above embodiment, optionally, the data desensitization module 220 includes a noise adding module for:

[0093] Performing standardization on the user behavior data;

[0094] Based on a preset desensitization strategy, the noise data is added to the user behavior data after standardization to obtain desensitized data.

[0095] Based on the above embodiment, optionally, the device further includes a desensitized data detection module, which is used to:

[0096] Determining the difference between the two adjacent data sets based on the probability distribution of the two adjacent data sets in the desensitized data; wherein the probability distribution refers to the probability distribution that the random variables in the two adjacent data sets belong to any subset of the desensitized data;

[0097] When the difference between the two adjacent data sets is greater than a preset difference threshold, the preset privacy budget is adjusted, and desensitization processing is performed again based on the adjusted privacy budget.

[0098] Based on the above embodiment, optionally, the test case generation module 230 is used to:

[0099] The desensitized data is input into a test case generation model to generate at least one test case corresponding to the user behavior data, wherein the test case covers the business scenarios and user behavior paths corresponding to the user behavior data.

[0100] Based on the above embodiment, optionally, the device further includes a test case execution module, which is used to execute the test case based on an automated testing tool to generate a test result.

[0101] The test case generation device provided in the embodiment of the present invention can execute the test case generation method provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.

[0102] Embodiment 3

[0103] Figure 3 1 is a schematic diagram of the structure of an electronic device provided in Embodiment 3 of the present invention. The electronic device 10 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 may 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.

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

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

[0106] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various 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 11 executes the various methods and processes described above, such as a test case generation method.

[0107] 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 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the test case generation method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the test case generation method in any other appropriate manner (e.g., by means of firmware).

[0108] 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.

[0109] The computer programs for implementing the test case generation method of the present invention can be written in any combination of one or more programming languages. These computer programs can 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 can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0110] Embodiment 4

[0111] Embodiment 4 of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to cause a processor to execute a test case generation method, the method comprising:

[0112] Acquire user behavior data, and determine a noise generation algorithm based on data properties of the user behavior data;

[0113] Generate noise data based on the noise generation algorithm and the preset privacy budget, and perform data desensitization processing based on the noise data and the user behavior data to obtain desensitized data;

[0114] Based on the desensitized data, a test case generation model is used to generate a test case corresponding to the user behavior data; wherein the test case generation model is trained based on historical user behavior data and test cases corresponding to the historical user behavior data.

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

[0116] 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).

[0117] 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.

[0118] 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.

[0119] 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.

[0120] 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: Acquire user behavior data, and determine a noise generation algorithm based on data properties of the user behavior data; Generate noise data based on the noise generation algorithm and the preset privacy budget, and perform data desensitization processing based on the noise data and the user behavior data to obtain desensitized data; Based on the desensitized data, a test case generation model is used to generate a test case corresponding to the user behavior data; wherein the test case generation model is trained based on historical user behavior data and test cases corresponding to the historical user behavior data.

2. The method according to claim 1, characterized in that After obtaining the user behavior data, the method further includes: The user behavior data is preprocessed, and a data enhancement operation is performed on the preprocessed user behavior data; the data enhancement operation includes one or more of sequence rearrangement, time delay, parameter perturbation, scenario simulation and reverse engineering.

3. The method according to claim 1, characterized in that The generating noise data based on the noise generation algorithm and the preset privacy budget includes: determining an amount of noise based on the preset privacy budget and query sensitivity; Noise data is generated based on the noise generation algorithm and the noise amount.

4. The method according to claim 3, characterized in that: The performing data desensitization processing based on the noise data and the user behavior data to obtain desensitized data includes: Performing standardization on the user behavior data; Based on a preset desensitization strategy, the noise data is added to the user behavior data after standardization to obtain desensitized data.

5. The method according to claim 1 or 4, characterized in that: After obtaining the desensitized data, the method further includes: Determining the difference between the two adjacent data sets based on the probability distribution of the two adjacent data sets in the desensitized data; wherein the probability distribution refers to the probability distribution that the random variables in the two adjacent data sets belong to any subset of the desensitized data; When the difference between the two adjacent data sets is greater than a preset difference threshold, the preset privacy budget is adjusted, and desensitization processing is performed again based on the adjusted privacy budget.

6. The method according to claim 1, characterized in that The step of generating a test case corresponding to the user behavior data based on the desensitized data using a test case generation model includes: The desensitized data is input into a test case generation model to generate at least one test case corresponding to the user behavior data, wherein the test case covers the business scenarios and user behavior paths corresponding to the user behavior data.

7. The method according to claim 1, characterized in that After generating the test case corresponding to the user behavior data, the method further includes: The test cases are executed based on an automated testing tool to generate test results.

8. A test case generating device, characterized in that: include: A noise generation algorithm determination module, used to obtain user behavior data and determine a noise generation algorithm based on the data properties of the user behavior data; A data desensitization module, used to generate noise data based on the noise generation algorithm and a preset privacy budget, and perform data desensitization processing based on the noise data and the user behavior data to obtain desensitized data; A test case generation module is used to generate test cases corresponding to the user behavior data based on the desensitized data using a test case generation model; wherein the test case generation model is trained based on historical user behavior data and test cases corresponding to the historical user behavior data.

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

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