Black box testing method, device, electronic device and medium based on deep learning

Through the deep learning-based black box testing method, defense models and attack models are trained, and combined with genetic algorithms to optimize test cases, the problems of low black box testing efficiency, invasive model performance and security risks in the existing technology are solved, and more efficient and in-depth software security detection is achieved.

CN119201752BActive Publication Date: 2025-03-07WUHAN BIG PULP IND DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411690825.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-25
Publication Date
2025-03-07
Estimated Expiration
2044-11-25

AI Technical Summary

Technical Problem

The existing black box testing methods are difficult to meet the increasing application detection needs in the context of big data, and there are invasive and security risks to model performance, making it difficult to deeply explore heterogeneous network information security vulnerabilities.

Method used

A black box testing method based on deep learning is adopted to obtain normal samples and interference samples of the target software, train defense models and attack models, calculate the security detection results of the samples, and use genetic algorithms to optimize the test case data set to complete the test software.

Benefits of technology

It improves the efficiency of software black box testing, initially judges the security of target software test cases, and obtains more test cases through genetic algorithms, thereby detecting the security of target software more deeply.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201752B_ABST
    Figure CN119201752B_ABST
Patent Text Reader

Abstract

The present invention relates to a black box testing method, device, electronic device and medium based on deep learning, belonging to the field of software testing technology, wherein the method comprises: obtaining samples and interference samples of target software operations; obtaining a well-trained defense model based on the samples, and obtaining a well-trained attack model based on the interference samples; inputting each sample in the interference samples into the well-trained attack model and the well-trained defense model to obtain a first vector and a second vector respectively; determining the security detection result of the target software based on the first vector and the second vector; using the samples corresponding to the security detection result as the initial population, and obtaining a test case data set based on a genetic algorithm. The present invention preliminarily determines the security of the target software by constructing a defense model and an attack model, and further obtains more test cases based on a genetic algorithm, thereby further detecting the security of the target software, thereby improving the efficiency of software black box testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of software testing technology, and in particular to a black box testing method, device, electronic device and medium based on deep learning. Background Art

[0002] Black box testing is conducted from the user's perspective, starting from the correspondence between input data and output data. In the test, the program is regarded as a black box that cannot be opened. Without considering the internal structure and internal characteristics of the program, the program interface is tested. It only checks whether the program functions are used normally according to the requirements specification and whether the program can properly receive input data and generate correct output information. Black box testing focuses on the external structure of the program, without considering the internal logical structure, and mainly tests the software interface and software functions.

[0003] The existing black box testing methods have the following defects: 1) The existing black box testing methods adopt the method of manual input or program execution to check whether the software meets the requirements by monitoring the running process of the software. In the context of big data, the number of test applications is large, and it is difficult to meet the increasing application detection needs; 2) Second, the existing black box testing model determines ownership by embedding specific watermarks in the model, which is invasive to the original model and may affect the model performance or introduce new security risks; 3) Third, when the existing black box test is scanning for vulnerabilities, if the test information is abnormal, the scan will be interrupted, resulting in missed detections, making it difficult to deeply explore heterogeneous network information security vulnerabilities.

[0004] In summary, the prior art lacks a method to improve the efficiency of software black box testing. Summary of the invention

[0005] In view of this, it is necessary to provide a black box testing method, device, electronic device and medium based on deep learning to achieve the purpose of improving the efficiency of software black box testing.

[0006] In order to achieve the above object, the present invention provides a black box testing method based on deep learning, comprising:

[0007] Obtain normal samples and interference samples of the target software;

[0008] A well-trained defense model is obtained by training a preset neural network model based on normal samples, and a well-trained attack model is obtained by training a preset neural network model based on interference samples;

[0009] Input each sample in the interference sample into the well-trained attack model and the well-trained defense model to obtain a first vector and a second vector respectively;

[0010] Determine a safety detection result of each sample in the normal samples based on the first vector and the second vector;

[0011] The samples corresponding to the safety test results are used as the initial population, and the initial population is selectively evolved based on the genetic algorithm to obtain the test case data set;

[0012] Complete the testing of the target software based on the test case dataset.

[0013] In a possible implementation, obtaining a normal sample and an interference sample of the operating target software includes:

[0014] The user interaction record data of the target software, the simulated interaction record data of the target software and the data collected online constitute a normal sample;

