US2022300820A1PendingUtilityA1

Ann-based program testing method, testing system and application

Assignee: ZUNYI VOCATIONAL & TECHNICAL COLLEGEPriority: Dec 9, 2019Filed: Jun 9, 2022Published: Sep 22, 2022
Est. expiryDec 9, 2039(~13.4 yrs left)· nominal 20-yr term from priority
Inventors:Huachen Zhang
G06N 3/048G06N 3/045G06F 11/3684G06F 11/3692G06N 3/084G06N 3/10G06F 11/3688
45
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

An artificial neural network (ANN)-based program testing method, which tests a target program on which functions and codes are run. The method includes constructing a test model by means of an ANN, then inputting input values of a target program into the test model, and computing test output values according to the test model; then inputting the input values into the target program so as to obtain actual output values; and selecting, according to deviations between the test output values and the actual output values that correspond to the same input values, input values corresponding to top-ranked 50 to 150 deviations, transmitting the selected input values to the target program for running, comparing running results with an actual functional requirement, and determining that the target program has a defect under the condition that one of the running results does not satisfy the actual functional requirement.

Claims

exact text as granted — not AI-modified
1 . An artificial neural network (ANN)-based program testing method, comprising:
 S 1 , routine testing: conducting code and function implementation tests on a target program, so as to ensure normal running of the target program;   S 2 , obtaining a test model: using an ANN trainer to construct an initial model of an ANN, using input values and corresponding output values of the target program as training samples, training the initial model by means of the training samples, stopping adding training samples when the initial model is in a convergent state, and defining a convergent model as the test model;   S 3 , selecting test output values: taking all the input values under the condition that an input value range of the target program is less than one million, if not, taking and inputting at least one million random input values of the target program into the test model, and computing the test output values according to the test model;   S 4 , selecting actual output values: taking and inputting the same input values in S 3  into the target program, so as to obtain the actual output values;   S 5 , screening the input values: comparing the test output value and the actual output value that correspond to the same input value; sorting deviations from largest to smallest under the condition that there is a deviation between the test output value and the actual output value, and selecting input values corresponding to top-ranked 50 to 150 deviations; and obtaining a test value for testing whether the target program is correct;   S 6 , storing a selected test value in a readable storage medium for later copying; and   S 7 , transmitting the test value in S 6  to the target program for running, and comparing running results with an actual functional requirement; determining that the target program has a defect under the condition that one of the running results does not satisfy the actual functional requirement; and if not, determining that the target program is a program satisfying a requirement.   
     
     
         2 . The ANN-based program testing method according to  claim 1 , wherein in S 2 , the initial model of the ANN is a back propagation (BP) neural network model and comprises an input layer, a hidden layer and an output layer; the input values of the target program are used as the input layer; the output values obtained by running the input values through the target program are used as the output layer; and the number of nodes in each of the input layer and the output layer is 32. 
     
     
         3 . The ANN-based program testing method according to  claim 2 , wherein in a training process, the BP neural network model uses an activation function: 
       
         
           
             
               
                 
                   f 
                   ⁡ 
                   ( 
                   x 
                   ) 
                 
                 = 
                 
                   1 
                   
                     1 
                     + 
                     
                       e 
                       
                         - 
                         x 
                       
                     
                   
                 
               
               ; 
             
           
         
       
       when f(x) is less than 0.5, an output value of an output layer node is 0; and when f(x) is greater than or equal to 0.5, the output value of the output layer node is 1. 
     
     
         4 . The ANN-based program testing method according to  claim 3 , wherein an output value of the hidden layer of the BP neural network model satisfies: 
       
         
           
             
               
                 
                   h 
                   m 
                 
                 = 
                 
                   
                     f 
                     ⁡ 
                     ( 
                     
                       
                         ∑ 
                         
                           j 
                           = 
                           1 
                         
                         32 
                       
                       
                         
                           i 
                           j 
                         
                         ⁢ 
                         
                           w 
                           ⁡ 
                           ( 
                           
                             j 
                             , 
                             m 
                           
                           ) 
                         
                       
                     
                     ) 
                   
                   ⁢ 
                   
                     ( 
                     
                       
                         m 
                         = 
                         1 
                       
                       , 
                       2 
                       , 
                       … 
                           
                       , 
                       k 
                     
                     ) 
                   
                 
               
               , 
             
           
         
       
       wherein w(j,m) indicates a weight from an input layer node to a hidden layer node, and k is the number of nodes in the hidden layer. 
     
     
         5 . The ANN-based program testing method according to  claim 4 , wherein an output value of the output layer of the BP neural network model satisfies: 
       
         
           
             
               
                 
                   o 
                   n 
                   ′ 
                 
                 = 
                 
                   
                     f 
                     ⁡ 
                     ( 
                     
                       
                         ∑ 
                         
                           m 
                           = 
                           1 
                         
                         k 
                       
                       
                         
                           h 
                           m 
                         
                         ⁢ 
                         
                           
                             w 
                             ′ 
                           
                           ( 
                           
                             m 
                             , 
                             n 
                           
                           ) 
                         
                       
                     
                     ) 
                   
                   ⁢ 
                   
                     ( 
                     
                       
                         n 
                         = 
                         1 
                       
                       , 
                       2 
                       , 
                       … 
                           
                       , 
                       32 
                     
                     ) 
                   
                 
               
               , 
             
           
         
       
       wherein w′(m,n) indicates a weight from a hidden layer node to an output layer node. 
     
     
         6 . The ANN-based program testing method according to  claim 5 , wherein in S 5 , the deviation satisfies 
       
         
           
             
               
                 d 
                 = 
                 
                   
                     ∑ 
                     
                       n 
                       = 
                       1 
                     
                     32 
                   
                   
                     
                       ❘ 
                       "\[LeftBracketingBar]" 
                     
                     
                       
                         o 
                         n 
                         ′ 
                       
                       - 
                       
                         o 
                         n 
                       
                     
                     
                       ❘ 
                       "\[RightBracketingBar]" 
                     
                   
                 
               
               , 
             
           
         
       
       wherein O n  indicates an output value of function implementation. 
     
     
         7 . The ANN-based program testing method according to  claim 1 , wherein in S 2 , in a process of training the BP neural network model, curve changes are observed by means of simulation software. 
     
     
         8 . The ANN-based program testing method according to  claim 1 , wherein under the condition that a range of the input values in the training samples in S 2  is less than one million, all the input values are used as the training samples, and if not, one million input values are randomly selected as the training samples. 
     
     
         9 . A testing system provided by the ANN-based program testing method according to  claim 1 , comprising: a program basic testing unit configured to preliminarily test a function of a target program and whether the program itself is wrong;
 an ANN trainer configured to store various training models, and obtain a convergent the ANN model by means of training samples;   a curve display that is in signal connection with the ANN trainer and configured to display a convergent state of a model curve in real time;   a memory configured to store the target program, a test model itself and data generated in a running process;   a processor configured to run the target program and the test model; and   a readable storage medium configured to transfer data in all devices.

Join the waitlist — get patent alerts

Track US2022300820A1 — get alerts on status changes and closely related new filings.

We store only your email — no account needed. See our privacy policy.