Software fault multi-dimensional association relationship analysis method based on association rule mining
By introducing multi-dimensional analysis methods in software fault association analysis, combining association rule mining technology, calculating the multi-dimensional correlation number of software faults, the problem that existing methods cannot fully reflect the degree of software fault association is solved, and the accuracy of software fault location and prediction is improved.
Patent Information
- Application Number
- CN202411857862.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-17
AI Technical Summary
The existing software fault association analysis methods fail to fully reflect the degree of association between software faults, resulting in insufficient accuracy in software fault location and prediction.
A multi-dimensional analysis method based on association rule mining is adopted, and the analysis is carried out through three dimensions: inter-failure correlation, in-failure feature correlation and software fault structure correlation, and the multi-dimensional correlation correlation number of software faults is calculated to generate more accurate correlation relationship analysis results.
It improves the accuracy of software failure location and prediction, provides a more comprehensive software failure correlation analysis, and can more effectively support software testing and maintenance work.
Smart Images

Figure CN119718942A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of software service fault detection, and is a method for analyzing multi-dimensional association relationships of software faults based on association rule mining. Background Art
[0002] With the development of computer technology and the continuous increase in user demand, computer technology with software as the core has gradually penetrated into all walks of life, and with its high efficiency and low error rate, it has played an increasingly important role in various industries and people's daily lives. However, due to the increasing demand, the scale of software systems has become larger and larger, and the complexity of software has also increased exponentially. The resulting software quality issues have gradually become a bottleneck restricting the development of the computer industry. Software failure is the loss of the ability of software to perform tasks under specific environmental conditions. It is caused by software defects and is a prerequisite for software failure. It is generally discovered in large quantities during the software testing phase. Software failure often leads to many problems. How to properly handle software failures is the key to the complete life cycle of software products, and it is also the fundamental guarantee for software product development, quality improvement and maintenance.
[0003] Discovering and repairing software faults is an important task in software testing, maintenance and management. Fault location is one of the most time-consuming activities. It extracts software source program architecture information, analyzes it in combination with program features, predicts the location and cause of software faults, and provides a reference for developers' fault repair operations. Existing studies have shown that there is a correlation between software faults. Analyzing the historical fault information of the software can enable testers to find common faults and improve the accuracy of locating and predicting related software faults. Because it is almost impossible to completely eliminate faults during the development process, how to use the fault information in the software fault information database to measure the degree of correlation between software faults, locate and predict related faults according to the degree of fault correlation, so as to improve the efficiency of testers in repairing software faults has become a key research topic in the field of software testing.
[0004] Software fault classification technology is a common technology for managing and analyzing software fault information, and is widely used in the field of software testing. By using fault classification technology, we can quickly extract software fault-related features, determine the root cause of the problem, accumulate relevant repair experience for the corresponding type of problem, and quickly give repair reference opinions when encountering similar problems. Software fault classification technology can quickly discover and repair software faults, improve software development efficiency, and is also conducive to analyzing the causes of software faults, making it convenient for managers to formulate corresponding software quality improvement measures and improve software stability. At present, there are a large number of software fault classification standards at home and abroad, including the national military standard classification method, Thayer software error classification method, Institute of Electrical and Electronics Engineers software anomaly classification standard, orthogonal defect classification method, etc. Different classification methods have different classification targets and observation angles, and users need to screen them according to different development environments.
[0005] Association rule mining technology is an important data mining research method. Currently, there are a large number of studies related to software fault association analysis. However, in most of these existing studies, the calculation of fault association coefficients is only analyzed from one dimension, and the range of values of the calculated fault association coefficients is not perfect. This method of calculating fault association coefficients is difficult to fully reflect the degree of correlation between software faults in actual situations, thus affecting the accuracy of software fault location and prediction. In this context, multi-dimensional analysis and calculation of software fault associations has become an important direction of current research. Summary of the invention
[0006] In view of the shortcomings of the prior art, the present invention provides a method for analyzing multi-dimensional correlation relationships of software faults based on association rule mining. The present invention proposes a method for analyzing multi-dimensional correlation relationships of software faults based on association rule mining in the field of software fault location, realizes correlation analysis of software faults from three dimensions: correlation between faults, correlation of features within faults, and correlation of software fault structures, and calculates the multi-dimensional correlation coefficients of faults based on the analysis results of different dimensions to generate the final correlation analysis results; the present invention provides the following technical solutions:
[0007] A method for analyzing multi-dimensional association relationships of software faults based on association rule mining, the method comprising the following steps:
[0008] Step 1: Perform data preprocessing. Preprocess the test case data, extract all fault data from the test case data based on the software fault feature model of orthogonal defect classification, and convert the test case data into a format that is most suitable for association rule mining.
[0009] Step 2: After data preprocessing, use the FP-Growth method to mine fault association rules and obtain frequent item sets;
[0010] Step 3: Calculate the closeness of the correlation between faults to measure the strength of the correlation between faults in the dimension of the fault itself;
[0011] Step 4: Calculate the fault feature correlation coefficient to measure the similarity between the two faults in the dimension of fault feature information;
[0012] Step 5: Calculate the software fault structure correlation coefficient and determine the structural correlation relationship;
[0013] Step 6: Calculate the multi-dimensional correlation coefficient of software failures to obtain accurate multi-dimensional correlation coefficients of software failures.
[0014] Preferably, after the data processing is completed, the software test case data is converted into D<d1, d n , …, d n > in the form of i is the fault number information of the i-th fault.
[0015] Preferably, the step 3 is specifically:
[0016] The degree of association between faults in the dimension of fault relationship is measured by the closeness of the association relationship L, and the lift is calculated. The lift refers to the ratio of the probability of the occurrence of the successor B under the condition of the predecessor A of the association rule in the database D to the overall probability of the occurrence of B:
[0017]
[0018] The fault correlation coefficient is normalized so that the value range of the fault correlation density is between 0 and 1. Therefore, the calculation formula of the fault correlation density L is as follows:
[0019]
[0020] The closeness of the correlation between faults, L, is used to measure the strength of the correlation between faults in the dimension of the fault itself. The closer the value of L is, the stronger the correlation is.
[0021] Preferably, the step 4 is specifically:
[0022] The fault feature set uses a set to represent the features of the fault. When A is the fault feature set corresponding to a certain fault, it is shown in the following formula:
[0023] A={A1,A2,…,A i , …, A n}
[0024] Among them, Ai is the value of the i-th feature in the software fault feature model corresponding to the current fault;
[0025] Determine the similarity of fault feature dimensions When calculating the feature correlation coefficient of two faults, it is first necessary to calculate the similarity of each feature dimension of the two faults, that is, the fault feature dimension similarity;
[0026] Use the Levenshtein ratio as a measure of the similarity between two fault dimensions:
[0027]
[0028] Where a and b are strings representing the value of a feature in the fault feature information, len(a) represents the length of string a, and L(a, b) represents the Levenshtein distance between a and b.
[0029] Determine the fault feature correlation coefficient S: The fault feature correlation coefficient is the fault feature similarity, which is used to measure the similarity between two faults in the dimension of fault feature information.
[0030] Preferably, when A and B are fault feature sets of two faults, that is, two d-dimensional vectors, each eigenvalue in the vector corresponds to a feature dimension in the software fault feature model, and Ai and Bi are identifiers of any feature dimension, the calculation method of the fault feature correlation coefficient S is as follows:
[0031]
[0032] The fault feature correlation coefficient is calculated and used as a measure of the strength of the correlation relationship of software faults in the dimension of internal fault features.
[0033] Preferably, the step 5 is specifically:
[0034] The strength of the correlation between faults is measured by the function dependency graph, and the propagation probability p between two adjacent function nodes is defined as follows:
[0035]
[0036] Among them, x and y are adjacent nodes in the functional dependency graph, next(y) represents the set of successor nodes of y, and out(y,x) represents the out-degree from y to x;
[0037] Calculate the propagation possibility of any two nodes in the function dependency graph, that is, the software fault structure correlation coefficient. The calculation formula of the software fault structure correlation coefficient M is as follows:
[0038]
[0039] Among them, t i is the i-th node on the shortest path from node A to node B in the functional dependency graph;
[0040] The final software fault structural correlation coefficient is calculated by cumulative multiplication. The higher the coefficient value, the stronger the structural correlation relationship.
[0041] Preferably, the step 6 is specifically:
[0042] The multi-dimensional correlation coefficient FCC of software failure is calculated by the following formula:
[0043] FCC(A,B)=α·L(A,B)+β·S(A,B)+γ·M(A,B)
[0044] Among them, α, β, and γ represent the weights of the closeness of the correlation between faults, the correlation coefficient of the characteristics within the fault, and the correlation coefficient of the software fault structure, respectively, where 0≤α≤1, 0≤β≤1, 0≤γ≤1, and α+β+γ=1.
[0045] A software fault multi-dimensional association relationship analysis system based on association rule mining, the system comprising:
[0046] A preprocessing module, which performs data preprocessing, preprocesses the test case data, extracts all fault data from the test case data based on a software fault feature model of orthogonal defect classification, and converts the test case data into a format most suitable for association rule mining;
[0047] An association mining module, after data preprocessing, uses the FP-Growth method to mine fault association rules to obtain frequent item sets;
[0048] A closeness calculation module, which performs closeness calculation of correlation between faults to measure the strength of correlation between faults in the dimension of the faults themselves;
[0049] A feature correlation coefficient calculation module, which calculates the fault feature correlation coefficient to measure the similarity between two faults in the dimension of fault feature information;
[0050] A structural correlation coefficient calculation module, which calculates the structural correlation coefficient of software faults and determines the structural correlation relationship;
[0051] A multi-dimensional correlation coefficient calculation module is used to calculate the multi-dimensional correlation coefficient of software faults to obtain accurate multi-dimensional correlation coefficients of software faults.
[0052] A computer-readable storage medium stores a computer program, which is executed by a processor to implement a software fault multi-dimensional association relationship analysis method based on association rule mining.
[0053] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements a method for analyzing multi-dimensional association relationships of software faults based on association rule mining when executing the computer program.
[0054] The present invention has the following beneficial effects:
[0055] Compared with the prior art, the present invention has the following advantages:
[0056] The existing software fault correlation analysis methods either fail to consider the relationship between fault information, or ignore the structural relationship of faults in the overall software architecture, or have the problem of low efficiency in the context of large-scale data. Compared with the traditional fault correlation analysis method based on test cases and software metrics, the present invention has the advantages of comprehensively considering multiple different dimensions in the scenario where software faults occur and making the analysis more comprehensive; compared with the Apriori association rule mining algorithm, it has the advantage of higher efficiency when facing large-scale data. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0058] Figure 1 Shown is a flow chart of the software fault multi-dimensional correlation relationship analysis method of the present invention;
[0059] Figure 2 Shown is a data preprocessing flow chart of the present invention;
[0060] Figure 3 Shown is a six-dimensional diagram of the software fault feature model based on orthogonal defect classification of the present invention;
[0061] Figure 4 Displayed is the software system fault characteristic information diagram of the present invention. DETAILED DESCRIPTION
[0062] The present invention is described in detail below in conjunction with specific embodiments. Specific embodiment one:
[0064] In view of the shortcomings of the prior art, the present invention provides a method for multi-dimensional correlation relationship analysis of software faults based on association rule mining. The present invention proposes a method for multi-dimensional correlation relationship analysis of software faults based on association rule mining in the field of software fault location, which realizes correlation relationship analysis of software faults from three dimensions: correlation between faults, correlation of features within faults, and correlation of software fault structures. The analysis results of different dimensions are used to calculate the multi-dimensional correlation coefficients of the faults to generate the final correlation relationship analysis results.
[0065] according to Figures 1 to 4 As shown, the specific optimization technical solution adopted by the present invention to solve the above technical problems is: the present invention relates to a multi-dimensional correlation relationship analysis method for software faults based on association rule mining.
[0066] A method for analyzing multi-dimensional association relationships of software faults based on association rule mining, the method comprising the following steps:
[0067] Step 1: Perform data preprocessing. Preprocess the test case data, extract all fault data from the test case data based on the software fault feature model of orthogonal defect classification, and convert the test case data into a format that is most suitable for association rule mining.
[0068] Step 2: After data preprocessing, use the FP-Growth method to mine fault association rules and obtain frequent item sets;
[0069] Step 3: Calculate the closeness of the correlation between faults to measure the strength of the correlation between faults in the dimension of the fault itself;
[0070] Step 4: Calculate the fault feature correlation coefficient to measure the similarity between the two faults in the dimension of fault feature information;
[0071] Step 5: Calculate the software fault structure correlation coefficient and determine the structural correlation relationship;
[0072] Step 6: Calculate the multi-dimensional correlation coefficient of software failures to obtain accurate multi-dimensional correlation coefficients of software failures.
[0073] The present invention proposes a software fault multi-dimensional correlation analysis method based on association rule mining in the field of software fault location, realizes correlation analysis of software faults from three dimensions: correlation between faults, correlation of fault features, and correlation of software fault structures, and calculates the multi-dimensional correlation coefficients of the analysis results of different dimensions to generate the final correlation analysis results. The process is as follows: Figure 1 shown.
[0074] The multi-dimensional association relationship analysis method of software faults based on association rule mining first requires the fault information library and test case information of orthogonal defect classification as the research basis. After obtaining these basic information, the test case data needs to be preprocessed, all the fault data in the test case is extracted, and the test case is converted into the format most suitable for association rule mining. Then the FP-Growth algorithm is used to mine fault association rules to obtain frequent item sets. In the dimension of inter-fault relationship, the closeness of the inter-fault association relationship L is constructed based on the lift degree Lift to measure the degree of association between faults; in the dimension of intra-fault, the Levenshtein distance is used to calculate the similarity of fault feature dimensions and the correlation coefficient S of the intra-fault features, which is used as the correlation strength measurement parameter of software faults in the dimension of internal fault features; in the dimension of software system architecture, based on the function call graph, the inheritance, polymorphism and other relationships in the class diagram are used to expand it, and the function dependency graph that can be used for fault structure association relationship analysis is obtained. The software fault structure correlation coefficient M is obtained by calculating the shortest path between two function nodes and the weight information on the shortest path. In actual situations, the three factors, namely, the closeness of the correlation relationship L between faults, the correlation coefficient S of the characteristics within the faults, and the correlation coefficient M of the software fault structure, cannot play a role completely independently, but interact with each other to produce an overall impact. Therefore, this patent combines these three factors, performs a weighted sum on them, and obtains a more accurate multi-dimensional correlation coefficient of software faults.
[0075] The existing software fault correlation analysis methods either fail to consider the relationship between fault information, or ignore the structural relationship of faults in the overall software architecture, or have the problem of low efficiency in the context of large-scale data. Compared with the traditional fault correlation analysis method based on test cases and software metrics, the present invention has the advantages of comprehensively considering multiple different dimensions in the scenario where software faults occur and making the analysis more comprehensive; compared with the Apriori association rule mining algorithm, it has the advantage of higher efficiency when facing large-scale data. Specific embodiment 2:
[0077] The difference between the second embodiment of the present application and the first embodiment is that:
[0078] After data processing, the software test case data is converted into D<d1, d n , …, d n > in the form of i is the fault number information of the i-th fault. Specific embodiment three:
[0080] The difference between the third embodiment of the present application and the second embodiment is that:
[0081] The step 3 is specifically as follows:
[0082] The degree of association between faults in the dimension of fault relationship is measured by the closeness of the association relationship L, and the lift is calculated. The lift refers to the ratio of the probability of the occurrence of the successor B under the condition of the predecessor A of the association rule in the database D to the overall probability of the occurrence of B:
[0083]
[0084] The fault correlation coefficient is normalized so that the value range of the fault correlation density is between 0 and 1. Therefore, the calculation formula of the fault correlation density L is as follows:
[0085]
[0086] The closeness of the correlation between faults, L, is used to measure the strength of the correlation between faults in the dimension of the fault itself. The closer the value of L is, the stronger the correlation is. Specific embodiment four:
[0088] The difference between the fourth embodiment of the present application and the third embodiment is that:
[0089] The step 4 is specifically as follows:
[0090] The fault feature set uses a set to represent the features of the fault. When A is the fault feature set corresponding to a certain fault, it is expressed as follows:
[0091] A={A1,A2,…,A i , …, A n}
[0092] Among them, Ai is the value of the i-th feature in the software fault feature model corresponding to the current fault;
[0093] Determine the similarity of fault feature dimensions When calculating the feature correlation coefficient of two faults, it is first necessary to calculate the similarity of each feature dimension of the two faults, that is, the fault feature dimension similarity;
[0094] Use the Levenshtein ratio as a measure of the similarity between two fault dimensions:
[0095]
[0096] Where a and b are strings representing the value of a feature in the fault feature information, len(a) represents the length of string a, and L(a, b) represents the Levenshtein distance between a and b.
[0097] Determine the fault feature correlation coefficient S: The fault feature correlation coefficient is the fault feature similarity, which is used to measure the similarity between two faults in the dimension of fault feature information. Specific embodiment five:
[0099] The difference between the fifth embodiment of the present invention and the fourth embodiment is that:
[0100] When A and B are the fault feature sets of two faults, that is, two d-dimensional vectors, each eigenvalue in the vector corresponds to a feature dimension in the software fault feature model, and Ai and Bi are the identifiers of any feature dimension, the calculation method of the fault feature correlation coefficient S is as follows:
[0101]
[0102] The fault feature correlation coefficient is calculated and used as a measure of the strength of the correlation relationship of software faults in the dimension of internal fault features. Specific embodiment six:
[0104] The difference between the sixth embodiment of the present invention and the fifth embodiment is that:
[0105] The step 5 is specifically as follows:
[0106] The strength of the correlation between faults is measured by the function dependency graph, and the propagation probability p between two adjacent function nodes is defined as follows:
[0107]
[0108] Among them, x and y are adjacent nodes in the functional dependency graph, next(y) represents the set of successor nodes of y, and out(y,x) represents the out-degree from y to x;
[0109] Calculate the propagation possibility of any two nodes in the function dependency graph, that is, the software fault structure correlation coefficient. The calculation formula of the software fault structure correlation coefficient M is as follows:
[0110]
[0111] Among them, t i is the i-th node on the shortest path from node A to node B in the functional dependency graph;
[0112] The final software fault structural correlation coefficient is calculated by cumulative multiplication. The higher the coefficient value, the stronger the structural correlation relationship. Specific embodiment seven:
[0114] The difference between the seventh embodiment of the present invention and the sixth embodiment is that:
[0115] The step 6 is specifically as follows:
[0116] The multi-dimensional correlation coefficient FCC of software failure is calculated by the following formula:
[0117] FCC(A, B)=α·L(A, B)+β·S(A, B)+γ·M(A, B), where α, β, and γ represent the weights of the closeness of the correlation between faults, the correlation coefficient of the characteristics within the faults, and the correlation coefficient of the software fault structure, respectively, where 0≤α≤1, 0≤β≤1, 0≤γ≤1, and α+β+γ=1. Specific embodiment eight:
[0119] The difference between the eighth embodiment of the present invention and the seventh embodiment is that:
[0120] The present invention provides a software fault multi-dimensional association relationship analysis system based on association rule mining, the system comprising:
[0121] A preprocessing module, which performs data preprocessing, preprocesses the test case data, extracts all fault data from the test case data based on a software fault feature model of orthogonal defect classification, and converts the test case data into a format most suitable for association rule mining;
[0122] An association mining module, after data preprocessing, uses the FP-Growth method to mine fault association rules to obtain frequent item sets;
[0123] A closeness calculation module, which performs closeness calculation of correlation between faults to measure the strength of correlation between faults in the dimension of the faults themselves;
[0124] A feature correlation coefficient calculation module, which calculates the fault feature correlation coefficient to measure the similarity between two faults in the dimension of fault feature information;
[0125] A structural correlation coefficient calculation module, which calculates the structural correlation coefficient of software faults and determines the structural correlation relationship;
[0126] A multi-dimensional correlation coefficient calculation module is used to calculate the multi-dimensional correlation coefficient of software faults to obtain accurate multi-dimensional correlation coefficients of software faults. Specific embodiment nine:
[0128] The difference between the ninth embodiment of the present invention and the eighth embodiment is that:
[0129] The present invention provides a computer-readable storage medium on which a computer program is stored. The program is executed by a processor to implement a software fault multi-dimensional association relationship analysis method based on association rule mining. Specific embodiment ten:
[0131] The difference between the tenth embodiment of the present invention and the ninth embodiment is that:
[0132] The present invention provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements a software fault multi-dimensional association relationship analysis method based on association rule mining when executing the computer program.
[0133] The specific steps are as follows:
[0134] The first step is data preprocessing.
[0135] The data preprocessing process is as follows Figure 2 As shown, the test case data is preprocessed. Then, all the fault data in the test case is extracted based on the software fault feature model of orthogonal defect classification, and the test case is converted into a format that is most suitable for association rule mining. After the data processing is completed, the software test case data is converted into D<d1, d n , …, d n > in the form of i is the fault number information of the i-th fault. The relevant model structure is shown in the figure Figure 3 and Figure 4 shown.
[0136] Step 2: Fault association rule mining.
[0137] After data preprocessing, the FP-Growth algorithm is used to mine fault association rules and obtain frequent item sets.
[0138] Step 3: Calculate the closeness of the relationship between faults
[0139] The closeness of the relationship between faults L is used to measure the degree of association between faults in the dimension of relationship between faults. First, the lift is calculated. The lift refers to the ratio of the probability of the occurrence of the successor B under the condition of the predecessor A of the association rule in the database D to the overall probability of the occurrence of B:
[0140]
[0141] The lift is used to evaluate the correlation between the predecessor and the successor, where a lift greater than 1 indicates a positive correlation between the two, and the higher the lift, the stronger the correlation. In order to unify the value range of the correlation coefficients of each dimension of the fault, the fault correlation coefficient should be normalized so that the value range of the tightness of the correlation between faults is between 0 and 1. Therefore, the calculation formula for the tightness of the correlation between faults L is as follows:
[0142]
[0143] The closeness L of the correlation between faults can be used to measure the strength of the correlation between faults in the dimension of the fault itself. The closer the value of L is, the stronger the correlation is.
[0144] Step 4: Calculate the fault feature correlation coefficient.
[0145] Fault feature set: The features of the fault are represented in the form of a set. If A is the fault feature set corresponding to a certain fault, its representation is as shown in the formula:
[0146] A={A1,A2,…,A i , …, A n}
[0147] Where Ai is the value of the i-th feature in the software fault feature model corresponding to the current fault.
[0148] Fault feature dimension similarity When calculating the feature correlation coefficient of two faults, we first need to calculate the similarity of each feature dimension of the two faults, which is the fault feature dimension similarity. The Levenshtein ratio is used as a method to measure the similarity of two fault dimensions:
[0149]
[0150] Wherein a and b are respectively a string, representing the value of a feature in the fault feature information in the present invention, len(a) represents the length of the string a, and L(a, b) represents the Levenshtein distance between a and b.
[0151] Fault feature correlation coefficient S: The fault feature correlation coefficient is the fault feature similarity, which is used to measure the similarity between two faults in the dimension of fault feature information.
[0152] Assume A and B are the fault feature sets of two faults, that is, two d-dimensional vectors. Each eigenvalue in the vector corresponds to a feature dimension in the software fault feature model. Assume Ai and Bi are the identifiers of any feature dimension. The calculation method of the fault feature correlation coefficient S is as follows:
[0153]
[0154] The fault feature correlation coefficient can be calculated by the above method, which is used as a method to measure the strength of the correlation relationship of software faults in the dimension of internal fault features.
[0155] Step 5: Calculate the software fault structure correlation coefficient.
[0156] Based on the function call graph, the inheritance, polymorphism and other relationships in the class diagram are used to expand it, and finally a function dependency graph that can be used for fault structure correlation analysis is obtained. In the function dependency graph, by analyzing the shortest path between two function nodes and the weight information on the shortest path, the correlation between the two function nodes can be discovered. The description of software faults in the software fault feature model includes the characteristic dimension of fault location, which can locate the location of the fault to the function level. Therefore, it is feasible to use the function dependency graph to measure the strength of the correlation between faults. The calculation method of defining the propagation possibility p between two adjacent function nodes is as follows:
[0157]
[0158] Where x and y are adjacent nodes in the function dependency graph, next(y) represents the set of successor nodes of y, and out(y,x) represents the out-degree of y to x. Based on the propagation possibility between two adjacent function nodes, the propagation possibility of any two nodes in the function dependency graph can be calculated, that is, the software fault structure correlation coefficient. The calculation formula of the software fault structure correlation coefficient M is as follows:
[0159]
[0160] where t i It is the i-th node on the shortest path from node A to node B in the function dependency graph. The final software fault structural correlation coefficient is calculated by cumulative multiplication. The higher the coefficient value, the stronger the structural correlation relationship.
[0161] Step 6: Calculate the multi-dimensional correlation coefficient of software failures.
[0162] In the above invention, three factors measuring software fault correlation are obtained from the three dimensions of software fault correlation analysis, namely, the closeness of correlation between faults L, the correlation coefficient of fault characteristics S, and the correlation coefficient of software fault structure M. In actual situations, these three factors cannot play a role completely independently, but interact with each other to produce an overall impact. Therefore, when calculating the software fault correlation coefficient, the present invention should combine these three factors and perform a weighted sum to obtain a more accurate multi-dimensional correlation coefficient of software faults. The calculation formula of the multi-dimensional correlation coefficient FCC of software faults is shown as follows:
[0163] FCC(A,B)=α·L(A,B)+β·S(A,B)+γ·M(A,B)
[0164] Where α, β, and γ represent the weights of the closeness of the correlation between faults, the correlation coefficient of the characteristics within the fault, and the correlation coefficient of the software fault structure, respectively, where 0≤α≤1, 0≤β≤1, 0≤γ≤1, and α+β+γ=1. In a practical environment, the weight coefficient of the present invention needs to be adjusted according to different software development backgrounds to obtain better results. Specific embodiment eleven:
[0166] The difference between the eleventh embodiment of the present invention and the tenth embodiment is that:
[0167] The specific process of implementing the multi-dimensional correlation analysis method of software faults based on association rule mining is as follows.
[0168] The first step is data preprocessing.
[0169] The data preprocessing process is as follows Figure 2 As shown in Figure 1, the test case data is preprocessed. Then, all the fault data in the test case is extracted based on the software fault feature model of orthogonal defect classification, and the test case is converted into a format that is most suitable for association rule mining. After the data processing is completed, the software test case data is converted into D <d1,d n ,…,d n > in the form of i is the fault number information of the i-th fault. The relevant model structure is shown in the figure Figure 3 and Figure 4 shown.
[0170] Step 2: Fault association rule mining.
[0171] After data preprocessing, the FP-Growth algorithm is used to mine fault association rules and obtain frequent item sets.
[0172] Step 3: Calculate the closeness of the relationship between faults
[0173] The closeness of the relationship between faults L is used to measure the degree of association between faults in the dimension of relationship between faults. First, the lift is calculated. The lift refers to the ratio of the probability of the occurrence of the successor B under the condition of the predecessor A of the association rule in the database D to the overall probability of the occurrence of B:
[0174]
[0175] The lift is used to evaluate the correlation between the predecessor and the successor, where a lift greater than 1 indicates a positive correlation between the two, and the higher the lift, the stronger the correlation. In order to unify the value range of the correlation coefficients of each dimension of the fault, the fault correlation coefficient should be normalized so that the value range of the tightness of the correlation between faults is between 0 and 1. Therefore, the calculation formula for the tightness of the correlation between faults L is as follows:
[0176]
[0177] The closeness L of the correlation between faults can be used to measure the strength of the correlation between faults in the dimension of the fault itself. The closer the value of L is, the stronger the correlation is.
[0178] Step 4: Calculate the fault feature correlation coefficient.
[0179] Fault feature set: The features of the fault are represented in the form of a set. If A is the fault feature set corresponding to a certain fault, its representation is as shown in the formula:
[0180] A={A1,A2…,A i ,…,A n}
[0181] Where Ai is the value of the i-th feature in the software fault feature model corresponding to the current fault.
[0182] Fault feature dimension similarity When calculating the feature correlation coefficient of two faults, we first need to calculate the similarity of each feature dimension of the two faults, which is the fault feature dimension similarity. The Levenshtein ratio is used as a method to measure the similarity of two fault dimensions:
[0183]
[0184] Wherein, a and b are respectively a string, representing the value of a feature in the fault feature information in the present invention, len(a) represents the length of the string a, and L(a,b) represents the Levenshtein distance between a and b.
[0185] Fault feature correlation coefficient S: The fault feature correlation coefficient is the fault feature similarity, which is used to measure the similarity between two faults in the dimension of fault feature information.
[0186] Assume A and B are the fault feature sets of two faults, that is, two d-dimensional vectors. Each eigenvalue in the vector corresponds to a feature dimension in the software fault feature model. Assume Ai and Bi are the identifiers of any feature dimension. The calculation method of the fault feature correlation coefficient S is as follows:
[0187]
[0188] The fault feature correlation coefficient can be calculated by the above method, which is used as a method to measure the strength of the correlation relationship of software faults in the dimension of internal fault features.
[0189] Step 5: Calculate the software fault structure correlation coefficient.
[0190] Based on the function call graph, the inheritance, polymorphism and other relationships in the class diagram are used to expand it, and finally a function dependency graph that can be used for fault structure correlation analysis is obtained. In the function dependency graph, by analyzing the shortest path between two function nodes and the weight information on the shortest path, the correlation between the two function nodes can be discovered. The description of software faults in the software fault feature model includes the characteristic dimension of fault location, which can locate the location of the fault to the function level. Therefore, it is feasible to use the function dependency graph to measure the strength of the correlation between faults. The calculation method of defining the propagation possibility p between two adjacent function nodes is as follows:
[0191]
[0192] Where x and y are adjacent nodes in the function dependency graph, next(y) represents the set of successor nodes of y, and out(y,x) represents the out-degree of y to x. Based on the propagation possibility between two adjacent function nodes, the propagation possibility of any two nodes in the function dependency graph can be calculated, that is, the software fault structure correlation coefficient. The calculation formula of the software fault structure correlation coefficient M is as follows:
[0193]
[0194] where t i It is the i-th node on the shortest path from node A to node B in the function dependency graph. The final software fault structural correlation coefficient is calculated by cumulative multiplication. The higher the coefficient value, the stronger the structural correlation relationship.
[0195] Step 6: Calculate the multi-dimensional correlation coefficient of software failures.
[0196] The existing software fault correlation analysis methods either fail to consider the relationship between fault information, or ignore the structural relationship of faults in the overall software architecture, or have the problem of low efficiency in the context of large-scale data. Compared with the traditional fault correlation analysis method based on test cases and software metrics, the present invention has the advantages of comprehensively considering multiple different dimensions in the scenario where software faults occur and making the analysis more comprehensive; compared with the Apriori association rule mining algorithm, it has the advantage of higher efficiency when facing large-scale data.
[0197] In the above invention, three factors measuring software fault correlation are obtained from the three dimensions of software fault correlation analysis, namely, the closeness of correlation between faults L, the correlation coefficient of fault characteristics S, and the correlation coefficient of software fault structure M. In actual situations, these three factors cannot play a role completely independently, but interact with each other to produce an overall impact. Therefore, when calculating the software fault correlation coefficient, the present invention should combine these three factors and perform a weighted sum to obtain a more accurate multi-dimensional correlation coefficient of software faults. The calculation formula of the multi-dimensional correlation coefficient FCC of software faults is shown as follows:
[0198] FCC(A,B)=α·L(A,B)+β·S(A,B)+γ·M(A,B)
[0199] Wherein α, β, γ represent the weights of the closeness of the correlation between faults, the correlation coefficient of the characteristics within the faults, and the correlation coefficient of the software fault structure, respectively, where 0≤α≤1, 0≤β≤1, 0≤γ≤1, α+β+γ=1. In the actual environment, the weight coefficient of the present invention needs to be adjusted according to different software development backgrounds to obtain better results.
[0200] The above is only a preferred implementation of a method for analyzing multi-dimensional association relationships of software faults based on association rule mining. The protection scope of a method for analyzing multi-dimensional association relationships of software faults based on association rule mining is not limited to the above embodiments. All technical solutions under this idea belong to the protection scope of the present invention. It should be pointed out that for those skilled in the art, several improvements and changes without departing from the principle of the present invention should also be regarded as the protection scope of the present invention.
Claims
1. A method for analyzing multi-dimensional correlation relationships of software faults based on association rule mining, characterized by: The method comprises the following steps: Step 1: Perform data preprocessing, preprocess the test case data, and convert the test case data into a format that is most suitable for association rule mining; Step 2: After data preprocessing, use the FP-Growth method to mine fault association rules and obtain frequent item sets; Step 3: Calculate the closeness of the correlation between faults to measure the strength of the correlation between faults in the dimension of the fault itself; Step 4: Calculate the fault feature correlation coefficient to measure the similarity between the two faults in the dimension of fault feature information; Step 5: Calculate the software fault structure correlation coefficient and determine the structural correlation relationship; Step 6: Calculate the multi-dimensional correlation coefficient of software failures to obtain accurate multi-dimensional correlation coefficients of software failures.
2. The method according to claim 1, characterized in that: After data processing, the software test case data is converted into D <d1,d n , …, d n > in the form of i is the fault number information of the i-th fault.
3. The method according to claim 2, characterized in that: The step 3 is specifically as follows: The degree of association between faults is measured by the closeness of the association relationship L between faults, and the lift is calculated. The lift refers to the ratio of the probability of the occurrence of the successor B under the condition of the predecessor A of the association rule in the database D to the overall probability of the occurrence of B: The fault correlation coefficient is normalized so that the value range of the fault correlation density is between 0 and 1. Therefore, the calculation formula of the fault correlation density L is as follows: The closeness of the correlation between faults, L, is used to measure the strength of the correlation between faults in the dimension of the fault itself. The closer the value of L is, the stronger the correlation is.
4. The method according to claim 1, characterized in that: The step 4 is specifically as follows: The fault feature set uses a set to represent the features of the fault. When A is the fault feature set corresponding to a certain fault, it is expressed as follows: A={A1,A2,…,A i …,A n } Among them, Ai is the value of the i-th feature in the software fault feature model corresponding to the current fault; Determine the similarity of fault feature dimensions When calculating the feature correlation coefficient of two faults, it is first necessary to calculate the similarity of each feature dimension of the two faults, that is, the fault feature dimension similarity; Use the Levenshtein ratio as a measure of the similarity between two fault dimensions: Where a and b are strings representing the value of a feature in the fault feature information, len(a) represents the length of string a, and L(a, b) represents the Levenshtein distance between a and b. Determine the fault feature correlation coefficient S: The fault feature correlation coefficient is the fault feature similarity, which is used to measure the similarity between two faults in the dimension of fault feature information.
5. The method according to claim 4, characterized in that: When A and B are the fault feature sets of two faults, that is, two d-dimensional vectors, each eigenvalue in the vector corresponds to a feature dimension in the software fault feature model, and Ai and Bi are the identifiers of any feature dimension, the calculation method of the fault feature correlation coefficient S is as follows: The fault feature correlation coefficient is calculated and used as a measure of the strength of the correlation relationship of software faults in the dimension of internal fault features.
6. The method according to claim 1, characterized in that: The step 5 is specifically as follows: The strength of the correlation between faults is measured by the function dependency graph, and the propagation probability p between two adjacent function nodes is defined as follows: Among them, x and y are adjacent nodes in the functional dependency graph, next(y) represents the set of successor nodes of y, and out(y,x) represents the out-degree from y to x; Calculate the propagation possibility of any two nodes in the function dependency graph, that is, the software fault structure correlation coefficient. The calculation formula of the software fault structure correlation coefficient M is as follows: Among them, t i is the i-th node on the shortest path from node A to node B in the functional dependency graph; The final software fault structural correlation coefficient is calculated by cumulative multiplication. The higher the coefficient value, the stronger the structural correlation relationship.
7. The method according to claim 5, characterized in that: The step 6 is specifically as follows: The multi-dimensional correlation coefficient FCC of software failure is calculated by the following formula: FCC(A,B)=α·L(A,B)+β·S(A,B)+γ·M(A,B) Among them, α, β, and γ represent the weights of the closeness of the correlation between faults, the correlation coefficient of the characteristics within the fault, and the correlation coefficient of the software fault structure, respectively, where 0≤α≤1, 0≤β≤1, 0≤γ≤1, and α+β+γ=1.
8. A software fault multi-dimensional correlation analysis system based on association rule mining, characterized by: The system comprises: A preprocessing module, which performs data preprocessing, preprocesses the test case data, extracts all fault data from the test case data based on a software fault feature model of orthogonal defect classification, and converts the test case data into a format most suitable for association rule mining; An association mining module, after data preprocessing, uses the FP-Growth method to mine fault association rules to obtain frequent item sets; A closeness calculation module, which performs closeness calculation of correlation between faults to measure the strength of correlation between faults in the dimension of the faults themselves; A feature correlation coefficient calculation module, which calculates the fault feature correlation coefficient to measure the similarity between two faults in the dimension of fault feature information; A structural correlation coefficient calculation module, which calculates the structural correlation coefficient of software faults and determines the structural correlation relationship; A multi-dimensional correlation coefficient calculation module is used to calculate the multi-dimensional correlation coefficient of software faults to obtain accurate multi-dimensional correlation coefficients of software faults.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the method according to claims 1-7.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the method of claims 1-7 is implemented.
Citation Information
Patent Citations
Software FMEA (failure mode and effects analysis) method based on level dependency modeling
CN103473400A
Software key function identification method based on complex network fault propagation
CN105045574A
Tunnel traffic accident association rule algorithm based on FP-Growth algorithm
CN107145609A
Software structure risk assessment method based on class diagrams
CN110322122A
Software system key entity mining method based on software fault propagation
CN110851177A
Cited By
Intelligent detection method and system for variable frequency controller for air conditioner
CN120595779A