[0015] A random noise is introduced uniformly into the normal sample to obtain an interference sample.

[0016] In a possible implementation, determining the safety detection result of each sample in the normal samples based on the first vector and the second vector includes:

[0017] The similarity between the first vector and the second vector is calculated, and the safety detection result of each sample in the normal samples is determined based on the similarity.

[0018] In a possible implementation, the similarity calculation formula is:

[0019]

[0020] In the formula, represents the first vector; represents the second vector; represents the average value of the first vector; represents the average value of the second vector; Indicates similarity.

[0021] In a possible implementation, determining the safety detection result of each sample in the normal sample based on the similarity includes:

[0022] When the similarity is greater than a preset value, determining that the corresponding first sample in the normal sample is a safe sample;

[0023] When the similarity is not greater than a preset value, it is determined that the corresponding second sample in the normal sample is an unsafe sample.

[0024] In a possible implementation, taking samples corresponding to the safety detection results as the initial population includes:

[0025] The samples corresponding to the unsafe samples in the safety detection results are used as the initial population.

[0026] In a possible implementation, the step of performing selective evolution processing on the initial population based on a genetic algorithm to obtain a test case data set includes:

[0027] Executing a selection operator on the initial population based on a genetic algorithm to obtain an initial generation of high-quality use case population;

[0028] A crossover operator is performed on the first-generation high-quality test case population to obtain a second-generation test case population, and finally a mutation operator is performed on the second-generation test case population to generate a valid test case data set.

[0029] On the other hand, the present invention also provides a black box testing device based on deep learning, comprising:

[0030] A sample acquisition module is used to acquire normal samples and interference samples of the target software;

[0031] A trained complete model acquisition module is used to obtain a trained complete defense model based on a preset neural network model trained with normal samples, and to obtain a trained complete attack model based on a preset neural network model trained with interference samples;

[0032] A vector acquisition module, used for inputting each sample in the interference sample into a well-trained attack model and a well-trained defense model to obtain a first vector and a second vector respectively;

[0033] A detection result acquisition module, used to determine the safety detection result of each sample in the normal sample based on the first vector and the second vector;

[0034] The test case data set acquisition module is used to use the samples corresponding to the safety detection results as the initial population, and to optimize the initial population based on the genetic algorithm to obtain the test case data set;

[0035] The test module is used to complete the target software testing based on the test case data set.

[0036] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein:

[0037] Memory, used to store programs;

[0038] A processor, coupled to the memory, is used to execute a program stored in the memory to implement the steps in a black box testing method based on deep learning in any one of the above implementations.

[0039] On the other hand, the present invention also provides a computer-readable storage medium for storing computer-readable programs or instructions, which, when executed by a processor, can implement the steps of a black box testing method based on deep learning in any of the above-mentioned implementation methods.

[0040] The beneficial effects of the present invention are as follows: the black box testing method based on deep learning provided by the present invention first obtains normal samples and interference samples of target software operations, then trains a preset neural network model based on the normal samples to obtain a well-trained defense model, the defense model is used to characterize the normal operation of the target software, and trains a preset neural network model based on the interference samples to obtain a well-trained attack model, the attack model is used to characterize abnormal operations, i.e., unsafe operations, on the target software, each sample in the interference samples is respectively input into the well-trained attack model and the well-trained defense model to respectively obtain a first vector and a second vector, determines the security detection result of each sample in the sample based on the first vector and the second vector, divides the interference samples into several samples, and each sample The output vectors are respectively obtained by inputting into the attack model and the defense model, so as to determine the security detection result of the target software according to the output vector, and the sample corresponding to the security detection result is used as the initial population, and the initial population is selectively evolved based on the genetic algorithm to obtain a test case data set, and the test set is further expanded based on the genetic algorithm on the basis of the detection result, so as to conduct a more in-depth detection of the detection result, and finally the target software is tested based on the test case data set. The present invention constructs a defense model and an attack model based on the samples and interference samples of the target software, respectively, preliminarily judges the security of the target software test case, and further obtains more test cases based on the genetic algorithm, so as to further detect the security of the target software, thereby improving the efficiency of software black box testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 A flowchart of an embodiment of a black box testing method based on deep learning provided by the present invention;

