Coverage test method for deep reinforcement learning model
By introducing multi-dimensional coverage indicators and genetic algorithms, combined with state abstraction technology, the problems of weak characterization capabilities and local optimality in coverage testing of deep reinforcement learning systems are solved, and the detailed evaluation of high-dimensional state space and the generation of diversity test cases are realized, which improves the testing efficiency.
Patent Information
- Application Number
- CN202510646804.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-08-26
AI Technical Summary
The coverage testing methods of existing deep reinforcement learning systems have problems such as weak coverage indicator characterization capabilities, easy to fall into local optimality and inquantifiable test case generation, and it is difficult to comprehensively evaluate the state space and discover potential defects.
Multi-dimensional coverage indicators and genetic algorithms are adopted, combined with state abstraction technology, and diversity test cases are generated through seed selection and mutation strategies, and seed selection and mutation strategies are dynamically adjusted to improve the coverage and quality of test cases.
The detailed evaluation of high-dimensional state space is achieved, the coverage of different test batches is quantified, local optimization is avoided, and the diversity of test cases and defect discovery capabilities are improved.
Smart Images

Figure CN120540985A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the fields of artificial intelligence, reinforcement learning and coverage testing, and specifically provides a coverage testing method for a deep reinforcement learning model. Background Art
[0002] In recent years, deep reinforcement learning (DRL) has made significant progress, surpassing human performance in multiple domains. However, DRL systems differ fundamentally from traditional software systems and deep learning (DL) systems in their underlying mechanisms, making it difficult to directly incorporate traditional software testing methods or DL's coverage testing methods.
[0003] The uniqueness of DRL lies in its sequential decision-making process, typically modeled as a Markov decision process (MDP). Rather than relying on a static dataset for learning, the agent learns the optimal policy through trial and error by interacting with the environment. This learning approach makes sufficient exploration of the state space a key challenge. During training, certain states may be frequently visited, while others may be ignored, which in turn affects the policy's ability to generalize.
[0004] Therefore, it is particularly important to introduce coverage testing into DRL systems. It not only measures the coverage of the state and behavior spaces by test data, but also helps identify blind spots and vulnerabilities in the strategy. Developing coverage metrics suitable for DRL and exploring test case generation strategies are of great research and practical significance.
[0005] Currently, DRL testing primarily focuses on benchmarking and robustness testing. Regarding coverage testing, some research has attempted to design coverage testing methods based on neuron coverage metrics from DL testing. However, studies have shown that these metrics may not effectively assess the behavior of DRL systems and may even be misleading. Therefore, coverage testing metrics for DRL systems remain a research priority. Furthermore, test case generation techniques aimed at improving coverage testing metrics are needed to more comprehensively trigger possible abnormal behaviors.
[0006] In terms of coverage metrics, Shi et al. proposed a set of coverage metrics for deep reinforcement learning systems, monitoring system behavior from multiple dimensions: state, action, and policy. State-level coverage requires the agent to fully explore the state space, action-level coverage requires the agent to select all possible actions at least once, and policy-level coverage focuses on the complete interaction process, prompting the agent to trigger more unexpected behaviors. However, the following problems exist:
[0007] There are few coverage metrics, and existing ones are weak at characterizing the state space of deep reinforcement learning. Shi's proposed coverage metrics for deep reinforcement learning are still crude in state space modeling. For example, state coverage only characterizes the state space by collecting boundary values of each dimension during testing. This is computationally expensive when dealing with large state spaces and is difficult to reflect the decision-making characteristics of reinforcement learning.
[0008] In terms of test case generation, fuzz testing strategies are used to mutate an agent's action strategy, generating diverse test inputs to evaluate the strategy's stability. Wan et al. proposed the DRLFuzz method, guided by coverage metrics, to systematically test DRL systems and find more test cases. The STARLA method uses a data-driven search method to test the strategies of deep reinforcement learning agents, aiming to detect test snippets with functional errors.
[0009] However, there are still the following shortcomings:
[0010] Lack of quantifiable coverage metrics: DRLFuzz uses a nearest neighbor search based on a KD tree during fuzz testing to determine whether new test cases enter new state space regions, thereby improving the overall coverage of fuzz testing. Its coverage metrics cannot be quantified and cannot be used to compare the coverage of different test case batches.
[0011] Test case quality issues: DRLFuzz uses a gradient ascent mutation strategy for seed mutation, but it is prone to falling into local optimality in high-dimensional complex state spaces, resulting in limited test case diversity and difficulty in fully covering potential problem areas. Summary of the Invention
[0012] In response to the problems that existing coverage indicators have weak ability to characterize the state space of deep reinforcement learning and that existing test case generation methods are prone to falling into local optimality and cannot quantify coverage indicators, the present invention proposes a coverage testing method for deep reinforcement learning models, which can dynamically adjust seed selection and mutation strategies, so that the test has stronger exploration capabilities in high-dimensional state space, can discover more extreme situations and potential defects, and improve the quality of test cases.
[0013] The coverage testing method of a deep reinforcement learning model has the following specific steps:
[0014] Step 1: Initialize the random generator R, seed generator M, seed selector S, and low reward threshold r low and the number of iterations I.
[0015] Step 2: Use the random generator R to create an initial test case set B of size K and add it to the test case pool T.
[0016] K is an artificially set value.
[0017] Step 3: Traverse each test case I∈T in the test case pool T, perform reinforcement learning tests, and find the cumulative reward below the reward threshold r low Make a copy of each test case and put it into the failure case collection F;
[0018] The failure case collection F is initially empty.
[0019] Step 4: Seed selector S selects all test cases in the test case pool T according to the five dimensional indicators to obtain k seeds, forming the seed set R i .
[0020] k is an artificially set value.
[0021] The five dimensional indicators include:
[0022] (1) Redundancy LJS index based on Jaccard:
[0023] For N test cases, after processing based on local sensitive hashing (LSH), the sequence pair (S i ,S j )’s Jaccard similarity is as follows:
[0024]
[0025] S i For reinforcement learning, starting from test case i, a set of sequences is generated through sequential decision making; H(S i ) represents the set S i The hash set obtained after LSH processing.
[0026] (2) Abstract state boundary coverage ABSBCov indicator;
[0027] Based on the abstract state space The coverage is calculated as follows:
[0028]
[0029] where x i is the state dimension of test case i. and is the state boundary value of test case i during the test, TrainHigh x and TrainLow x are the state boundary values during training.
[0030] (3) Abstract action boundary coverage ABABCov indicator:
[0031] Action space based on state abstraction The coverage is calculated as follows:
[0032]
[0033] y i is the action dimension of test case i; and is the action boundary value of test case i during the test, TrainHigh y and TrainLow y is the action boundary value during training.
[0034] (4) Abstract state-action coverage ABSACov indicator:
[0035]
[0036] (5) Failure diversity LRSD indicator:
[0037]
[0038] N low is lower than the reward threshold r low The number of test cases; the reward set for low-reward test cases r i represents the reward value of the i-th low-reward test case, and the average value of all low-reward test cases is
[0039] First, the five-dimensional indicators are calculated for each test case, and the seed selector S calculates the comprehensive score of each test case:
[0040] Score=w1·(1-LJS)+w2·ABSBCov+w3·ABABCov+w4·ABABCov+w5·LRSD
[0041] Among them, w1, w2, w3, w4 and w5 are the weights of the indicators LJS, ABABCov, ABABCov, ABSACov and LRSD, respectively, which are adjusted manually in the actual process.
[0042] Then, the top k test cases are selected according to the scores from large to small as the optimal seeds.
[0043] Step 5: Use the seed generator M to generate the seed set R i Perform cross mutation on various seeds in to generate a test case set Q of size K i , and use it as T for a new round of testing.
[0044] First, according to the seed set Ri The five dimensional indicators of each seed in the , all seeds are quickly non-dominated sorted using the NSGA-II algorithm to obtain the non-dominated frontier set F;
[0045] F={F0,F1,…,F i ,…,F k}. F0 is the first-level non-dominated set, F i is the non-dominated set of level i, all F i Between satisfying F i >F i+1 .
[0046] Then, the elite selection strategy is executed, starting from i=0, and F i Sort the congestion in reverse order, take out the non-dominated solutions with the highest order and add them to the set P i , until the set P i The number of test cases in reaches Kk.
[0047] Next, from the set P i Randomly select the parent and perform uniform crossover operation until a sample set C of size Kk is obtained i .
[0048] The test case of the father, whose perturbation mode is recorded as the genotype G of the variant is expressed as
[0049] G=[b,σ,n]
[0050] Among them, b is the brightness adjustment parameter, σ is the Gaussian blur parameter, and n is the Gaussian noise intensity parameter;
[0051] For parent individuals G1 = [b1, σ1, n1] and G2 = [b2, σ2, n2], each parameter in the offspring individual G′ = [b′, σ′, n′] has a 50% probability of coming from G1 and a 50% probability of coming from G2.
[0052] Finally, the cross-sample set C i With the seed collection R i Merge into set M i , and for the set M i Based on the probability, the sample is selected and the Gaussian mutation operation is performed to replace the original sample to obtain the offspring Q i .
[0053] Specifically, the mutation process adds a normal distribution N(0,σ m ) of random values, where σ m To change the asynchronous length parameter;
[0054] For the Gaussian blur parameter σ, a different value is randomly selected from the valid value set of the parameter according to probability to replace it.
[0055] For the brightness gene bit, b′=b+N(0,σ m ), and ensure that the value range of b′ is consistent with that of b;
[0056] For the noise gene position, n′=n+N(0,σ m ), and ensure that the value range of n′ is consistent with n;
[0057] Step 6: Return to step 3 until the number of iterations reaches I, and output the set of failed test cases F.
[0058] The advantages of the present invention are:
[0059] 1. A coverage testing method for deep reinforcement learning models. This method incorporates multi-dimensional metrics, including redundancy-based coverage, state abstraction-based coverage, and error coverage, to evaluate the testing performance of reinforcement learning models from different perspectives. In particular, the introduction of state abstraction technology enables the evaluation process to better handle high-dimensional state spaces, and quantitative metrics help assess coverage across different test batches. This overcomes the drawback of existing techniques, where a single metric cannot fully characterize the learning process of reinforcement learning systems, thereby providing a more detailed test evaluation.
[0060] 2. A coverage testing method for deep reinforcement learning models combines genetic algorithms with multi-objective optimization algorithms. Through seed selection and generation strategies guided by coverage indicators, test cases are selected and generated. This avoids the situation where the existing research gradient ascent method is prone to falling into local optimality, thereby increasing the diversity of test cases, making the test cases more fully cover the state space, and better discovering potential defects and extreme cases. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 This is a flowchart of a coverage testing method for a deep reinforcement learning model of the present invention;
[0062] Figure 2 This is a diagram showing the structure of the reinforcement learning test indicator system of the present invention;
[0063] Figure 3 A graph showing the number of test cases generated by the present invention under three different conditions over time;
[0064] Figure 4 This is a test flow chart of the seed generator of the present invention;
[0065] Figure 5 Schematic diagram of the state of the Atari Pong environment after adding different slight perturbations to it according to the present invention;
[0066] Figure 6 This is a schematic diagram of uniform cross-section of samples according to the present invention;
[0067] Figure 7 Schematic diagram of Gaussian variation of samples according to the present invention. DETAILED DESCRIPTION
[0068] The specific implementation method of the present invention is further described in detail below with reference to the accompanying drawings.
[0069] This application proposes a coverage testing method for deep reinforcement learning models, which can evaluate the learning performance of reinforcement learning models more carefully and efficiently through state abstraction technology, and the quantitative indicators help to evaluate the coverage between different test batches.
[0070] like Figure 1 The specific steps are as follows:
[0071] Step 1: Initialize the random generator R, seed generator M, seed selector S, and low reward threshold r low and the number of iterations I.
[0072] Step 2: Use the random generator R to create an initial test case set B of size K and add it to the test case pool T.
[0073] K is an artificially set value.
[0074] Step 3: Traverse each test case I∈T in the test case pool T, perform reinforcement learning tests, and determine whether the cumulative reward generated by each test case is lower than the critical value r of the reward low If yes, copy the test case and put it into the failed case collection F; otherwise, go to step 4;
[0075] The failure case collection F is initially empty.
[0076] Step 4: Seed selector S selects all test cases in the test case pool T according to the five dimensional indicators to obtain k seeds, forming the seed set R i .
[0077] k is an artificially set value.
[0078] like Figure 2 As shown in the figure, the present invention constructs a comprehensive reinforcement learning test indicator system, which performs comprehensive evaluation through three dimensions: redundancy of test cases, coverage of interaction between intelligent agents and the environment, and error evaluation of test results.
[0079] In terms of redundancy, the Jaccard Similarity metric (LJS) based on Locality Sensitive Hashing (LSH) is used to measure the diversity of test cases. In terms of coverage, the state coverage based on state abstraction (ABSBCov), the action coverage based on action abstraction (ABABCov), and the state-action abstraction coverage based on state abstraction (ABSACov) are introduced. In terms of error assessment, the low reward rate (LRR) and low reward distribution (LRSD) are used to measure the model's performance in extreme states and task failure situations. These three dimensions complement each other and together form a complete indicator system that provides comprehensive support and guidance for the testing and optimization of reinforcement learning models.
[0080] The five dimensional indicators include:
[0081] (1) Redundancy LJS index based on Jaccard:
[0082] The LJS metric is used to detect similar state or action sequences and thus identify redundant test cases.
[0083] The test case is the initial state of reinforcement learning. The specific definition of the initial state depends on the reinforcement learning scenario. For example, in the AtariPong scenario, the initial state corresponds to the image frame of the game; for N test cases, reinforcement learning starts from test case i, and the sequence generated by sequential decision making is represented as a set S i , After processing based on local sensitive hashing (LSH), the sequence pair (S i ,S j )’s Jaccard similarity is as follows:
[0084]
[0085] H(S i ) represents the set S i The hash set obtained after LSH processing.
[0086] (2) Abstract state boundary coverage ABSBCov indicator;
[0087] Assume that the state abstraction function is φ: where S is the original state space, is the abstracted state space. By mapping the original state to a more simplified abstract state through φ, we get
[0088] The present invention comprises φ π* and The state abstraction method is selected As a state abstraction method. It not only ensures the transitivity of state abstraction, but also has controllable value loss, which can provide good abstraction accuracy while ensuring coverage. The abstract definition of the discrete approximate Q-value function is as follows:
[0089]
[0090] This definition states that two states s1 and s2 are considered to be the same abstract state if and only if the optimal Q-values corresponding to each action are the same after being scaled and discretized by d. d is a discretization step size parameter that controls the precision of the Q-value discretization.
[0091] State Boundary Coverage (SBCov) measures the coverage of the state space during testing. For each state dimension x i , SBCov is defined as follows:
[0092]
[0093] in and Is the state boundary value during testing, TrainHigh x and TrainLow x are the state boundary values during training.
[0094] After state abstraction, the coverage of states and actions can be calculated through the abstract state space and abstract action space. The coverage is simplified by mapping φ to calculate the abstract state coverage ABSBCov. By mapping the training and test boundary values to the abstract space at the same time, the coverage after state abstraction is calculated:
[0095]
[0096] where x i is the state dimension of test case i. and is the state boundary value of test case i during the test, TrainHigh x and TrainLow x are the state boundary values during training.
[0097] (3) Abstract action boundary coverage ABABCov indicator:
[0098] Action Boundary Coverage (ABCov) measures the extent of the action space covered during testing. For each action dimension y i , defined as follows:
[0099]
[0100] After state abstraction, the action space There is no change, but the abstract transfer T φ (s φ ,a,s′ φ ) will change, resulting in the change of the "semantics" of each action in the abstract space. In the original state, action a corresponds to a very deterministic transition. In the abstract state, action a may become a probabilistic jump to multiple abstract states. In order to distinguish it from the action space corresponding to the original state space, this proposal will be based on the action space of state abstraction. Action space based on state abstraction The coverage is calculated as follows:
[0101]
[0102] y i is the action dimension of test case i; and is the action boundary value of test case i during the test, TrainHigh y and TrainLow y is the action boundary value during training.
[0103] (4) Abstract state-action coverage ABSACov indicator:
[0104] State-Action Coverage (SACov) measures the coverage of state-action pairs during testing and is defined as follows:
[0105]
[0106] in is the set of state-action pairs partitioned during training.
[0107] After abstract function mapping, the abstract state-action coverage (ABSACov) coverage based on abstract states and actions can be obtained:
[0108]
[0109] in It is a set of state-action pairs divided after abstraction;
[0110] With these definitions, coverage can be measured on the abstracted state and action space, which helps improve the quality and coverage of tests.
[0111] (5) Failure diversity LRSD indicator:
[0112] Low reward situations can be defined as situations where the agent's reward in a particular state or series of states falls below a pre-defined "low reward threshold"; this indicates that the agent's performance in these states is not meeting expectations.
[0113] If the agent starts executing the strategy from a certain state and the cumulative reward in this state is lower than the preset "low reward threshold", then the state is considered a low reward situation. This definition is very important when measuring the weaknesses and shortcomings of the agent, because even if the agent performs well in most cases, the low rewards obtained in some key states or scenarios may expose its performance problems in specific situations. If the reward of the agent starting from a certain state is lower than the preset low reward threshold, the state is defined as a low reward situation. The present invention will describe the low reward situation through the low reward ratio (LRR) and the low reward distribution dispersion (LRSD).
[0114] The low reward ratio is used to measure the frequency of low reward situations in the test case. Assume that the critical value of reward is r low , a reward below this value is considered a “low reward”. If there are N test cases, where N low The reward for test cases is less than r low , then the low reward ratio LRR is defined as:
[0115]
[0116] The value of LRR is between 0 and 1, and a larger value indicates that the model performs poorly in more states.
[0117] The low reward distribution dispersion is used to measure the degree of dispersion of the reward distribution of low reward test cases; the low reward distribution dispersion LRSD is defined as:
[0118]
[0119] Reward set for low-reward test cases r i represents the reward value of the i-th low-reward test case, and the average value of all low-reward test cases is The larger the LRSD, the more low rewards are scattered across a variety of different scenarios, which may reflect multiple potential defects in the model; the smaller the LRSD, the more concentrated the low rewards are.
[0120] The seed selector is a tool for test case selection. It uses a single-objective fitness function to select the k best seed test cases from a large set of test cases to obtain parents with high test coverage, low redundancy, and high failure diversity. The seed selector first performs a multi-dimensional evaluation on each test case, calculating five dimensional indicators. Next, the seed selector calculates a comprehensive score for each test case, which is a weighted sum of the single-objective fitness function:
[0121] Score=w1·(1-LJS)+w2·ABSBCov+w3·ABABCov+w4·ABSACov+w5·LRSD
[0122] Among them, w1, w2, w3, w4 and w5 are the weights of the indicators LJS, ABSBCov, ABABCov, ABSACov and LRSD respectively, which are manually adjusted in the actual process to reflect the relative importance of different test objectives in the optimization process.
[0123] Then, the top k test cases are selected according to the scores from large to small as the optimal seeds.
[0124] like Figure 3 The following table shows the trend in the number of failure cases generated under different weights. In the early stages of optimization, Group C was used to increase the weights of coverage-related metrics to improve exploration of state and action spaces. In the later stages of optimization, Group A was used to increase the weight of failure diversity to discover more different types of failure cases. The weight w value groups are shown in the following table:
[0125] Table 1
[0126]
[0127] Step 5: Use the seed generator M to generate the seed set R i Perform cross mutation on various seeds in to generate a test case set Q of size K i , and use it as T for a new round of testing.
[0128] like Figure 4 As shown, first receive the selected seed test case set R from the "seed selector" i And obtain the five dimensional indicators LJS, ABSBCov, ABSBCov, ABSACov and LRSD of each test case from the test environment. Then use the NSGA-II algorithm to perform fast non-dominated sorting on the test cases and obtain the non-dominated frontier set F;
[0129] F={F0,F1,…,F i ,…,F k}. F0 is the first-level non-dominated set, F i is the non-dominated set of level i, all F i Between satisfying F i >F i+1 .
[0130] Then, the elite selection strategy is executed, starting from i=0, and F i Sort the congestion in reverse order, take out the non-dominated solutions with the highest order and add them to the set P i , until the set P i The number of test cases in reaches Kk.
[0131] Next, from the set P i Randomly select the parent and perform uniform crossover operation until a sample set C of size Kk is obtained i .
[0132] In this example, the perturbation method applied to the test case (i.e., image sample) is recorded as the genotype G of the mutation, which can be expressed as
[0133] G=[b,σ,n]
[0134] Among them, b is the brightness adjustment parameter, and its value range is [-0.2, 0.2]. For example, b = 0.15 means increasing the brightness by 15%, and b = -0.1 means reducing the brightness by 10%. σ is the Gaussian blur parameter, and its value range is {0, 3, 5}. For example, σ = 0 means no blurring, σ = 3 means applying a 3×3 Gaussian blur kernel, and σ = 5 means applying a 5×5 Gaussian blur kernel. n is the Gaussian noise intensity parameter, and its value range is [0.05, 0.1]. For example, n = 0.07 means adding Gaussian noise with an intensity of 7%.
[0135] Taking the image test case in the Atari Pong environment as an example, in order to ensure that the obtained image is still a valid image, such as Figure 5 As shown in Figure 1, this module changes the brightness (b), adds blur (σ), and adds noise (n) to the original image (a).
[0136] The crossover operation between two samples is defined as a uniform crossover:
[0137] For the parent individuals G1 = [b1, σ1, n1] and G2 = [b2, σ2, n2], each parameter in the offspring individual G′ = [b′, σ′, n′] has a 50% probability of coming from G1 and a 50% probability of coming from G2. Figure 6 As shown, the possible offspring is G′=[b1,σ2,n1], which means that it inherits the brightness adjustment and noise parameters of the first parent, and inherits the blur parameters of the second parent.
[0138] Finally, the cross-sample set C i With the seed collection R i Merge into set M i , and for the set M i Based on the probability, the sample is selected and the Gaussian mutation operation is performed to replace the original sample to obtain the offspring Q i ,like Figure 7 shown.
[0139] Specifically, the mutation process adds a normal distribution N(0,σ m ) of random values, where σ m To change the asynchronous length parameter;
[0140] For the Gaussian blur parameter σ, the probability p m Randomly select a different value from the valid value set {0,3,5} for replacement.
[0141] For the brightness gene bit, b′=b+N(0,σ m ), and ensure b′∈[-0.2,0.2];
[0142] For the fuzzy gene position, a value is randomly selected from {0, 3, 5} with probability pm;
[0143] For the noise gene position, n′=n+N(0,σ m ), and ensure n′∈[0.05,0.1].
[0144] Step 6: Return to step 3 until the number of iterations reaches I, and output the set of failed test cases F.
Claims
1. A coverage testing method for a deep reinforcement learning model, characterized in that: The specific steps are as follows: Step 1: Initialize the random generator R, seed generator M, seed selector S, and low reward threshold r low and the number of iterations I; and use the random generator R to create an initial test case set B of size K and add it to the test case pool T; K is an artificially set value; Step 2: Traverse each test case I∈T in the test case pool T, perform reinforcement learning tests, and find the cumulative reward below the reward threshold r low Make a copy of each test case and put it into the failure case collection F; The failure case collection F is initially empty; Step 3: The seed selector S selects all test cases in the test case pool T according to the five dimensional indicators to obtain k seeds, forming the seed set R i ; k is an artificially set value; The five dimensional indicators include: (1) Redundancy LJS index based on Jaccard: For N test cases, after processing based on local sensitive hashing (LSH), the sequence pairs (S i ,S j )’s Jaccard similarity is as follows: S i For reinforcement learning, starting from test case i, a set of sequences is generated through sequential decision making; H(S i ) represents the set S i The hash set obtained after LSH processing; (2) Abstract state boundary coverage ABSBCov indicator; Based on the abstract state space The coverage is calculated as follows: where x i is the state dimension of test case i; and is the state boundary value of test case i during the test, TrainHigh x and TrainLow x is the state boundary value during training; (3) Abstract action boundary coverage ABABCov indicator: Action space based on state abstraction The coverage is calculated as follows: y i is the action dimension of test case i; and is the action boundary value of test case i during the test, TrainHigh y and TrainLow y is the action boundary value during training; (4) Abstract state-action coverage ABSACov indicator: (5) Failure diversity LRSD indicator: N low is lower than the reward threshold r low The number of test cases; the reward set for low-reward test cases r i represents the reward value of the i-th low-reward test case, and the average value of all low-reward test cases is Step 4: Use the seed generator M to generate the seed set R i Perform cross mutation on various seeds in to generate a test case set Q of size K i , and use it as T for a new round of testing; First, according to the seed set R i The five dimensional indicators of each seed in the , all seeds are quickly non-dominated sorted using the NSGA-II algorithm to obtain the non-dominated frontier set F; F={F0,F1,…,F i ,…,F k }; F0 is the first-level non-dominated set, F i is the non-dominated set of level i, all F i F i >F i+1 ; Then, the elite selection strategy is executed, starting from i=0, and F i Sort the congestion in reverse order, take out the non-dominated solutions with the highest order and add them to the set P i , until the set P i The number of test cases in reaches Kk; Next, from the set P i Randomly select the parent and perform uniform crossover operation until a sample set C of size Kk is obtained i ; Finally, the cross-sample set C i With the seed collection R i Merge into set M i , and for the set M i Based on the probability, the sample is selected and the Gaussian mutation operation is performed to replace the original sample to obtain the offspring Q i ; Step 5: Return to step 2 until the number of iterations reaches I, and output the set of failed test cases F.
2. The coverage testing method according to claim 1, wherein: The step three is specifically as follows: First, the five dimensional indicators LJS, ABABCov, ABABCov, ABSACov and LRSD are calculated for each test case; Then, the seed selector S calculates the comprehensive score Score for each test case: Score=w1·(1-LJS)+w2·ABSBCov+w3·ABSBCov+w4·ABSACov+w5·LRSD Among them, w1, w2, w3, w4 and w5 are the weights of the indicators LJS, ABSBCov, ABABCov, ABSACov and LRSD, which are adjusted manually in the actual process; Then, the top k test cases are selected according to the scores from large to small as the optimal seeds.
3. The coverage testing method according to claim 1, wherein: In step 4, the perturbation mode of the test case of the father is recorded as the genotype G of the mutation, which is expressed as G = [b, σ, n] Among them, b is the brightness adjustment parameter, σ is the Gaussian blur parameter, and n is the Gaussian noise intensity parameter; For parent individuals G1 = [b1, σ1, n1] and G2 = [b2, σ2, n2], each parameter in the offspring individual G′ = [b′, σ′, n′] has a 50% probability of coming from G1 and a 50% probability of coming from G2.
4. The coverage testing method according to claim 3, wherein: In the step 4, the mutation process adds a normal distribution N(0,σ m ) of random values, where σ m To change the asynchronous length parameter; For the Gaussian blur parameter σ, a different value is randomly selected from the valid value set of the parameter according to probability to replace it; For the brightness gene bit, b′=b+N(0,σ m ), and ensure that the value range of b′ is consistent with that of b; For the noise gene position, n′=n+N(0,σ m ), and ensure that the value range of n′ is consistent with n.