Program defect location method based on sentence spectrum
By combining probabilistic neural networks and DS evidence theory, and utilizing statement spectrum for program defect localization, the problems of long localization time and low accuracy in existing methods are solved, achieving efficient and accurate program defect localization.
Patent Information
- Application Number
- CN202310477080.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2025-02-07
- Estimated Expiration
- 2043-04-28
AI Technical Summary
Existing spectrum-based methods for locating program defects suffer from high overhead and error omissions, resulting in long location times and insufficient accuracy.
This paper proposes a method that combines probabilistic neural networks with DS evidence theory. By using the statement spectrum of each statement in the program as input, the accuracy and efficiency of localization are improved through training of probabilistic neural networks and integration of evidence theory.
It achieves high accuracy and short processing time for program defect localization, reduces error omissions, has simple and scalable network learning capabilities, high evidence reliability, and greatly improves recognition accuracy.
Smart Images

Figure CN118312406B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of program testing, and specifically provides a method for locating program defects based on statement spectra. Background Art
[0002] Program defect localization aims to detect and find the error code that causes program failure, which is a very tedious and time-consuming activity. The traditional debugging method of manually setting breakpoints is not only difficult to select the breakpoint location, but also time-consuming. Therefore, realizing the automation of defect localization has become a common goal pursued by the software academic and industrial circles. In recent years, researchers have tried to propose a series of methods to assist in automatic defect localization from different perspectives, including slicing-based methods, program invariant-based methods, model checking methods, and program spectrum-based methods. The slicing-based defect localization method mainly finds the statements associated with the given variables through static or dynamic analysis of the program, thereby narrowing the scope of error search. The invariant-based method assists in locating the error statement by utilizing the difference information between the program invariants in the successful and failed test executions. The model checking method relies on the conflict between the failed program behavior and the expected model behavior to deduce the program error. In comparison, the spectrum-based fault localization method (SFL) has become a relatively effective and important method because it does not need to consider the internal structure of the program itself and has low execution overhead.
[0003] The program spectrum usually refers to the collection of code coverage information when the program is running, and is a form of description of the dynamic behavior characteristics of the program. Since a certain error statement must have been executed when the program fails, an empirical inference can be drawn: when a certain statement is covered by more failed executions, the possibility that it is an error statement is higher. Therefore, it is possible to deduce the location of program defects by collecting information on both the program spectrum and the execution results. Specifically, the SFL method mainly compares and analyzes the program spectrum information of the tested program in successful execution and failed execution, and constructs the corresponding suspicion calculation formula to estimate the possibility of program entity errors. Finally, the debugger checks the program entities for errors one by one in descending order of suspicion.
[0004] However, this method will have problems of additional overhead and errors and omissions, which will have a significant impact on the results and take a lot of time.
[0005] Therefore, there is an urgent need for a program defect location method that is accurate and time-saving. Summary of the invention
[0006] In order to solve the above problems, the present invention provides a method for locating program defects based on statement spectra, which mainly takes the statement spectra of each statement in the program as input, and organically integrates the probabilistic neural network and the DS evidence theory, giving full play to the advantages of both and overcoming the disadvantages of both. The present invention has high accuracy, short training time and software defect location processing time, and high scalability, meeting the requirements of program defect location.
[0007] The method for locating program defects based on sentence spectrum provided by the present invention comprises the following steps:
[0008] S1. Training, testing and correction of probabilistic neural networks, specifically:
[0009] S101, using the test program P = {s1, s2, ..., s M}Execute the test case set T = {t1, t2, ..., t l} in the test case t i , get the sentence spectrum Ps(t i )={e1,e2,…,e j ,…,e M}, where s i (1≤i≤M) represents the i-th function of the test program, M represents the number of statements that constitute the test program, and t i (1≤i≤l) represents the i-th test case, and l represents the total number of test cases. j (1≤j≤M) represents t i Whether to cover statement s j , if t i Covering Statements j , then e j The value is 1; otherwise e j The value is 0.
[0010] Recording test cases i The execution result Rs(t i ), if t i If the execution is successful, then Rs(t i ) is 0, if t i If the execution fails, Rs(t i ) is 1.
[0011] S102, based on DS evidence theory, determine the recognition framework of the positioning result as Θ={A1,A2,…,A N}, where Proposition A1 indicates that there is a defect in the current sentence to be recognized, Proposition A2 indicates that there is no defect in the current sentence to be recognized, and other propositions indicate other situations existing in the current sentence to be recognized;
[0012] S103, selecting L probabilistic neural networks, where L is an integer not less than 3, and each probabilistic neural network has a different activation function, expansion speed, and learning algorithm;
[0013] S104, the sentence spectrum Ps(t i )={e1,e2,…,e j ,…,e M} as the characteristic data of the sample data; the execution result of the test case (Rs(t i ), 1-Rs(t i )) as the labeled data of the sample data; and dividing the sample data into a training sample set and a test sample set;
[0014] S105, completing the training of the probabilistic neural network using the training sample set;
[0015] S106. Use the test sample set to complete the test of the probabilistic neural network, convert the output of the probabilistic neural network into evidence through the DS evidence theory, convert the basic probability assignment of the evidence into the Pignistic probability of each single element, and select the element with the largest value as the evaluation result; establish an indicator function to determine whether the evaluation result is consistent with the true result, and calculate the reliability factor of the evidence output by each probabilistic neural network according to the indicator function;
[0016] S2. Defect location of the problem program, specifically:
[0017] S201, construct a virtual test case for each statement in the problem program, and repeat S101 to obtain the statement coverage information Ps′(ts i )={e1,e2,…,e j ,…,e M}, where e i The value of e is 1, j The value of (1≤j≤M, j≠i) is 0;
[0018] S202, inputting the data of the virtual test case into each probabilistic neural network respectively to obtain output results;
[0019] S203, using the DS evidence theory to generate corresponding evidence from the output result, and modifying the evidence according to the reliability factor; combining the modified evidence using the Dempster combination rule to obtain a combination result;
[0020] S204: Calculate the suspiciousness Susp(s) of each statement according to the combination result. i ), Suspiciousness Susp(s i ) has a value range of [0,1];
[0021] By sorting the suspiciousness of all statements, a defect location report of the problematic program can be obtained.
[0022] Preferably, the topological structure of each probabilistic neural network is the same, specifically:
[0023] Input layer, 1 layer, the number of nodes is the same as the number of statements in the test program;
[0024] Pattern layer, 1 layer, the number of nodes is the same as the number of samples in the training sample set;
[0025] Summation layer, 1 layer, the number of nodes is N, N is any integer not less than 2;
[0026] Output layer, 1 layer, the number of nodes is N, N is any integer not less than 2.
[0027] Preferably, the output layer of the probabilistic neural network is replaced by a softmax layer, the number of nodes of the softmax layer is N, and N is any integer not less than 2.
[0028] Preferably, after the output layer of the probabilistic neural network is replaced with a softmax layer, the calculation formula for the output result is as follows:
[0029]
[0030] Among them, the probabilistic neural network C i The number of (i=1,2,...,L) is L, C i The output of the summation layer of (i=1,2,...,L) is (S i1 ,S i2 ,...,S iN ), S ij is the output result of the jth (j=1,2,...,N) node of the sum layer, and the output result of the softmax layer is (R i1 ,R i2 ,...,R iN ), R ij is the output result of the jth (j=1,2,...,N) node of the softmax layer.
[0031] Preferably, the output of the probabilistic neural network is transformed to generate evidence:
[0032] E i =(m i (A1),m i (A2),...,m i (A N ),m i (Θ));
[0033] in, m i (A j ) indicates evidence E i Zhongjiaoyuan A j The basic probability assignment of .
[0034] Preferably, the calculation process of the reliability factor of evidence is as follows:
[0035] Set the test sample set to O = {o1, o2, ..., o T},O k (k=1,2,...,T) represents any test sample in the test sample set, and the probabilistic neural network C i The reliability factor of the evidence corresponding to (i=1,2,...,L) is
[0036] Calculate the test sample O k (k=1,2,...,T) corresponding evidence E i Zhongjiaoyuan A j The Pignistic probability function value BetP{o k}(A j )for:
[0037]
[0038] Where X represents a set;
[0039] Set the indicator function to δ jk (j=1,2,...,N;k=1,2,...,T), when the evaluation result is consistent with the true result, δ jk =1; when the evaluation result is inconsistent with the actual result, δ jk =0;
[0040] Computational Probabilistic Neural Networks C i The reliability factor of the evidence corresponding to (i=1,2,...,L) as follows:
[0041]
[0042] Among them, α i is a variable, p jk =BetP{o k}(A j ).
[0043] Preferably, the evidence output by different probability neural networks is corrected according to the reliability factor, and the corrected evidence E i Zhongjiaoyuan A j The basic probability assignment m i'(A j )for:
[0044]
[0045] Preferably, the modified evidence E is combined using Dempster's combination rule. i Zhongjiaoyuan A j The basic probability assignment m i '(A j ) are combined in pairs, and the combination result is F = (m f (A1),m f (A2),...,m f (A N ),m f (Θ)), where m f (A j ) represents the corrected evidence E i Zhongjiaoyuan A j The basic probability assignment m i '(A j ) is the combined result of .
[0046] Preferably, 70% of the sample data is used as a training sample set and 30% is used as a test sample set.
[0047] Compared with the prior art, the present invention can achieve the following beneficial effects:
[0048] The present invention mainly utilizes probabilistic neural networks to fully explore the potential relationship between statement coverage information and execution results. Compared with the existing method of training the network through statements or functions, the present invention replaces statements or functions with statement spectra, which has higher accuracy and greatly avoids errors and omissions in the defect location process.
[0049] The present invention adopts a probabilistic neural network, and the network learning process is simple and the convergence speed is fast. It directly obtains the connection weights of hidden units according to sample characteristics and expected outputs, and there is no need to repeatedly train the network. It has good fault tolerance and strong pattern classification ability. Its hidden layer adopts a nonlinear mapping function of a radial basis, and takes into account the influence of the mutual intersection between samples of different categories. The final decision interface between different categories satisfies the Bayesian optimal solution. The network has good expansion performance. Since the learning process is simple, adding and reducing new category pattern samples does not require long-term training and learning.
[0050] The present invention uses multiple independent probabilistic neural networks as the evidence source of evidence theory, ensuring the reliability of evidence. At the same time, the concept of evidence reliability factor is introduced to measure the reliability of evidence given by different probabilistic neural networks. The output value of the probabilistic neural network is corrected by the evidence reliability factor, and then used as the basic credibility of the proposition on the final identification framework. After the reintegration of evidence theory, the information of the evidence source can be fully utilized, greatly improving the accuracy of recognition, and eliminating the incompleteness and ambiguity of the information contained in a single evidence source. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 It is a flowchart of a method for locating program defects based on sentence spectra provided according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] Hereinafter, embodiments of the present invention will be described with reference to the accompanying drawings. In the following description, the same modules are represented by the same reference numerals. In the case of the same reference numerals, their names and functions are also the same. Therefore, the detailed description thereof will not be repeated.
[0053] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and do not constitute a limitation of the present invention.
[0054] It should be noted that the embodiments of the present invention involve a large number of formulas and letter expressions, which do not constitute a limitation on the protection scope of the present invention. Simple deformation of the formulas or replacement of letters should still fall within the protection scope of the present invention.
[0055] It should be noted that the superscripts of the formulas and letters involved in the embodiments of the present invention are only used for distinction or sorting and have no practical meaning.
[0056] Figure 1 The flowchart of the method for locating program defects based on sentence spectra provided according to an embodiment of the present invention is shown.
[0057] like Figure 1 As shown, the embodiment of the present invention proposes a method for locating program defects based on sentence spectra, which specifically includes the following steps:
[0058] S1. Use probabilistic neural networks to fully explore the potential relationship between statement coverage information and execution results, and train, test and correct the probabilistic neural network with statement coverage information and execution results. The specific process is as follows:
[0059] S101. In the training process of the probabilistic neural network, a large number of test programs are required to execute the test cases as training samples. In the following, only one test program is used as an example to illustrate. The selected test program P = {s1, s2, ..., s M}, where P consists of M statements, with s j (1≤j≤M) represents the jth statement in the test program.
[0060] Use P to execute the test case set T = {t1, t2, ..., t l} in the test case t i , obtain sentence coverage data, that is, sentence spectrum Ps(t i )={e1,e2,…,e j ,…,e M}, where the test case set has a total of l test cases, the results of the test cases are all known, and t i (1≤i≤l) represents the i-th test case; in the sentence spectrum, e j (1≤j≤M) represents t i Whether to cover statement s j , if t i Covering Statements j , then e j The value is 1; otherwise e j The value is 0.
[0061] During the execution of the test program, record the test cases i The execution result Rs(t i ), if t i If the execution is successful, then Rs(t i ) is 0, if t i If the execution fails, Rs(t i ) is 1. In the embodiment of the present invention, the number of statements in the test program is 6, that is, M=6, and the statement spectrum obtained after inputting test cases t1, t2 and t3 is as shown in Table 1 below:
[0062] Table 1 Statement spectrum corresponding to test cases
[0063]
[0064] S102, based on DS evidence theory, determine the recognition framework of the positioning result as Θ={A1,A2,…,A N}, wherein proposition A1 indicates that there is a defect in the current sentence to be recognized, proposition A2 indicates that there is no defect in the current sentence to be recognized, and other propositions indicate other situations existing in the current sentence to be recognized. In the embodiment of the present invention, other situations are not considered in the proposition, so no other propositions are set, that is, the actual recognition framework is Θ={A1,A2}. In special cases, propositions such as uncertainty or no judgment can also be set in the recognition framework. However, in order to fully explain the calculation formulas involved, N propositions are still used in the following. In this embodiment, except for the proposition and proposition A2, other propositions can be regarded as not output.
[0065] S103, select L probabilistic neural networks, use C i (i=1,2,...,L) represents the ith probabilistic neural network. To avoid the problem that a single network is not universal and a single network may have large errors, the total number of probabilistic neural networks L should be no less than 3. At the same time, to ensure the diversity of probabilistic neural networks, the activation function, expansion speed, learning algorithm and other parameters of each probabilistic neural network are set differently.
[0066] The topological structure of each probabilistic neural network is the same, and the specific structure is:
[0067] The input layer is set to 1 layer, and the number of nodes is set to be the same as the number of statements in the test program, that is, 6;
[0068] The pattern layer is set to 1 layer, and the number of its nodes is the same as the number of samples in the training sample set;
[0069] The summation layer is set to 1 layer, and the number of its nodes is the same as the number of elements in the recognition frame, that is, 2;
[0070] The output layer is set to 1 layer, and the number of nodes is N, where N is any integer not less than 2. In this embodiment, the output layer only considers two situations: the presence of defects and the absence of defects. N is 2. The following is to clarify the formula, and N is still used in the formula.
[0071] As an optional embodiment, the output layer of the probabilistic neural network is replaced by a softmax layer, the number of nodes of the softmax layer is N, and after the output layer of the probabilistic neural network is replaced by the softmax layer, the calculation formula of the output result is as follows:
[0072]
[0073] Among them, the probabilistic neural network C i The number of (i=1,2,...,L) is L, C i The output of the summation layer of (i=1,2,...,L) is (S i1 ,S i2,...,S iN ), S ij is the output result of the jth (j=1,2,...,N) node of the sum layer, and the output result of the softmax layer is (R i1 ,R i2 ,...,R iN ), R ij is the output result of the jth (j=1,2,...,N) node of the softmax layer.
[0074] S104, the sentence spectrum Ps(t i )={e1,e2,…,e j ,…,e M} as the characteristic data of the sample data; the execution result of the test case (Rs(t i ), 1-Rs(t i )) is used as the labeled data of the sample data, and the sentence spectrum is converted into sample data according to Table 1. The specific results are shown in Table 2:
[0075] Table 2 Sample data corresponding to sentence spectra
[0076]
[0077] Without loss of generality, the sample data is divided into 70% training sample set and 30% test sample set.
[0078] S105, using the training sample set to train each probabilistic neural network separately, the training process of multiple probabilistic neural networks can be carried out simultaneously until the training of all probabilistic neural networks is completed.
[0079] S106: First, set the test sample set to O = {o1, o2, ..., o T},O k (k=1,2,...,T) represents any test sample in the test sample set, and the probabilistic neural network C i The reliability factor of the evidence corresponding to (i=1,2,...,L) is
[0080] For the test sample O currently to be processed k (k=1,2,...,T), and input it into the probabilistic neural network C i (i=1,2,...,L), the output of the probabilistic neural network (R i1 ,R i2 ,…,R iN ) Transformation generates evidence E i , then:
[0081] Ei =(m i (A1),m i (A2),...,m i (A N ),m i (Θ));
[0082] in, m i (A j ) indicates evidence E i Zhongjiaoyuan A j The basic probability assignment of .
[0083] Then, according to the Pignistic probability function, the evidence E i Make a decision and take evidence E i The basic probability assignment is converted to the Pignistic probability of each single element, and the evidence E is calculated. i Zhongjiaoyuan A j The Pignistic probability function value BetP{o k}(A j ) is as follows:
[0084]
[0085] Where X represents a set.
[0086] Evidence E i All focal elements A j The Pignistic probability function value is calculated, and the element with the largest value is selected as the evaluation result, that is: if m i (A1)≥m i (A2), test sample O k There are defective statements in the statements covered by the test cases corresponding to (k=1,2,...,T), otherwise there are no defective statements.
[0087] Set the indicator function to δ jk (j=1,2,...,N;k=1,2,...,T), and obtain the test sample O k (k=1,2,...,T) corresponding indicator function δ jk The value of indicates that the specific expression of the function is:
[0088] When the evaluation result is consistent with the true result, δ jk =1;
[0089] When the evaluation result is inconsistent with the true result, δ jk =0;
[0090] When the test sample set O = {o1,o2,...,oT After all the test samples in} are processed, the probability neural network C is calculated. i The reliability factor α of the evidence corresponding to (i=1,2,...,L) i 0 as follows:
[0091]
[0092] Among them, α i is a variable, p jk =BetP{o k}(A j ).
[0093] After obtaining the reliability factors of all probabilistic neural networks, the reliability factors are bound to the probabilistic neural networks one by one, so as to facilitate the correction of each probabilistic neural network when locating the defect of the problem program.
[0094] S2. Use the probabilistic neural network obtained in S1 to locate the defects of the problem program, specifically:
[0095] S201, construct a virtual test case for each statement in the problem program, and repeat S101 to obtain the statement coverage information Ps′(ts i )={e1,e2,…,e j ,…,e M}, where e i The value of e is 1, j The value of (1≤j≤M, j≠i) is 0.
[0096] Taking Table 1 as an example, construct its corresponding virtual test case. The statement coverage information of the virtual test case corresponding to statement s1 in Table 1 is Ps′(ts1)={1,0,0,0,0,0};
[0097] S202: Input the data of the virtual test case into each probabilistic neural network respectively to obtain output results.
[0098] S203, using DS evidence theory to generate the corresponding evidence of the problem program from the output result, and modifying the evidence of the problem program according to the reliability factor calculated in S106; the modified evidence E i Zhongjiaoyuan A j The basic probability assignment m i '(A j )for:
[0099]
[0100] The modified evidence is combined using Dempster's combination rule to obtain the combination result, which is as follows:
[0101] Set the evaluation result recognition framework Θ = {A1, A2, ..., A N The trust functions of} are BEL1 and BEL2, and m'1 and m'2 are assigned the corresponding basic probabilities after correction, B1, B2, ..., B k and C1,C2,...,C r is the corresponding focal element, then the Dempster combination rule is as follows:
[0102]
[0103] in, H is the combined data set.
[0104] Dempster combination rule satisfies the associative law. When multiple pieces of evidence are fused, pairwise fusion or other methods can be used. The combination result obtained by combining each piece of evidence using Dempster combination rule is F = (m f (A1),m f (A2),…,m f (A N ),mf(Θ)).
[0105] S204: Calculate the suspiciousness Susp(s) of each statement according to the combination result. i ), the suspicious degree Susp(s i ) is used to reflect the degree to which the corresponding statement is a defect. The higher the suspicion, the greater the possibility that the statement is a defect. The suspicion Susp(s i ) has a value range of [0,1];
[0106] According to the specified recognition framework Θ = {A1, A2}, where proposition A1 indicates that there is a defect in the current sentence to be recognized, and proposition A2 indicates that there is no defect in the current sentence to be recognized, the suspicion degree Susp (s i ) is calculated as:
[0107] Susp(s i )=m f (A1);
[0108] After calculating the suspiciousness of all statements, the statements are monotonically sorted according to the suspiciousness values, and the defect location report of the problem program is obtained, as shown in Table 3.
[0109] Table 3 Defect location report
[0110]
[0111]
[0112] The defect location can be located according to the statement sequence in the defect location report.
[0113] Although the embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. Those skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
[0114] The above specific implementations of the present invention do not constitute a limitation on the protection scope of the present invention. Any other corresponding changes and modifications made based on the technical concept of the present invention should be included in the protection scope of the claims of the present invention.
Claims
1. A method for locating program defects based on sentence spectrum, characterized in that: The following steps are involved: S1. Training, testing and correction of probabilistic neural networks, specifically: S101. Utilization of test procedures Execute a collection of test cases sequentially Test cases in t i , get the sentence spectrum ,in, M Indicates the number of statements that make up the test program, and is represented by Indicates the first j A statement, Indicates i Test cases, l Indicates the total number of test cases; express Whether to cover the statement ,like Covering Statements ,but The value is 1, otherwise The value is 0; Recording test cases The execution result ,like If the execution is successful, is 0, if If the execution fails, is 1; S102. Based on DS evidence theory, the identification framework of the positioning result is determined as , among which, the proposition Indicates that there is a defect in the current sentence to be recognized. It indicates that there is no defect in the current sentence to be identified, and other propositions indicate other situations that exist in the current sentence to be identified; S103, Select L A probabilistic neural network, L is an integer not less than 3, and the activation function, expansion speed and learning algorithm of each of the probabilistic neural networks are different; S104, Sentences As the characteristic data of the sample data; the execution results of the test case ( , ) as the labeled data of the sample data; and divide the sample data into a training sample set and a test sample set; S105, completing the training of the probabilistic neural network using the training sample set; S106, using the test sample set to complete the test of the probabilistic neural network, converting the output of the probabilistic neural network into evidence through the DS evidence theory, converting the basic probability assignment of the evidence into the Pignistic probability of each single element, and selecting an element with the largest value as the evaluation result; establishing an indicator function to determine whether the evaluation result is consistent with the true result, and calculating the reliability factor of each piece of evidence output by the probabilistic neural network according to the indicator function; S2. Defect location of the problem program, specifically: S201: construct a virtual test case for each statement in the problem program, and repeat S101 to obtain statement coverage information of the virtual test case. ,in, The value of is 1, The value of is 0; S202, inputting the data of the virtual test case into each of the probabilistic neural networks respectively to obtain output results; S203, using the DS evidence theory to generate corresponding evidence from the output result, and modifying the evidence according to the reliability factor; combining the modified evidence using the Dempster combination rule to obtain a combination result; S204. Calculate the suspiciousness of each statement based on the combined result , suspicious The value range is ; The defect location report of the problem program can be obtained by sorting the suspiciousness of all statements in descending order.
2. The method for locating program defects based on sentence spectrum according to claim 1, characterized in that: The topological structure of each of the probabilistic neural networks is the same, specifically: Input layer, 1 layer, the number of nodes is the same as the number of statements in the test program; Pattern layer, 1 layer, the number of nodes is the same as the number of samples in the training sample set; Summation layer, 1 layer, the number of nodes is N, N is any integer not less than 2, and the number of nodes is the same as the number of elements in the recognition frame; Output layer, 1 layer, the number of nodes is N, N is any integer not less than 2, and the number of nodes is the same as the number of elements in the recognition frame.
3. The method for locating program defects based on sentence spectrum as claimed in claim 1, characterized in that: The output layer of the probabilistic neural network is replaced by a softmax layer, the number of nodes in the softmax layer is N, and N is any integer not less than 2.
4. The method for locating program defects based on sentence spectrum as claimed in claim 3, characterized in that: After the output layer of the probabilistic neural network is replaced by the softmax layer, the calculation formula of the output result is as follows: ; Wherein, the probabilistic neural network The number of L , The output of the summation layer is , For the summation layer The output result of the nodes and the output result of the softmax layer are , is the first The output of each node.
5. The method for locating program defects based on sentence spectrum as claimed in claim 4, characterized in that: The output transformation of the probabilistic neural network generates the evidence: ; in, , Show evidence Zhongjiaoyuan The basic probability assignment of .
6. The method for locating program defects based on sentence spectrum as claimed in claim 5, characterized in that: The calculation process of the reliability factor of evidence is as follows: Set the test sample set to , represents any test sample in the test sample set, the probabilistic neural network ( ) The reliability factor of the evidence corresponding to ; Calculate the test sample Corresponding evidence Zhongjiaoyuan The Pignistic probability function value for: ; in, X Represents a collection; Set the indicator function to ( ), when the evaluation result is consistent with the true result, ; When the evaluation result is inconsistent with the actual result, ; Calculate the probabilistic neural network The corresponding reliability factor of the evidence as follows: ; in, is a variable, , .
7. The method for locating program defects based on sentence spectrum according to claim 6, characterized in that: According to the reliability factor, the evidence output by the different probability neural networks is modified, and the modified evidence Zhongjiaoyuan The basic probability assignment for: 。 8. The method for locating program defects based on sentence spectrum according to claim 7, characterized in that: Using Dempster's combination rule, the corrected evidence Zhongjiaoyuan The basic probability assignment Perform two-by-two combinations and obtain the combination result as follows: ,in, Represents the corrected evidence Zhongjiaoyuan The basic probability assignment The combined result.
9. The method for locating program defects based on sentence spectrum as claimed in claim 1, characterized in that: 70% of the sample data is used as the training sample set and 30% as the test sample set.
Citation Information
Patent Citations
Software fault location method, device, apparatus, and readable storage medium
CN109254924A
A System for analyzing applications in order to find security and quality issues
US20150309813A1