[0042] Figure 2 For the present invention Figure 1 A schematic flow chart of an embodiment of S101;

[0043] Figure 3 For the present invention Figure 1 A schematic flow chart of an embodiment of S104;

[0044] Figure 4 A schematic flow chart of an embodiment of a black box testing device based on deep learning provided by the present invention;

[0045] Figure 5 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION

[0046] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0047] Before presenting the embodiments, the following terms are explained.

[0048] A test case is a description of a test task for a specific software product, reflecting the test plan, method, technology and strategy. Its content includes test objectives, test environment, input data, test steps, expected results, test scripts, etc., and finally forms a document. Simply put, a test case is a set of test inputs, execution conditions and expected results compiled for a special goal, used to verify whether a specific software requirement is met.

[0049] A test case mainly includes four contents: test case title, prerequisites, test steps and expected results. The test case title mainly describes the test of a certain function; the prerequisites refer to the conditions that the test case title needs to meet; the test steps mainly describe the operation steps of the test case; and the expected results refer to the compliance with the expected requirements (development specifications, requirements documents, user requirements, etc.).

[0050] Attack model: An attack model usually refers to the use of specific methods and techniques to deceive a deep learning model into producing incorrect outputs or judgments. Attackers will design and execute adversarial attacks based on different data sets and victim models.

[0051] Defense models: Defense models refer to mechanisms or strategies designed to identify and defend against these malicious attacks. Their goal is to improve the security and robustness of the model and ensure that it can maintain correct judgment when facing adversarial samples.

[0052] The present invention provides a black box testing method, device, electronic device and medium based on deep learning, which are described below respectively.

[0053] Figure 1 A flowchart of an embodiment of a black box testing method based on deep learning provided by the present invention is shown in FIG. Figure 1 As shown in the figure, the black box testing method based on deep learning includes:

[0054] S101, obtaining samples of operations on target software and interference samples;

[0055] S102, obtaining a fully trained defense model based on the samples, and obtaining a fully trained attack model based on the interference samples;

[0056] S103, inputting each sample in the interference sample into a well-trained attack model and a well-trained defense model to obtain a first vector and a second vector respectively;

[0057] S104, determining a detection result of each sample in the sample based on the first vector and the second vector;

[0058] S105, taking the samples corresponding to the test results as the initial population, and performing selective evolution processing on the initial population based on the genetic algorithm to obtain a test case data set;

[0059] S106. Complete the target software test based on the test case data set.

[0060] Compared with the prior art, the black box testing method based on deep learning provided in this embodiment first obtains normal samples and interference samples of target software operations, then trains a preset neural network model based on the normal samples to obtain a fully trained defense model, the defense model is used to characterize the normal operation of the target software, and trains a preset neural network model based on the interference samples to obtain a fully trained attack model, the attack model is used to characterize abnormal operations, i.e., non-safe operations, on the target software, each sample in the interference samples is respectively input into the fully trained attack model and the fully trained defense model to obtain a first vector and a second vector respectively, determines the security detection result of each sample in the sample based on the first vector and the second vector, divides the interference samples into several samples, and each sample The output vectors are respectively obtained by inputting into the attack model and the defense model, so as to determine the security detection result of the target software according to the output vector, and the sample corresponding to the security detection result is used as the initial population, and the initial population is selectively evolved based on the genetic algorithm to obtain a test case data set, and the test set is further expanded based on the genetic algorithm on the basis of the detection result, so as to conduct a more in-depth detection of the detection result, and finally the target software is tested based on the test case data set. The present invention constructs a defense model and an attack model based on the samples and interference samples of the target software, respectively, preliminarily judges the security of the target software test case, and further obtains more test cases based on the genetic algorithm, so as to further detect the security of the target software, thereby improving the efficiency of software black box testing.

[0061] It should be noted that the target software of the present invention can be software on a mobile terminal or software on a computer terminal. The application scenario of the present invention is a scenario where black box testing of software is required.

[0062] In some embodiments of the present invention, in step S101, obtaining normal samples and interference samples of the operating target software includes:

[0063] S201, the user interaction record data of the target software, the simulated interaction record data of the target software and the data collected online constitute a normal sample;

[0064] S202. Introduce a random noise uniformly distributed in the normal sample to obtain an interference sample.

