A software fault multi-dimensional association relationship analysis method based on association rule mining
By using a method based on association rule mining, combined with the FP-Growth algorithm and multi-dimensional association coefficient calculation, the problem of incomplete software fault association analysis in existing technologies is solved, achieving more efficient and accurate software fault location and prediction.
Patent Information
- Application Number
- CN202411857862.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-12-26
- Estimated Expiration
- 2044-12-17
AI Technical Summary
Existing software fault correlation analysis methods fail to fully reflect the multi-dimensional correlation between software faults, resulting in low accuracy in localization and prediction, and low efficiency in the context of large-scale data.
A method based on association rule mining is adopted. Data preprocessing is performed using the FP-Growth algorithm to calculate the density of association between faults, the correlation coefficient of features within faults, and the correlation coefficient of software fault structure. Multi-dimensional association coefficients are generated by combining weight coefficients to realize multi-dimensional association analysis of software faults.
It improves the accuracy of software fault location and prediction, enhances the efficiency of analysis on large-scale data, and provides more comprehensive correlation analysis capabilities.
Smart Images

Figure CN119718942B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of software service fault detection, and is a software fault multi-dimensional association relationship analysis method based on association rule mining. BACKGROUND
[0002] With the development of computer technology and the increasing demand of users, computer technology taking software as the core has gradually penetrated into various industries, and with its high efficiency and low error rate, it occupies an increasingly important position in various industries and people's daily life. However, due to the increasing demand, the scale of software system is getting larger and larger, and the complexity of software is also multiplied, and the software quality problem that follows gradually becomes the bottleneck restricting the development of computer industry. Software fault is the loss of the ability of software to perform tasks under certain environmental conditions, and its cause is software defect, and it is the precondition of software failure. Software faults are generally found in large quantities in the software testing stage, and software faults often cause many problems. How to properly handle software faults is the key in the complete life cycle of software products, and is the fundamental guarantee for software product development, quality improvement and maintenance.
[0003] Finding and repairing software faults is an important task of software testing, maintenance and management, and fault positioning is one of the most time-consuming activities. It extracts software source program architecture information, analyzes the characteristics of the program, predicts the location and cause of software faults, and provides a reference for the fault repair operation of the developer. Existing research shows that there is an association relationship between software faults, and analyzing the historical fault information of the software can help testers find common faults and improve the positioning and prediction accuracy of 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 library to measure the degree of association between software faults, and according to the degree of fault association to locate and predict related faults, so as to improve the repair efficiency of software faults by testers, 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, software fault-related features can be quickly extracted, the root cause of the problem can be determined, and relevant repair experience for the corresponding type of problem can be accumulated. When encountering similar problems, repair reference opinions can be quickly given. Software fault classification technology can quickly find and repair software faults, improve software development efficiency, and is also conducive to analyzing the causes of software faults, facilitating managers to develop quality improvement measures for the corresponding software and improving software stability. There are a large number of software fault classification standards at home and abroad, including national military standard classification methods, Thayer software error classification methods, Institute of Electrical and Electronics Engineers software anomaly classification standards, and orthogonal defect classification methods. Different classification methods have different classification objectives and observation angles, and users need to select according to different development environments.
[0005] Association rule mining technology is an important data mining research method. There are a large number of studies on software fault association relationship analysis, but in most of these existing studies, the calculation of fault association coefficients is only analyzed from one dimension, and the value range of the calculated fault association coefficients is not perfect. This method of calculating fault association coefficients is difficult to fully reflect the degree of association between software faults in actual situations, so it affects the accuracy of software fault positioning and prediction. In this context, multi-dimensional analysis and calculation of software fault association relationships have become an important direction of current research. SUMMARY
[0006] In view of the deficiencies of the prior art, the present application provides a software fault multi-dimensional association relationship analysis method based on association rule mining. The present application proposes a software fault multi-dimensional association relationship analysis method based on association rule mining in the field of software fault positioning, which realizes association relationship analysis of software faults from three dimensions of fault association, fault feature association and software fault structure association, and calculates fault multi-dimensional association coefficients based on the analysis results of different dimensions to generate the final association relationship analysis results. The present application provides the following technical solutions:
[0007] A software fault multi-dimensional association relationship analysis method based on association rule mining, the method comprising the following steps:
[0008] Step 1: data preprocessing, preprocessing the test case data, extracting all fault data in the test case data based on the software fault feature model of orthogonal defect classification, and converting the test case data into a format most suitable for association rule mining;
[0009] Step 2: After the data pre-processing, the FP-Growth method is used to perform the fault association rule mining to obtain the frequent item set;
[0010] Step 3: The inter-fault association relationship tightness is calculated to measure the association relationship strength of the faults in the dimension of the faults themselves;
[0011] Step 4: The fault feature association coefficient is calculated to measure the similarity of two faults in the dimension of the fault feature information;
[0012] Step 5: The software fault structure association coefficient is calculated to judge the structure association relationship;
[0013] Step 6: The software fault multi-dimensional association coefficient is calculated to obtain the accurate software fault multi-dimensional association coefficient.
[0014] Preferably, after the data processing, the software test case data is converted into the form of D < d1, d n , …, d n >, wherein d i is the fault number information of the i-th fault.
[0015] Preferably, the step 3 is specifically:
[0016] The inter-fault association relationship tightness L is used to measure the association degree of the faults in the dimension of the inter-fault relationship, and the lift is calculated. The lift refers to the ratio of the probability of the occurrence of the successor B to the probability of the occurrence of the total B under the condition that the database D contains the association rule and the predecessor A:
[0017]
[0018] The fault association coefficient is normalized to make the value range of the inter-fault association relationship tightness between 0 and 1, and thus the calculation formula of the inter-fault association relationship tightness L is as follows:
[0019]
[0020] The inter-fault association relationship tightness L is used to measure the association relationship strength of the faults in the dimension of the faults themselves, and the value of L is closer to the association relationship.
[0021] Preferably, the step 4 is specifically:
[0022] The fault feature set uses the form of a set to represent the features of the faults. When A is the fault feature set corresponding to a certain fault, it is represented by the following formula:
[0023] A = {A1, A2, …, A i , …, A n}
[0024] wherein, Ai is the value of the software fault feature model corresponding to the current fault on the ith feature;
[0025] determining the fault feature dimension similarity In the calculation of the feature correlation coefficient of two faults, the similarity of each feature dimension of the two faults is first calculated, i.e., the fault feature dimension similarity;
[0026] The Levenshtein ratio is used as a method for measuring the similarity of two fault dimensions:
[0027]
[0028] wherein, a and b are a string, representing the value of a feature in the fault feature information, len(a) represents the length of the string a, and L(a, b) represents the Levenshtein distance between a and b;
[0029] determining the fault feature correlation coefficient S: the fault feature correlation coefficient is the fault feature similarity, which is used to measure the similarity of two faults in the fault feature information dimension.
[0030] Preferably, when A and B are the fault feature sets of two faults, i.e., two d-dimensional vectors, each feature value 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, then 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 correlation strength of the software fault in the fault internal feature dimension.
[0033] Preferably, the step 5 is specifically:
[0034] The correlation strength between faults is measured by the function dependency graph, and the calculation method of the propagation possibility p between two adjacent function nodes is as follows:
[0035]
[0036] wherein, x and y are adjacent nodes in the function dependency graph, next(y) represents the successor node set of y, and out(y, x) represents the out-degree of y to x;
[0037] The propagation possibility of any two nodes in the function dependency graph is calculated, i.e., the software fault structure correlation coefficient, and the calculation formula of the software fault structure correlation coefficient M is as follows:
[0038]
[0039] wherein t i is the i-th node on the shortest path from node A to node B in the function dependency graph;
[0040] The final software fault structure correlation coefficient is calculated by multiplication, and the higher the coefficient value is, the stronger the structural correlation is.
[0041] Preferably, the step 6 is specifically:
[0042] The software fault multi-dimensional correlation coefficient FCC is calculated by the following formula:
[0043] FCC(A, B) = a·L(A, B) + β·S(A, B) + γ·M(A, B)
[0044] Wherein, a, β, γ respectively represent the weight of the fault correlation closeness, the fault feature correlation coefficient and the software fault structure correlation coefficient, wherein 0≤a≤1, 0≤β≤1, 0≤γ≤1, a+β+γ=1.
[0045] A software fault multi-dimensional correlation analysis system based on association rule mining, the system comprises:
[0046] A preprocessing module, the preprocessing module performs data preprocessing, pre-processes the test case data, extracts all fault data in the test case data based on the orthogonal defect classification software fault feature model, and converts the test case data into a format most suitable for association rule mining;
[0047] An association mining module, the association mining module uses the FP-Growth method to mine fault association rules after data preprocessing is completed, and obtains a frequent item set;
[0048] A closeness calculation module, the closeness calculation module calculates the fault correlation closeness, and measures the correlation strength of the fault in the fault itself dimension;
[0049] A feature correlation coefficient calculation module, the feature correlation coefficient calculation module calculates the fault feature correlation coefficient, and measures the similarity of two faults in the fault feature information dimension;
[0050] A structure correlation coefficient calculation module, the structure correlation coefficient calculation module calculates the software fault structure correlation coefficient, and judges the structural correlation;
[0051] A multi-dimensional correlation coefficient calculation module, the multi-dimensional correlation coefficient calculation module calculates the software fault multi-dimensional correlation coefficient, and obtains an accurate software fault multi-dimensional correlation coefficient.
[0052] A computer readable storage medium, having stored thereon a computer program, the program being executed by a processor to implement a software fault multi-dimensional association relationship analysis method based on association rule mining.
[0053] A computer device, comprising a memory and a processor, the memory storing a computer program, and the processor implementing a software fault multi-dimensional association relationship analysis method based on association rule mining when executing the computer program.
[0054] The present application has the following advantages:
[0055] Compared with the prior art, the present application has the following advantages:
[0056] The current existing software fault association relationship analysis method does not consider the relationship between fault information, ignores the structural relationship of faults under the overall architecture of software, or has the problem of low efficiency in the large-scale data background. Compared with the traditional fault association relationship analysis method based on test cases and software metrics, the present application has the advantage of comprehensively considering multiple different dimensions under the software fault occurrence scenario, and the analysis is more comprehensive. Compared with the Apriori association rule mining algorithm, the present application has the advantage of higher efficiency when facing large-scale data. BRIEF DESCRIPTION OF DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the specific embodiments or the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0058] Figure 1 The software fault multi-dimensional association relationship analysis method of the present application is shown as a flow chart;
[0059] Figure 2 The data preprocessing flow chart of the present application is shown as a flow chart;
[0060] Figure 3 The software fault feature model six-dimensional graph based on orthogonal defect classification of the present application is shown as a graph;
[0061] Figure 4 The software system fault feature information graph of the present application is shown as a graph. DETAILED DESCRIPTION
[0062] The present application is described in detail below in combination with specific embodiments. Embodiment one:
[0064] In view of the problems existing in the prior art, the application provides a software fault multi-dimensional association relationship analysis method based on association rule mining.
[0065] According to Figures 1 to 4 The application provides a software fault multi-dimensional association relationship analysis method based on association rule mining.
[0066] The software fault multi-dimensional association relationship analysis method based on association rule mining comprises the following steps:
[0067] Step 1: data preprocessing is performed, test case data is preprocessed, all fault data in the test case data is extracted based on a software fault feature model of orthogonal defect classification, and the test case data is converted into a format most suitable for association rule mining;
[0068] Step 2: after the data preprocessing is completed, a FP-Growth method is used to perform fault association rule mining, and a frequent item set is obtained;
[0069] Step 3: fault inter-association relationship tightness is calculated to measure the association relationship strength of faults in the dimension of faults themselves;
[0070] Step 4: fault feature association coefficient calculation is performed to measure the similarity of two faults in the dimension of fault internal feature information;
[0071] Step 5: software fault structure association coefficient calculation is performed to judge the structure association relationship;
[0072] Step 6: software fault multi-dimensional association coefficient calculation is performed to obtain accurate software fault multi-dimensional association coefficients.
[0073] The application provides a software fault multi-dimensional association relationship analysis method based on association rule mining, which realizes association relationship analysis of software faults from three dimensions of fault inter-association, fault internal feature association and software fault structure association, and performs fault multi-dimensional association coefficient calculation on analysis results of different dimensions to generate final association relationship analysis results. Figure 1
[0074] The software fault multi-dimensional association relationship analysis method based on association rule mining first needs orthogonal defect classification fault information library and test case information as research basis, after obtaining the basic information, needs to pre-process the test case data, extracts all fault data in the test case, and converts the test case into a format most suitable for association rule mining, then uses the FP-Growth algorithm to mine fault association rules, and obtains the frequent item set. In the dimension of the relationship between faults, the closeness L of the association relationship between faults is constructed based on the lift to measure the association degree between faults; in the dimension of the fault, the Levenshtein distance is used to calculate the fault feature dimension similarity and the fault feature association coefficient S, which is used as the association relationship strength measurement parameter of the software fault in the fault internal feature dimension; in the dimension of the software system architecture, the function call graph is used as the basis, and the inheritance, polymorphism and other relationships in the class diagram are used to expand it to obtain the function dependency graph that can be used for fault structure association relationship analysis. The shortest path between two function nodes and the weight information on the shortest path are calculated to obtain the software fault structure association coefficient M. In actual situation, the fault association relationship closeness L, the fault feature association coefficient S and the software fault structure association coefficient M cannot completely independent function, but interact with each other to produce overall effect, therefore, the three are combined and weighted summed to obtain a more accurate software fault multi-dimensional association coefficient.
[0075] The existing software fault association relationship analysis method does not consider the relationship between fault information, ignores the structural relationship of faults under the overall architecture of software, or has the problem of low efficiency in the large-scale data background. Compared with the traditional fault association relationship analysis method based on test cases and software metrics, the application has the advantages of comprehensively considering multiple different dimensions under the software fault occurrence scene and analyzing more comprehensively. Compared with the Apriori association rule mining algorithm, the application has the advantage of higher efficiency in the face of large-scale data. Specific embodiment two:
[0077] The difference between the embodiment two and the embodiment one of the application is only that:
[0078] After the data processing is completed, the software test case data is converted into the form of D n , …, d n >, wherein d i is fault number information of the i th fault. Specific embodiment three:
[0080] The difference between the embodiment three and the embodiment two of the application is only that:
[0081] The step 3 is specifically:
[0082] The degree of association of the faults in the inter-fault relationship dimension is measured by the inter-fault relationship closeness L, and the promotion degree is calculated, which refers to the ratio of the probability of the occurrence of the successor B under the condition of the predecessor A in the database D to the probability of the overall occurrence of B:
[0083]
[0084] The fault association coefficient is normalized to make the value range of the inter-fault relationship closeness L between 0 and 1, and the calculation formula of the inter-fault relationship closeness L is as follows:
[0085]
[0086] The inter-fault relationship closeness L measures the strength of the association of the faults in the fault itself dimension, and the closer the value of L is to the association, the stronger the association is. Specific embodiment four:
[0088] The difference between the fourth embodiment of the application and the third embodiment is only that:
[0089] The step 4 is specifically:
[0090] The fault feature set uses a set form to represent the features of the fault, and when A is the fault feature set corresponding to a certain fault, it is represented by the following formula:
[0091] A = {A1, A2, …, A i , …, A n}
[0092] Wherein, Ai is the value of the current fault on the ith feature in the software fault feature model;
[0093] Determine the fault feature dimension similarity When calculating the feature association coefficient of two faults, the similarity of each feature dimension of the two faults needs to be calculated first, that is, the fault feature dimension similarity;
[0094] The Levenshtein ratio is used as a method for measuring the similarity of two fault dimensions:
[0095]
[0096] Wherein, a and b are respectively a string representing the value of a certain feature in the fault feature information, len(a) represents the length of the 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 of two faults in the fault internal feature information dimension. Specific embodiment five:
[0099] The difference between the embodiment five and the embodiment four is only that:
[0100] When A and B are the fault feature sets of two faults, that is, two d-dimensional vectors, each feature value in the vector corresponds to a feature dimension in the software fault feature model, and let Ai and Bi be the identifiers of any feature dimension, then 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 the correlation relationship strength measurement of the software fault in the fault internal feature dimension. Specific embodiment six:
[0104] The difference between the embodiment six and the embodiment five is only that:
[0105] The step 5 is specifically:
[0106] The correlation relationship strength between the faults is measured by the function dependency graph, and the calculation method of the propagation possibility p between two adjacent function nodes is as follows:
[0107]
[0108] Wherein, x and y are adjacent nodes in the function dependency graph, next (y) represents the successor node set of y, and out (y, x) represents the out-degree of y to x.
[0109] The propagation possibility of any two nodes in the function dependency graph, that is, the software fault structure correlation coefficient, is calculated, and the calculation formula of the software fault structure correlation coefficient M is as follows:
[0110]
[0111] Wherein, t i is the i-th node on the shortest path from the node A to the node B in the function dependency graph;
[0112] The final software fault structure correlation coefficient is calculated by multiplication, and the higher the coefficient value is, the stronger the structure correlation is. Specific embodiment seven:
[0114] The difference between the embodiment seven and the embodiment six is only that:
[0115] The step 6 is specifically:
[0116] The software fault multidimensional correlation coefficient FCC is calculated by the following formula:
[0117] FCC(A, B) = a·L(A, B) + β·S(A, B) + γ·M(A, B) Wherein, a, β, γ respectively represent the weight of fault correlation relationship closeness, fault feature correlation coefficient, and software fault structure correlation coefficient, wherein 0 ≤ a ≤ 1, 0 ≤ β ≤ 1, 0 ≤ γ ≤ 1, a + β + γ = 1. Specific embodiment eight:
[0119] The difference between the embodiment eight and the embodiment seven is only that:
[0120] The application provides a software fault multidimensional correlation analysis system based on association rule mining, which comprises:
[0121] A preprocessing module, which performs data preprocessing, pre-processes test case data, extracts all fault data in 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, which performs fault association rule mining using an FP-Growth method after data preprocessing is completed, and obtains a frequent item set;
[0123] A closeness calculation module, which performs fault inter-correlation relationship closeness calculation and measures the correlation relationship strength of a fault in the fault itself dimension;
[0124] A feature correlation coefficient calculation module, which performs fault feature correlation coefficient calculation and measures the similarity degree of two faults in the fault feature information dimension;
[0125] A structure correlation coefficient calculation module, which performs software fault structure correlation coefficient calculation and judges the structure correlation relationship;
[0126] A multidimensional correlation coefficient calculation module, which performs software fault multidimensional correlation coefficient calculation and obtains accurate software fault multidimensional correlation coefficients. Specific embodiment nine:
[0128] The difference between the embodiment nine and the embodiment eight is only that:
[0129] The application provides a computer readable storage medium, which stores a computer program, and the program is executed by a processor to implement a software fault multidimensional correlation analysis method based on association rule mining. Embodiment ten:
[0131] The difference between the embodiment ten and the embodiment nine is only that:
[0132] The application provides a computer device, comprising a memory and a processor, the memory stores a computer program, and the processor realizes a multi-dimensional association relationship analysis method for software faults based on association rule mining when executing the computer program.
[0133] The specific method steps are as follows:
[0134] The first step is data preprocessing.
[0135] The data preprocessing process is shown in the figure Figure 2 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 most suitable for association rule mining. After data processing, the software test case data is converted into the form of D < d1, d n , …, d n >, wherein d i is the fault number information of the i-th fault. The relevant model structure is shown in the figures Figure 3 and Figure 4 .
[0136] The second step is fault association rule mining.
[0137] After data preprocessing, the FP-Growth algorithm is used for fault association rule mining to obtain the frequent item set.
[0138] The third step is the calculation of the association relationship tightness between faults
[0139] The association relationship tightness L between faults is used to measure the association degree of faults in the dimension of the relationship between faults. First, the lift is calculated. The lift is the ratio of the probability of the occurrence of the successor B under the condition of containing the precursor A in the database D and the total probability of the occurrence of B:
[0140]
[0141] The lift is used to evaluate the correlation between the precursor and the successor. When the lift is greater than 1, it represents that there is a positive correlation between the two, and the higher the lift, the stronger the association relationship. In order to unify the value range of the fault association coefficient of each dimension, the fault association coefficient should be normalized to make the value range of the association relationship tightness between faults between 0 and 1, so the calculation formula of the association relationship tightness L between faults is as follows:
[0142]
[0143] The fault inter-correlation closeness L can be used as a measure of the correlation strength of the fault in the dimension of the fault itself, and the closer the value of L is, the stronger the correlation is.
[0144] The fourth step is to calculate the fault feature correlation coefficient.
[0145] Fault feature set: the features of the fault are represented in the form of a set, and if A is a 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] Wherein Ai is the value of the current fault corresponding to the software fault feature model in the ith feature.
[0148] Fault feature dimension similarity When calculating the feature correlation coefficient of two faults, the similarity of each feature dimension of the two faults needs to be calculated first, that is, the fault feature dimension similarity. The Levenshtein ratio is used as a method to measure the similarity of two fault dimensions:
[0149]
[0150] Where a and b are a string, representing the value of a certain 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 of two faults in the dimension of the fault feature information.
[0152] Let A and B be the fault feature sets of two faults, that is, two d-dimensional vectors, and each feature value in the vector corresponds to a feature dimension in the software fault feature model. Let Ai and Bi be the identifier of any feature dimension, and 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 measure of the correlation strength of the software fault in the dimension of the fault feature.
[0155] The fifth step is to 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 the function dependency graph which can be used for the analysis of the correlation of software fault structure is obtained. In the function dependency graph, the correlation between two function nodes can be explored by analyzing the shortest path between the two function nodes and the weight information on the shortest path. The description of software faults in the software fault feature model includes the feature dimension of fault location, which can locate the fault location to the function level. Therefore, it is feasible to use the function dependency graph to measure the correlation strength between faults. The calculation method of the propagation possibility p between two adjacent function nodes is defined as follows:
[0157]
[0158] Where x and y are adjacent nodes in the function dependency graph, next(y) represents the successor node set 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, i.e. the software fault structure correlation coefficient, can be calculated. The calculation formula of the software fault structure correlation coefficient M is as follows:
[0159]
[0160] Where t i is the i-th node on the shortest path from node A to node B in the function dependency graph. The final software fault structure correlation coefficient is calculated by multiplication, and the higher the coefficient value represents the stronger the structural correlation.
[0161] Step 6, calculation of the multi-dimensional correlation coefficient of software faults.
[0162] The above three factors for measuring the correlation of software faults, i.e. the correlation tightness L between faults, the feature correlation coefficient S within faults and the software fault structure correlation coefficient M, are obtained from the three dimensions of software fault correlation analysis in the present application. In actual situations, these three factors cannot completely function independently, but interact with each other to produce overall effects. Therefore, when calculating the software fault correlation coefficient, the three factors should be combined and weighted to obtain a more accurate multi-dimensional correlation coefficient of software faults. The calculation formula of the multi-dimensional correlation coefficient of software faults FCC is as follows:
[0163] FCC(A, B) = a·L(A, B) + β·S(A, B) + γ·M(A, B)
[0164] Wherein alpha, beta, gamma respectively represent the weight of the fault inter-association relationship tightness, the fault intra-feature association coefficient, and the software fault structure association coefficient, wherein 0<=alpha<=1, 0<=beta<=1, 0<=gamma<=1, alpha+beta+gamma=1. In the actual environment, the weight coefficient of the application needs to be adjusted according to different software development backgrounds to obtain better results. Embodiment eleven:
[0166] The difference between the embodiment eleven and the embodiment ten is only that:
[0167] The specific process of the software fault multi-dimensional association relationship analysis method based on association rule mining is as follows.
[0168] The first step is data preprocessing.
[0169] The data preprocessing process is shown in the figure Figure 2 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 the format most suitable for association rule mining. After data processing, the software test case data is converted into the form of D<d1,d n ,…,d n >, wherein d i is the fault number information of the ith fault. The related model structure is shown in the figures Figure 3 and Figure 4 .
[0170] The second step is fault association rule mining.
[0171] After data preprocessing, the FP-Growth algorithm is used for fault association rule mining to obtain the frequent item set.
[0172] The third step is fault inter-association relationship tightness calculation
[0173] The fault inter-association relationship tightness L is used to measure the association degree of the fault in the fault inter-relationship dimension. First, the lift is calculated. The lift is the ratio of the probability of the occurrence of the successor B under the condition of containing the precursor A in the database D and the total probability of the occurrence of B:
[0174]
[0175] The lift is used to evaluate the correlation between the precursor and the successor, wherein the lift greater than 1 represents the positive correlation between the two, and the higher the lift, the stronger the association relationship. In order to unify the value range of the fault association coefficient, the fault association coefficient should be normalized to make the value range of the fault inter-association relationship tightness between 0 and 1, so the calculation formula of the fault inter-association relationship tightness L is as follows:
[0176]
[0177] The fault inter-correlation closeness L can be used as a measure of the correlation strength of the fault in the dimension of the fault itself, and the closer the value of L is, the stronger the correlation is.
[0178] The fourth step is to calculate the fault feature correlation coefficient.
[0179] Fault feature set: the features of the fault are represented in the form of a set, and if A is a 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] Wherein Ai is the value of the current fault corresponding to the software fault feature model in the ith feature dimension.
[0182] Fault feature dimension similarity When calculating the feature correlation coefficient of two faults, the similarity of each feature dimension of the two faults needs to be calculated first, that is, the fault feature dimension similarity. The Levenshtein ratio is used as a method for measuring the similarity of two fault dimensions:
[0183]
[0184] Wherein a and b are a string, representing the value of a certain feature in the fault feature information in the present application, 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 of two faults in the dimension of the fault feature information.
[0186] Let A and B be the fault feature sets of two faults, that is, two d-dimensional vectors, and each feature value in the vector corresponds to a feature dimension in the software fault feature model. Let Ai and Bi be the identifier of any feature dimension, and 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 correlation strength measurement method of the software fault in the dimension of the fault feature.
[0189] The fifth step is to 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 the function dependency graph which 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 explored. The description of software faults in the software fault feature model includes the fault location feature dimension, which can locate the fault location to the function level, so it is feasible to use the function dependency graph to measure the correlation strength between faults. The calculation method of the propagation possibility p between two adjacent function nodes is defined as follows:
[0191]
[0192] Where x and y are adjacent nodes in the function dependency graph, next(y) represents the successor node set 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, i.e. the software fault structure correlation coefficient, can be calculated. The calculation formula of the software fault structure correlation coefficient M is as follows:
[0193]
[0194] Where t i is the ith node on the shortest path from node A to node B in the function dependency graph. The final software fault structure correlation coefficient is calculated by multiplication, and the higher the coefficient value represents the stronger the structural correlation.
[0195] Step 6, software fault multi-dimensional correlation coefficient calculation.
[0196] The existing software fault correlation analysis methods either do not consider the relationship between fault information, or ignore the structural relationship of faults under the overall architecture of software, 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 advantage of comprehensively considering multiple different dimensions under the software fault occurrence scenario, and the analysis is more comprehensive. Compared with the Apriori association rule mining algorithm, it has the advantage of higher efficiency when facing large-scale data.
[0197] The three factors of measuring the software fault correlation relationship, the correlation tightness L between faults, the feature correlation coefficient S in the fault and the software fault structure correlation coefficient M, are obtained from the three dimensions of the software fault correlation relationship analysis in the application above. In actual situations, the three factors cannot completely play a role independently, but interact with each other to produce a whole influence, therefore, when calculating the software fault correlation coefficient, the three factors should be combined and weighted to obtain a more accurate software fault multi-dimensional correlation coefficient. The calculation formula of the software fault multi-dimensional correlation coefficient FCC is shown as follows:
[0198] FCC(A,B)=α·L(A,B)+β·S(A,B)+γ·M(A,B)
[0199] Wherein, α, β, γ represent the weight of the correlation tightness L between faults, the feature correlation coefficient S in the fault and the software fault structure correlation coefficient M respectively, wherein 0≤α≤1, 0≤β≤1, 0≤γ≤1, α+β+γ=1. In actual situations, the weight coefficient of the application needs to be adjusted according to different software development backgrounds to obtain better results.
[0200] The above is only a preferred embodiment of the software fault multi-dimensional correlation relationship analysis method based on the association rule mining, the protection scope of the software fault multi-dimensional correlation relationship analysis method based on the association rule mining is not limited to the above embodiment, any technical solution belonging to the idea is within the protection scope of the application. It should be pointed out that, for those skilled in the art, some improvements and changes without departing from the principle of the application should also be considered as the protection scope of the application.
Claims
1. A software fault multi-dimensional association relationship analysis method based on association rule mining, characterized in that: The method comprises the following steps: Step 1: data preprocessing is performed, test case data is preprocessed, and the test case data is converted into a format most suitable for association rule mining; Step 2: after the data preprocessing is completed, the FP-Growth method is used for fault association rule mining to obtain a frequent item set; Step 3: inter-fault association relationship tightness is calculated to measure the association relationship strength of faults in the dimension of faults themselves; The step 3 is specifically: The inter-fault association relationship tightness L is used to measure the association degree of faults in the dimension of inter-fault relationship, the lift is calculated, and the lift refers to the ratio of the probability that the successor B appears simultaneously under the condition that the association rule contains the predecessor A to the probability that the B appears as a whole in the database D: The fault association coefficient is normalized to make the value range of the inter-fault association relationship tightness between -∞ and 1, and therefore the calculation formula of the inter-fault association relationship tightness L is as follows: The inter-fault association relationship tightness L is used to measure the association relationship strength of faults in the dimension of faults themselves, and the closer the value of L to 1, the stronger the association relationship; Step 4: fault feature association coefficient calculation is performed to measure the similarity degree of two faults in the dimension of fault internal feature information; The step 4 is specifically: The fault feature set is used to represent the features of the fault in the form of a set, and when A is the fault feature set corresponding to a certain fault, the following formula is used: Wherein, Ai is the value of the software fault feature model corresponding to the current fault in the ith feature; Determining fault feature dimension similarity : In the calculation of the feature correlation coefficient of two faults, it is necessary to calculate the similarity of each feature dimension of the two faults respectively, i.e. the fault feature dimension similarity. The Levenshtein ratio is used as a method for measuring the similarity degree of two faults in the dimension: wherein a and b are respectively a string, representing a value of a certain feature in the fault feature information, represents the length of the string a, represents the Levenshtein distance between a and b; The fault feature association coefficient S is determined: the fault feature association coefficient is the fault feature similarity degree, which is used to measure the similarity degree of two faults in the dimension of fault internal feature information; When A, B are two fault feature sets, that is, two d-dimensional vectors, each feature value in the vector corresponds to a feature dimension in the software fault feature model, and A j , B j is the identification of any feature dimension, the calculation method of the fault feature correlation coefficient S is as follows: The fault feature association coefficient is calculated and used as the association relationship strength measurement in the dimension of the internal features of the software fault; Step 5: software fault structure association coefficient calculation is performed to judge the structure association relationship; The step 5 is specifically: The function dependency graph is used to measure the association relationship strength between faults, and the calculation method of the propagation possibility p between two adjacent function nodes is as follows: Wherein, x and y are adjacent nodes in the function dependency graph, next(y) represents the successor node set of y, and out(y,x) represents the out-degree of y to x; The propagation possibility of any two nodes in the function dependency graph, that is, the software fault structure association coefficient M, is calculated, and the calculation formula of the software fault structure association coefficient M is as follows: where 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 structure association coefficient is calculated by multiplication, and the higher the coefficient value, the stronger the structure association relationship; Step 6: software fault multi-dimensional association coefficient calculation is performed to obtain an accurate software fault multi-dimensional association coefficient; The step 6 is specifically: The software fault multi-dimensional association coefficient FCC is calculated by the following formula: wherein, respectively represent the tightness of the inter-fault correlation, the weight of the intra-fault feature correlation coefficient, and the weight of the software fault structure correlation coefficient, wherein .
2. The method of claim 1, characterized in that: After the data processing is completed, the software test case data is converted into the form of where d i is the fault number information of the ith fault.
3. A software fault multi-dimensional association relationship analysis system based on association rule mining, the system is operated based on the software fault multi-dimensional association relationship analysis method based on association rule mining of claim 1, characterized in that: The system comprises: The preprocessing module performs data preprocessing, pre-processes test case data, extracts all fault data in 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; The association mining module performs fault association rule mining using an FP-Growth method after the data preprocessing is completed, and obtains frequent item sets; The closeness calculation module performs inter-fault association relationship closeness calculation, and measures the association relationship strength of faults in the dimension of faults themselves; The feature association coefficient calculation module performs fault feature association coefficient calculation, and measures the similarity of two faults in the dimension of fault feature information; The structure association coefficient calculation module performs software fault structure association coefficient calculation, and judges the structure association relationship; The multi-dimensional association coefficient calculation module performs software fault multi-dimensional association coefficient calculation, and obtains accurate software fault multi-dimensional association coefficients.
4. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by a processor for implementing the method of any one of claims 1-2.
5. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that: The processor implements the method of any one of claims 1-2 when executing the computer program.
Citation Information
Patent Citations
Software FMEA (failure mode and effects analysis) method based on level dependency modeling
CN103473400A
Tunnel traffic accident association rule algorithm based on FP-Growth algorithm
CN107145609A