[0065] In a specific embodiment of the present invention, the user interaction record data comes from the actual user's mobile device or computer target software usage record, including the user's interaction behavior with the mobile application or computer, click events, sliding operations and input data.

[0066] Ways to obtain user interaction record data include: user authorization, log records, and third-party services.

[0067] User authorization: Collect user interaction data during the use of mobile applications or computer terminals through user consent and authorization.

[0068] Logging: Add logging function to mobile applications or computers to automatically collect user interaction behavior data.

[0069] Third-party services: Use third-party data analysis services or platforms to obtain user behavior data when using mobile applications.

[0070] It should be noted that in some cases, simulated user interaction data can be generated for testing or research purposes. Although these data are not real user behaviors, they can simulate user interaction habits to a certain extent. The simulated interaction record data of the target software includes random generation and rule-based generation. Random generation is to randomly generate user interaction events based on the interface and functions of the mobile application or computer end, and rule-based generation is to generate user interaction data that meets specific conditions based on predefined rules and user behavior patterns.

[0071] The data collected online are mainly obtained by consulting publicly available data sets online.

[0072] It should be noted that the sample is a test case for the normal operation of the target software, such as a login test case. A normal login test case: enter a valid user name and password, click the login button, and verify that the login is successful. Add interference to this test case, enter a Chinese password and a valid user name, click the login button, and the system reports an error.

[0073] In a specific embodiment of the present invention, the preset neural network model is trained based on normal samples to obtain a fully trained defense model, and the preset neural network model is trained based on interference samples to obtain a fully trained attack model, wherein the preset neural network model can be a recursive neural network, a long short-term memory network, and a convolutional neural network, or other neural network models. Among them, the sample is a test case for the normal operation of the target software, and the interference sample is a test case for the abnormal or unsafe operation of the target software.

[0074] In some embodiments of the present invention, determining the safety detection result of each sample in the normal samples based on the first vector and the second vector includes:

[0075] The similarity between the first vector and the second vector is calculated, and a security detection result of each sample in the samples is determined based on the similarity.

[0076] In some embodiments of the present invention, the similarity calculation formula is:

[0077]

[0078] In the formula, represents the first vector; represents the second vector; represents the average value of the first vector; represents the average value of the second vector; Indicates similarity.

[0079] In a specific embodiment of the present invention, the sample represents the normal operation of the target software, and the interference sample represents the attack behavior of the target software, that is, the defense model represents the normal operation of the sample, and the attack model represents the attack behavior on the target software. That is, by calculating the similarity between the first vector and the second vector, it can be determined whether each sample in the normal sample is safe according to the similarity, that is, whether the operation of the target software is safe.

[0080] In some embodiments of the present invention, in step S104, determining the safety detection result of each sample in the normal sample based on the similarity includes:

[0081] S301: When the similarity is greater than a preset value, determining that the corresponding first sample in the normal sample is a safe sample;

[0082] S302: When the similarity is not greater than a preset value, determining that the corresponding second sample in the normal sample is an unsafe sample.

[0083] In a specific embodiment of the present invention, the preset value is set to 0.9. When the similarity is greater than 0.9, the corresponding first sample in the normal sample is determined to be a safe sample. When the similarity is not greater than 0.9, the corresponding second sample in the normal sample is determined to be an unsafe sample.

[0084] It can be understood that the detection result of each sample in the sample determined based on the similarity is a preliminary detection result of the test case of the target software. In order to further test the preliminary detection result, this embodiment uses a genetic algorithm to perform further in-depth vulnerability scanning on the preliminary detection result to obtain more and more detailed test cases.

[0085] It should be noted that judging whether there is a risk based on similarity in step S104 provides a preliminary detection result for step S105. Specifically, for example, if step S104 detects that a certain test sample may have a security risk, step S105 will treat the test sample as a population, and try each test sample as an individual in the population, and perform crossover, i.e. replacing some operation steps between two test samples, mutation, i.e. changing the order of operation steps of a certain test sample, and then select individuals or samples with high fitness, generate new test information, and then execute further vulnerability discovery.

[0086] In some embodiments of the present invention, the step of using samples corresponding to the safety detection results as the initial population includes:

[0087] The samples corresponding to the unsafe samples in the safety detection results are used as the initial population.

[0088] In some embodiments of the present invention, the step of performing selective evolution processing on the initial population based on a genetic algorithm to obtain a test case data set includes:

[0089] Executing a selection operator on the initial population based on a genetic algorithm to obtain an initial generation of high-quality use case population;

[0090] A crossover operator is performed on the first-generation high-quality test case population to obtain a second-generation test case population, and finally a mutation operator is performed on the second-generation test case population to generate a valid test case data set.

[0091] In a specific embodiment of the present invention, the step of completing the target software test based on the test case data set includes:

[0092] Execute the test case data set to obtain an execution result;

[0093] The security of the target software is evaluated based on the execution result.

[0094] Specifically, after completing the black box test, the application test results are evaluated in combination with the test coverage and defect reports.

[0095] In order to better implement a black box testing method based on deep learning in an embodiment of the present invention, based on a black box testing method based on deep learning, correspondingly, Figure 4 As shown, an embodiment of the present invention further provides a black box testing device based on deep learning. A black box testing device 400 based on deep learning includes:

[0096] The sample acquisition module 401 is used to acquire normal samples and interference samples of the operating target software;

[0097] A trained complete model acquisition module 402, used to train a preset neural network model based on normal samples to obtain a trained complete defense model, and to train a preset neural network model based on interference samples to obtain a trained complete attack model;

[0098] A vector acquisition module 403 is used to input each sample in the interference sample into a well-trained attack model and a well-trained defense model to obtain a first vector and a second vector respectively;

[0099] A detection result acquisition module 404, configured to determine a safety detection result of each sample in the normal samples based on the first vector and the second vector;

[0100] The test case data set acquisition module 405 is used to use the samples corresponding to the security detection results as the initial population, and perform optimization processing on the initial population based on the genetic algorithm to obtain the test case data set;

[0101] The testing module 406 is used to complete the testing of the target software based on the test case data set.

[0102] The black box testing device 400 based on deep learning provided in the above embodiment can implement the technical solution described in the above embodiment of a black box testing method based on deep learning. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above embodiment of a black box testing method based on deep learning, which will not be repeated here.

[0103] like Figure 5 As shown, the present invention also provides an electronic device 500. The electronic device 500 includes a processor 501, a memory 502 and a display 503. Figure 5 Only some components of the electronic device 500 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.

[0104] In some embodiments, the processor 501 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 302, such as a black box testing method based on deep learning in the present invention.

[0105] In some embodiments, the processor 501 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, the processor 501 may be local or remote. In some embodiments, the processor 501 may be implemented in a cloud platform. In some embodiments, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, a multi-cloud, etc., or any combination thereof.

[0106] In some embodiments, the memory 502 may be an internal storage unit of the electronic device 500, such as a hard disk or memory of the electronic device 500. In other embodiments, the memory 302 may also be an external storage device of the electronic device 500, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 500.

[0107] Furthermore, the memory 502 may include both an internal storage unit of the electronic device 500 and an external storage device. The memory 502 is used to store application software installed in the electronic device 500 and various data.

[0108] In some embodiments, the display 503 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 503 is used to display information on the electronic device 500 and to display a visual user interface. The components 501-503 of the electronic device 500 communicate with each other via a system bus.

[0109] In one embodiment, when the processor 501 executes a black box testing program based on deep learning in the memory 502, the following steps may be implemented:

[0110] Obtain normal samples and interference samples of the target software;

[0111] A well-trained defense model is obtained by training a preset neural network model based on normal samples, and a well-trained attack model is obtained by training a preset neural network model based on interference samples;

[0112] Input each sample in the interference sample into the well-trained attack model and the well-trained defense model to obtain a first vector and a second vector respectively;

[0113] Determine a safety detection result of each sample in the normal samples based on the first vector and the second vector;

[0114] The samples corresponding to the safety test results are used as the initial population, and the initial population is selectively evolved based on the genetic algorithm to obtain the test case data set;

[0115] Complete the testing of the target software based on the test case dataset.

[0116] It should be understood that when the processor 501 executes a black box testing program based on deep learning in the memory 502, in addition to the above functions, other functions can also be implemented. For details, please refer to the description of the corresponding method embodiment above.

[0117] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 500 mentioned, and the electronic device 500 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic devices may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 500 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).

[0118] Those skilled in the art can understand that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0119] The above are only preferred specific implementations of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A black box testing method based on deep learning, characterized in that: include: Obtain normal samples and interference samples of the target software; A well-trained defense model is obtained by training a preset neural network model based on normal samples, and a well-trained attack model is obtained by training a preset neural network model based on interference samples; Input each sample in the interference sample into the well-trained attack model and the well-trained defense model to obtain a first vector and a second vector respectively; Determine a safety detection result of each sample in the normal samples based on the first vector and the second vector; The samples corresponding to the safety detection results are used as the initial population, and the initial population is selectively evolved based on the genetic algorithm to obtain the test case data set; Complete the testing of the target software based on the test case data set; The obtaining of normal samples and interference samples of the target operating software includes: The user interaction record data of the target software, the simulated interaction record data of the target software and the data collected online constitute a normal sample; Uniformly introducing a random noise into the normal sample to obtain an interference sample; The step of determining the safety detection result of each sample in the normal samples based on the first vector and the second vector includes: Calculating the similarity between the first vector and the second vector, and determining a safety detection result of each sample in the normal samples based on the similarity; The determining the safety detection result of each sample in the normal samples based on the similarity includes: When the similarity is greater than a preset value, determining that the corresponding first sample in the normal sample is a safe sample; When the similarity is not greater than a preset value, determining that the corresponding second sample in the normal sample is an unsafe sample; The method of using samples corresponding to the safety detection results as the initial population includes: The samples corresponding to the unsafe samples in the safety detection results are used as the initial population.

2. The black box testing method based on deep learning according to claim 1, characterized in that: The similarity calculation formula is: In the formula, represents the first vector; represents the second vector; represents the average value of the first vector; represents the average value of the second vector; Indicates similarity.

3. The black box testing method based on deep learning according to claim 1, characterized in that: The test case data set is obtained by performing selective evolution processing on the initial population based on the genetic algorithm, including: Executing a selection operator on the initial population based on a genetic algorithm to obtain an initial generation of high-quality use case population; A crossover operator is performed on the first-generation high-quality test case population to obtain a second-generation test case population, and finally a mutation operator is performed on the second-generation test case population to generate a valid test case data set.

4. A black box testing device based on deep learning, characterized in that: include: A sample acquisition module is used to acquire normal samples and interference samples of the target software; A trained complete model acquisition module is used to obtain a trained complete defense model based on a preset neural network model trained with normal samples, and to obtain a trained complete attack model based on a preset neural network model trained with interference samples; A vector acquisition module, used for inputting each sample in the interference sample into a well-trained attack model and a well-trained defense model to obtain a first vector and a second vector respectively; A detection result acquisition module, used to determine the safety detection result of each sample in the normal sample based on the first vector and the second vector; The test case data set acquisition module is used to use the samples corresponding to the safety detection results as the initial population, and to optimize the initial population based on the genetic algorithm to obtain the test case data set; The test module is used to complete the target software test based on the test case data set; The obtaining of normal samples and interference samples of the target operating software includes: The user interaction record data of the target software, the simulated interaction record data of the target software and the data collected online constitute a normal sample; Uniformly introducing a random noise into the normal sample to obtain an interference sample; The step of determining the safety detection result of each sample in the normal samples based on the first vector and the second vector includes: Calculating the similarity between the first vector and the second vector, and determining a safety detection result of each sample in the normal samples based on the similarity; The determining the safety detection result of each sample in the normal samples based on the similarity includes: When the similarity is greater than a preset value, determining that the corresponding first sample in the normal sample is a safe sample; When the similarity is not greater than a preset value, determining that the corresponding second sample in the normal sample is an unsafe sample; The method of using samples corresponding to the safety detection results as the initial population includes: The samples corresponding to the unsafe samples in the safety detection results are used as the initial population.

5. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps in the black box testing method based on deep learning as described in any one of claims 1 to 3 above.

6. A computer-readable storage medium, characterized in that: Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of a black box testing method based on deep learning as described in any one of claims 1 to 3 above.

Citation Information

Patent Citations

  • Intelligent system hard tag robustness test method and system based on improved genetic algorithm

    CN118484384A

  • System and Method for Bug Fixing Developers Recommendation and Bug Severity Prediction based on Topic Model and Multi-Feature

    KR1020160088737A