Software quality adaptive measurement method based on information geometry and reinforcement learning

By combining information geometry and reinforcement learning, low-dimensional manifold coordinates of software class graphs are extracted and adaptively optimized, overcoming the limitations of traditional software quality measurement methods and achieving efficient and accurate evaluation of complex software systems.

CN121579322AActive Publication Date: 2026-02-27JIANGXI UNIVERSITY OF FINANCE AND ECONOMICS
View PDF 12 Cites 0 Cited by

Patent Information

Application Number
CN202511864814.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-02-27
Estimated Expiration
2045-12-11

AI Technical Summary

Technical Problem

Existing software quality measurement methods cannot adapt to the dynamic and uncertain nature of software quality evaluation. They lack geometric modeling of high-dimensional manifold spaces, traditional methods struggle to accurately characterize the intrinsic structure of quality features, and they do not fully utilize machine learning, especially reinforcement learning techniques, to achieve adaptive optimization of the evaluation process.

Method used

A method combining information geometry and reinforcement learning is adopted. Low-dimensional manifold coordinates are extracted through information geometric mapping and sparse representation to construct composite fuzzy matter-element, and multi-round iterative optimization is performed through an adaptive feedback mechanism of reinforcement learning. The comprehensive evaluation value of the software class graph is calculated by combining the MARCOS method.

Benefits of technology

It enables dynamic and adaptive evaluation of software quality, improves the accuracy and discriminative power of measurement results, overcomes the limitations of traditional methods, and adapts to the nonlinear and high-dimensional quality data of complex software systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579322A_ABST
    Figure CN121579322A_ABST
Patent Text Reader

Abstract

The invention discloses a software quality adaptive measurement method based on information geometry and reinforcement learning. The method comprises the following steps: acquiring original quality feature data of a software class diagram; extracting low-dimensional manifold coordinates through information geometric mapping and sparse representation; reconstructing an index quantity value according to the manifold coordinates and constructing a composite fuzzy matter element; carrying out nondimensionalization on matter elements to obtain an optimal membership matrix; determining an initial weight based on an entropy weight method; iterative optimization is carried out through a reinforcement learning adaptive feedback mechanism to obtain an optimization weight; and calculating a comprehensive evaluation value by adopting an MARCOS method and outputting a measurement result. According to the method, a breakthrough of software quality measurement from static state to dynamic state self-adaption is realized, the accuracy and practicability of measurement are remarkably improved, and the defects of a traditional method in the aspects of high-dimensional complexity, evaluation fuzziness and static weight limitation are effectively overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer software quality analysis and measurement technology, and involves the cross-application of information geometry, machine learning and multi-criteria decision making, especially an adaptive measurement method for software quality based on information geometry and reinforcement learning. Background Technology

[0002] Software metrics are an important and long-standing research area in software engineering. They are a crucial measure and effective method for evaluating and predicting software development activities, with the fundamental purpose of providing guidance for developing high-quality software.

[0003] Since Rubey RJ and Hartwick RD proposed the concept of software metrics in 1968, research and application of software metrics have been conducted for over fifty years, mainly focusing on two aspects: software quality metrics based on internal software attributes and software quality metrics based on external software attributes. Research has found that many scholars tend to start with the intrinsic elements of the software itself, seeking key or important software quality measurement factors for direct or indirect measurement or specific statistics, and constructing corresponding measurement models.

[0004] Early research on structured program metrics, represented by theoretical achievements such as Lines of Code (LOC), McCabe coloring graphs, and Function Point Analysis (FPA), all belong to this type of software quality metric research. Subsequently, regarding research on object-oriented software quality metrics, Chidamber S. and Kemerer C. proposed a set of CK metrics in 1994, including: weighted number of methods per class, number of subclasses, depth of inheritance tree, coupling between classes, lack of class cohesion, and number of response sets per class—six metrics in total—laying the cornerstone of object-oriented software quality metrics.

[0005] In research on software quality metrics based on external software attributes, the software quality characteristics that developers and researchers focus on are broadly defined. This includes not only the software quality characteristics encompassed by the narrowly defined ISO / IEC 25010 software quality model, but also other software quality characteristics related to software development and application. A typical example is Gosain A. and Sharma G., who defined dynamic software quality characteristics such as robustness, explicitness, dynamism, discriminativeness, and machine independence, and evaluated relevant Java software examples.

[0006] Class diagram, as a very important software model diagram, describes the classes in the system and their various relationships with each other, and the scientificity of its construction has a significant impact on the complexity of software. At present, Marchesi M. uses 7 indicators to measure the complexity of class diagram from different angles; Genero M. uses 14 indicators to further distinguish the relationship between classes; Dr. Zhou Yuming uses an indicator to evaluate the complexity of class diagram, converts the class diagram considering only the relationship between classes into a weighted class dependency graph, and uses information entropy to measure the class diagram; Dr. Yi Tong believes that not only the relationship between classes affects the complexity of class diagram, but also the attributes and methods within the class affect the complexity of class diagram, and proposes a UML class diagram complexity measurement method based on dependency analysis.

[0007] However, the existing research has the following shortcomings: (1) The traditional method mainly uses static weight, which cannot adapt to the dynamics and uncertainty of software quality evaluation; (2) The classic multi-criteria decision-making method such as TOPSIS has a history of more than 40 years, and lacks theoretical innovation and method updating; (3) There is a lack of research on geometric modeling of software quality from the perspective of high-dimensional manifold space, and the traditional Euclidean space measurement cannot accurately depict the internal structure of quality characteristics; (4) The machine learning, especially the reinforcement learning technology, is not fully utilized to realize the adaptive optimization and dynamic adjustment of the evaluation process. SUMMARY

[0008] To solve the above technical problems, the present application provides a software quality adaptive measurement method based on information geometry and reinforcement learning to solve the problems existing in the prior art.

[0009] To achieve the above purpose, the present application provides a software quality adaptive measurement method based on information geometry and reinforcement learning, comprising: obtaining the original quality characteristic data of a plurality of software class diagrams; Based on the original quality characteristic data, the low-dimensional manifold coordinates of each software class diagram are extracted by information geometry mapping and sparse representation; According to the low-dimensional manifold coordinates, the magnitude of each software class diagram on each quality evaluation index is reconstructed, and a composite fuzzy matter element is constructed based on the magnitude of all software class diagrams; The composite fuzzy matter element is subjected to dimensionless treatment to obtain a superior membership matrix; Based on the reconstructed magnitude, the initial weight of each evaluation index is calculated by entropy weight method; Taking the initial weight as the starting point, the reinforcement learning adaptive feedback mechanism is used for multi-round iteration optimization to obtain the optimized weight; Based on the optimized weight and the superior membership matrix, the MARCOS method is used to calculate the comprehensive evaluation value of each software class diagram. outputting a software quality measurement result according to the comprehensive evaluation value.

[0010] Optionally, the process of extracting low-dimensional manifold coordinates of each software class diagram based on the original quality feature data through information geometry mapping and sparse representation includes: mapping the original quality feature data to a statistical manifold composed of a probability distribution family, calculating a Fisher information metric tensor based on the statistical manifold to establish a Riemannian geometry structure; on the Riemannian manifold space, constructing an over-complete dictionary using a K-SVD dictionary learning algorithm, and solving sparse representation coefficients of each software class diagram using a LARS algorithm; extracting non-zero elements from the sparse representation coefficients, learning a projection matrix through principal component analysis, mapping the non-zero sparse coefficients to a low-dimensional space using the projection matrix, and obtaining the low-dimensional manifold coordinates.

[0011] Optionally, the process of reconstructing a value of each software class diagram on each quality evaluation index according to the low-dimensional manifold coordinates, and constructing a complex fuzzy matter-element based on the values of all software class diagrams includes: establishing a mapping relationship from the manifold coordinates to the evaluation index values based on statistical characteristics of each evaluation index in the training set, determining a corresponding relationship between each evaluation index and a manifold coordinate component through correlation analysis based on the mapping relationship, reconstructing the low-dimensional manifold coordinates of each software class diagram into values on each evaluation index based on the corresponding relationship, and constructing a complex fuzzy matter-element based on the reconstructed values of each evaluation index.

[0012] Optionally, the process of performing dimensionless processing on the complex fuzzy matter-element to obtain a superior membership matrix includes: performing dimensionless processing on characteristic values in the complex fuzzy matter-element; wherein a superior membership is obtained by calculating a difference between a current value and a minimum value of an index relative to a difference between a maximum value and the minimum value of the index for a positive index, and by calculating a difference between the maximum value of the index and the current value relative to the difference between the maximum value and the minimum value of the index for an inverse index; when the maximum value of the index is equal to the minimum value, the corresponding superior membership is set to a predetermined value; and a superior membership matrix is constructed based on all superior memberships.

[0013] Optionally, the process of calculating initial weights of each evaluation index through an entropy weight method based on the reconstructed values includes: constructing an original data matrix based on the reconstructed values, performing standardization processing on the original data matrix to obtain a standardized matrix, calculating information entropy of each evaluation index based on the standardized matrix, calculating an information utility coefficient of each evaluation index according to the information entropy, and determining the initial weights based on the information utility coefficient.

[0014] Optionally, the multi-round iterative optimization is performed through a reinforcement learning adaptive feedback mechanism to obtain the optimized weight, including the following iterative process: a weighted decision matrix is calculated based on the current weight vector and the optimal membership matrix, and a measurement result deviation is calculated based on the weighted decision matrix; a state vector is constructed based on the measurement result deviation, and a reward signal is calculated based on the measurement result deviation of the adjacent iteration; the current weight vector is adjusted for the first time based on a dynamic inertia weight strategy, and the weight vector after the first adjustment is adjusted for the second time based on a proximal policy optimization algorithm; whether to output the optimized weight vector is determined through a multi-dimensional convergence judgment mechanism.

[0015] Optionally, the multi-dimensional convergence judgment mechanism includes: whether the standard deviation of the measurement result deviation of the continuous multiple iterations is less than a first threshold value is determined; whether the ratio of the standard deviation to the mean of the reward signal of the continuous multiple iterations is less than a second threshold value is determined; whether the Euclidean distance of the weight vectors of the adjacent two iterations is less than a third threshold value is determined; when all the judgment conditions are met at the same time, the current weight vector is output as the optimized weight vector.

[0016] Optionally, the process of calculating the comprehensive evaluation value of each software class diagram using the MARCOS method includes: the optimal membership matrix is weighted using the optimized weight to obtain a weighted decision matrix, the ideal solution vector and the anti-ideal solution vector are determined from the weighted decision matrix, the related parameters of each software class diagram and the ideal solution and the anti-ideal solution are calculated based on the weighted decision matrix, the ideal solution vector and the anti-ideal solution vector, and the comprehensive evaluation value of each software class diagram is calculated through weighted fusion based on the related parameters.

[0017] Optionally, calculating the related parameters of each software class diagram and the ideal solution and the anti-ideal solution includes performing the following calculations for each software class diagram: a first Euclidean distance between the weighted vector in the weighted decision matrix and the ideal solution vector is calculated, a second Euclidean distance between the weighted vector and the anti-ideal solution vector is calculated, a sum of all weighted values in the weighted decision matrix is calculated as a weighted attribute sum, a first utility degree is calculated based on the sum of the weighted attribute sum and the ideal solution vector, and a second utility degree is calculated based on the sum of the weighted attribute sum and the anti-ideal solution vector.

[0018] Optionally, the comprehensive evaluation value of each software class diagram is calculated through weighted fusion based on the related parameters, including: For each software class diagram, based on the first utility degree and the second utility degree, the first uncertainty weight and the second uncertainty weight are calculated through a binary entropy function; and based on the first uncertainty weight, the second uncertainty weight, the first Euclidean distance and the second Euclidean distance, a comprehensive evaluation value of the software class diagram is obtained through weighted fusion.

[0019] Compared with the prior art, the present application has the following advantages and technical effects: By introducing the information geometry theory to construct the statistical manifold model, the present application overcomes the fundamental limitation of the traditional Euclidean space measurement. The intrinsic correlation and nonlinear structure between the software quality characteristics are accurately described by using the Fisher information measurement tensor, so that the quality similarity measurement follows the geometric characteristics of the inherent probability distribution rather than the simple straight-line distance. This innovation significantly improves the accuracy and rationality of the quality characteristic representation from the mathematical foundation level, and is especially suitable for processing the common nonlinear and high-dimensional quality data in complex software systems.

[0020] By using the sparse representation theory combined with the K-SVD and LARS algorithms, the present application realizes effective reduction from high-dimensional redundant features (n-dimensional) to low-dimensional essential features (d-dimensional, d=n / 2). This technology can automatically identify and extract the key feature patterns with the highest contribution to quality discrimination, while filtering redundant information and noise interference. This not only greatly reduces the complexity of subsequent calculation and improves the measurement efficiency, but also effectively improves the discrimination and accuracy of the measurement results by focusing on the core quality indicators.

[0021] The RLAF mechanism innovatively proposed by the present application breaks through the rigid framework of the traditional static weight allocation. By constructing a complete reinforcement learning cycle including state evaluation, reward feedback, dynamic inertia weight adjustment and proximal policy optimization, dynamic and adaptive iterative optimization of the weight vector is realized. This mechanism enables the measurement system to adjust the importance of indicators in real time according to the characteristics and feedback signals of the current evaluation task, and ensures the stability and reliability of the optimization process through multi-dimensional convergence judgment, significantly enhancing the adaptability of the method to complex and variable software project environments, and realizing a fundamental change from "static configuration" to "dynamic intelligence".

[0022] By using the new MARCOS multi-criteria decision-making method, the present application overcomes the single perspective limitation of the traditional TOPSIS method which only relies on the relative distance. The MARCOS method calculates the weighted attribute sum ratio of the ideal solution and the anti-ideal solution of the to-be-evaluated class diagram through the utility function, which can better reflect the intrinsic value of the scheme compared with the distance measurement of TOPSIS. Further, the uncertainty weights and This design achieves an adaptive balance between the proximity to the ideal solution and the distance from the anti-ideal solution. This allows the final evaluation value to reflect the overall performance level of the evaluated object while automatically adjusting the contributions of different evaluation dimensions through an entropy-weighted mechanism, thus outputting more robust and decision-supporting evaluation results. Compared to TOPSIS's fixed distance ratio calculation method, MARCOS's utility and entropy-weighted fusion mechanism can more accurately distinguish software class graphs with similar quality levels, improving the discriminative power of the measurement results. Attached Figure Description

[0023] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a flowchart of a method according to an embodiment of the present invention. Detailed Implementation

[0024] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0025] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0026] Example 1 like Figure 1 As shown, this embodiment provides an adaptive software quality measurement method based on information geometry and reinforcement learning, including: Obtain the raw quality feature data of multiple software class diagrams; Based on the original quality feature data, the low-dimensional manifold coordinates of each software class graph are extracted through information geometric mapping and sparse representation; Based on the low-dimensional manifold coordinates, the values ​​of each software class graph on each quality evaluation index are reconstructed, and a composite fuzzy matter element is constructed based on the values ​​of all software class graphs. The composite fuzzy matter-element is dimensionless to obtain the preferred membership matrix; Based on the values ​​obtained from the reconstruction, the initial weights of each evaluation index are calculated using the entropy weight method. Starting with the initial weights, multiple rounds of iterative optimization are performed through a reinforcement learning adaptive feedback mechanism to obtain the optimized weights. Based on the optimized weight and preferred membership matrix, the MARCOS method is used to calculate the comprehensive evaluation value of each software class diagram; According to the comprehensive evaluation value, output software quality measurement results.

[0027] (I) Information geometric manifold space modeling and sparse representation; Based on the original quality feature data, the process of mapping and sparse representation of each software class diagram low-dimensional manifold coordinates includes: Map the original quality feature data to the statistical manifold composed of probability distribution family, calculate the Fisher information metric tensor based on the statistical manifold to establish the Riemannian geometry structure; On the Riemannian manifold space, the K-SVD dictionary learning algorithm is used to construct the over-complete dictionary, and the LARS algorithm is used to solve the sparse representation coefficient of each software class diagram; Extract non-zero elements from the sparse representation coefficient, learn the projection matrix through principal component analysis, and map the non-zero sparse coefficient to the low-dimensional space using the projection matrix to obtain the low-dimensional manifold coordinates.

[0028] According to the low-dimensional manifold coordinates, the value of each software class diagram on each quality evaluation index is reconstructed, and the process of constructing a composite fuzzy matter element based on the values of all software class diagrams includes: Based on the statistical characteristics of each evaluation index in the training set, a mapping relationship from the manifold coordinates to the evaluation index values is established, the corresponding relationship between each evaluation index and the manifold coordinate component is determined based on the mapping relationship through correlation analysis, the low-dimensional manifold coordinates of each software class diagram are reconstructed into the values of each evaluation index based on the corresponding relationship, and the composite fuzzy matter element is constructed based on the reconstructed values of each evaluation index.

[0029] (1) Construction of information geometric manifold space; Information geometry theory regards the probability distribution space as a Riemannian manifold, which provides a new mathematical framework for software quality measurement. The quality features of software class diagrams often exhibit nonlinear manifold structure in high-dimensional space, and the traditional Euclidean space measurement method is difficult to accurately describe its intrinsic geometric characteristics.

[0030] Let the software class diagram set be , where represents the total number of class diagrams to be evaluated. Each class diagram ( ) contains quality evaluation indexes , which can include the number of class weighting methods, inheritance tree depth, class coupling degree, class cohesion deficiency, response set number, attribute number, method complexity, and other characteristics reflecting software quality.

[0031] Under the information geometry framework, map the quality features of each class diagram to the statistical manifold composed of probability distribution family. The statistical manifold is defined as: where, is the coordinate parameter vector on the manifold, is the parameter space, is the manifold dimension. To achieve dimension reduction while preserving the main information, usually take , i.e., the manifold dimension is about half of the original feature dimension. denotes the probability density function at the parameter , and is the observed data.

[0032] The Fisher information metric tensor is defined on the manifold as the Riemannian metric, which is in the form of: where, denotes the expectation operation with respect to the probability distribution , and is the index of the manifold coordinate. This metric tensor characterizes the local geometric structure on the manifold, making the similarity measurement of software quality features more consistent with their inherent probability distribution characteristics. Specifically, the element of the Fisher information metric tensor measures the correlation between parameters and , and the larger the value, the stronger the statistical association between the two parameters.

[0033] The specific calculation method of the Fisher information metric tensor: assuming that the quality feature vector of each class diagram follows a multivariate Gaussian distribution , where is the mean vector, is the covariance matrix. The parameter vector contains the lower triangular elements of the mean vector and the covariance matrix, i.e., , where denotes the operator that extracts the lower triangular elements (including the diagonal) of the matrix and stacks them into a vector by column.

[0034] At this time, the element of the Fisher information matrix can be calculated by the following formula: where, denotes the trace operation of the matrix, is the inverse matrix of the covariance matrix, and denote the covariance matrix and the mean vector with respect to the parameter ​The partial derivatives. The first term of formula (3) reflects the contribution of changes in the covariance structure to the information measure, and the second term reflects the contribution of changes in the mean.

[0035] Geometric Interpretation of the Fisher Information Metric Tensor: On a statistical manifold, the geodesic distance between two points can be calculated by integrating the Fisher information metric along a path. Let... A curve on a manifold ( If ), then the curve length L is: The integral in Equation (4) gives the shortest path length between two quality feature points on the manifold, which reflects the intrinsic similarity of quality features better than the traditional Euclidean distance. In practical calculations, the Riemann gradient descent method or the geodesic algorithm can be used to solve for the optimal path on the manifold.

[0036] (2) Key feature extraction based on sparse representation; Quality evaluation metrics for software class diagrams often exhibit high dimensionality and redundancy, and different metrics may show strong correlations. Sparse representation theory, by finding the minimum linear combination of basic elements to represent data, can effectively extract key quality features and remove redundant information.

[0037] For class diagrams The original feature vector In a complete dictionary Searching for sparse representation coefficients .here This indicates that the number of atoms in the dictionary is much greater than the original feature dimension, causing the dictionary to be overcomplete. Each column vector in the dictionary... ( A ) is called a dictionary atom, representing a basic quality characteristic pattern.

[0038] The sparse representation model is: in, To reconstruct the error vector, satisfying .here This is a preset error tolerance used to control reconstruction accuracy. It is recommended to set it based on the original signal energy. This means that the reconstruction error is allowed to be no more than 1% of the original signal energy. express Norm (Euclidean norm), defined as ,in For vectors The Each component.

[0039] Sparse representation coefficients by solving the following norm-constrained optimization problem: where denotes the norm, i.e., the number of non-zero elements, defined as . The goal of formula (6) is to represent the original feature vector using as few dictionary atoms as possible while satisfying the reconstruction accuracy constraint, thus extracting the most critical quality features.

[0040] Since norm optimization is NP-hard, it is theoretically impossible to obtain the global optimal solution in polynomial time. Therefore, we use norm as the convex relaxation of norm, and convert the optimization problem to: where is the norm. Under certain conditions (e.g., the dictionary satisfies the restricted isometry property (RIP)), the solution of formula (7) is equivalent to the solution of formula (6), i.e., Relaxation can recover the sparse solution of problem.

[0041] Sparse optimization solution algorithm: use the least angle regression (LARS) algorithm to solve formula (7). The basic idea of the LARS algorithm is to gradually select the dictionary atom with the largest correlation with the current residual to join the active set, and update the coefficients along the equal angle direction. The specific steps are as follows: Step 1: initialize the residual , the active set , the sparse coefficients , and the iteration count .

[0042] Step 2: calculate the correlation ( ) of all dictionary atoms with the current residual, and select the atom index with the largest correlation.

[0043] Step 3: add to the active set , and record the active dictionary matrix as .

[0044] Step 4: calculate the equal angle direction , where is a full 1 vector.

[0045] Step 5: calculate the step size such that the correlation of the residual after moving along direction is equal to the current maximum correlation.

[0046] Step 6: Update the residual , update the sparse coefficients (only active set corresponding positions).

[0047] Step 7: If or the preset maximum iteration number is reached, stop; otherwise, let , return to step 2.

[0048] The computational complexity of the LARS algorithm is , where is the number of dictionary atoms, is the feature dimension. The algorithm is suitable for medium-scale problems, and for large-scale problems, fast algorithms such as online dictionary learning can be used.

[0049] Construction method of overcomplete dictionary: use the K-SVD dictionary learning algorithm to learn the dictionary from the training samples. For training samples , learn the dictionary by the following alternating optimization steps : Initialization: randomly generate a dictionary whose column vectors are normalized to unit vectors. The size of the dictionary is recommended to be set to , that is, the redundancy is 2, which avoids excessive redundancy while ensuring representation ability.

[0050] Iterative optimization , where is the maximum number of iterations of dictionary learning, which is recommended to be : (1) Sparse coding stage: fix the dictionary , for each training sample ( ), use the LARS algorithm to solve formula (7) to obtain the sparse coefficient , forming the sparse coefficient matrix .

[0051] (2) Dictionary update stage: fix the sparse coefficient matrix , update the dictionary atom column by column. For the th dictionary atom , define the sample index set that uses this atom. If , randomly select a residual of a training sample as a new dictionary atom; otherwise, calculate the residual matrix , where is the matrix composed of all training samples, For the first row. Extract the column corresponding to , denoted as , and perform singular value decomposition (SVD) on to obtain , take the left singular vector corresponding to the largest singular value as the updated dictionary atom , and the corresponding sparse coefficient is updated as , where is the largest singular value, is the corresponding right singular vector.

[0052] (3) Convergence judgment: calculate the reconstruction error , where is the Frobenius norm. If (suggested ), it is considered to be converged, and the output is output; otherwise, continue iteration.

[0053] The dictionary atoms corresponding to the non-zero elements in the sparse coefficient are the key quality features of the class diagram . Through sparse representation, the high-dimensional original features are compressed into a low-dimensional sparse space, and the most discriminative quality patterns are extracted.

[0054] Mapping from sparse coefficient to manifold coordinate: the coordinate parameter on the information geometric manifold can be determined by the non-zero part of the sparse coefficient . Define the mapping function as: where denotes the vector composed of the non-zero elements of , and is the number of non-zero elements. is the mapping function from sparse coefficient to manifold coordinate, is the linear projection matrix, where is the average sparsity.

[0055] The projection matrix is learned from the non-zero sparse coefficients of the training samples by principal component analysis (PCA). The specific steps are as follows: Step 1: Collect the non-zero sparse coefficients of all training samples and construct the matrix . Since the sparsity of different samples may be different, zero padding is performed on the samples with sparsity less than , and zero truncation is performed on the samples with sparsity greater than​ truncating or selecting the most important non-zero elements.

[0056] Step 2: Centering the data, compute the mean vector , and the centered matrix , where is a dimensional all-ones vector.

[0057] Step 3: Compute the covariance matrix , and perform eigenvalue decomposition , where is the diagonal matrix of eigenvalues (sorted in descending order), and is the matrix of eigenvectors.

[0058] Step 4: Select the eigenvectors corresponding to the top largest eigenvalues, and construct the projection matrix , which ensures that the mapped manifold coordinates .

[0059] By formula (8), the sparse coefficients are mapped to the information geometric manifold coordinates, realizing the nonlinear dimensionality reduction from the original high-dimensional feature space to the low-dimensional manifold space, laying a foundation for subsequent fuzzy matter-element evaluation.

[0060] (3) Mapping from manifold coordinates to evaluation indicators; In order to map the coordinate parameters on the information geometric manifold back to the index value ( ) required by the fuzzy matter-element evaluation system, it is necessary to define the reverse mapping function. Linear transformation combined with statistical normalization is adopted: where and are the mean and standard deviation of the th indicator on the training set, respectively, defined as: where is the original value of the th indicator of the th class in the training set. is the mapping function from the indicator index to the dimension of the manifold coordinates, , denotes the th component of the manifold coordinate vector . ​​

[0061] Mapping function The correlation analysis is determined by the following steps: Step 1: For each index in the training set , calculate its Pearson correlation coefficient with all manifold coordinate components ( ): where is the th component of the th sample manifold coordinate, and is the mean of the th manifold coordinate component.

[0062] Step 2: For each index , select the manifold coordinate dimension with the largest correlation as the mapping target: When the manifold dimension , there may be multiple indices mapped to the same manifold coordinate dimension. In this case, a weighted average of multiple manifold coordinate components can be used to reconstruct the index value: where the weight is obtained by normalizing the absolute value of the correlation coefficient: Through formulas (9)-(14), the mapping from the information geometric manifold coordinates to the fuzzy matter element evaluation index is completed, and the original data matrix is constructed, which lays a foundation for subsequent fuzzy matter element analysis and weight optimization.

[0063] (II) Establishment of fuzzy matter element evaluation system; The process of dimensionless processing of the composite fuzzy matter element to obtain the superior membership matrix includes: Dimensionless processing of the characteristic values in the composite fuzzy matter element; wherein the superior membership of the inverse index is obtained by calculating the difference between the maximum value of the index and the current value relative to the difference between the maximum value and the minimum value of the index, the superior membership of the positive index is obtained by calculating the difference between the current value and the minimum value of the index relative to the difference between the maximum value and the minimum value of the index, and when the maximum value of the index is equal to the minimum value, the corresponding superior membership is set to a predetermined value; the superior membership matrix is constructed based on all superior memberships.

[0064] (1) Concepts of fuzzy matter element and composite matter element; Matter-element analysis is a new discipline to study the rules and methods of solving incompatible problems, and is a cross-discipline of thinking science, system science and mathematics. Fuzzy matter-element combines the theory of fuzzy set and matter-element analysis, and can solve the fuzziness of measurement index and the incompatibility of measurement result.

[0065] In matter-element analysis, the described matter (assessment object, i.e. software class diagram), the characteristics (assessment index, such as coupling degree, cohesion degree, etc.) and the corresponding value of the characteristics (assessment index corresponding to the specific value) are combined to form a set of basic elements describing the matter, i.e. matter-element, represented as a three-tuple .

[0066] If the corresponding value of the characteristics has fuzziness (such as "high coupling degree", "medium complexity", etc.), it is called fuzzy matter-element. The fuzziness comes from the inherent subjectivity and uncertainty in software quality evaluation, for example, some indexes are difficult to quantify accurately, or different evaluators have different judgments on the same index.

[0067] If the described matter has characteristics , and the corresponding value is , it is called -dimensional fuzzy matter-element, which can be represented as: When it is necessary to evaluate matters (class diagrams) at the same time, the -dimensional matter-element of matters is combined to form a -dimensional compound fuzzy matter-element of matters, denoted as , and represented in matrix form: In formula (16), the first row is the index name row, and the first column is the class diagram identifier column. is the identifier of the ( )th matter (software class diagram), is the ( )th characteristic (quality evaluation index) of the matter, is the value corresponding to the th characteristic of the matter. Combined with the information geometry sparse representation, ​​​The flow coordinates can be calculated from the formula (9) , that is .

[0068] Complex fuzzy matter-element The characteristics of multiple software class diagrams on multiple quality indicators are completely described, providing a unified data representation framework for subsequent dimensionless processing, weight calculation, and comprehensive evaluation.

[0069] (2) Dimensionless processing of evaluation indicators; In the software quality evaluation process, the evaluation indicators involved often have different dimensions and orders of magnitude. For example, the number of methods of a class may be an integer of tens to hundreds, while the coupling degree may be a decimal between 0 and 1. If there is no unified measurement standard between indicators, the evaluation process will be difficult to proceed, and indicators of different dimensions cannot be directly compared and synthesized. In order to synthesize indicators of different dimensions for comparison, the values of these evaluation indicators must be dimensionless. Dimensionless processing is to eliminate the influence of dimensions on physical values through mathematical methods, and convert all indicators to a unified dimensionless scale (usually [0, 1] interval).

[0070] There are generally two types of indicators for quantitative processing results: 1) Positive indicators (the larger the better type): the larger the indicator value, the better the quality, such as class cohesion, maintainability score, etc. For positive indicators, the dimensionless formula is: 2) Reverse indicators (the smaller the better type): the smaller the indicator value, the better the quality, such as complexity, coupling degree, defect density, etc. In software quality evaluation, according to actual conditions, most indicators belong to the smaller the better type. For reverse indicators, the following dimensionless formula is used: In formula (17) and formula (18), is the dimensionless result of the corresponding value of the th feature (indicator) of the th matter (class diagram), called the superior membership degree. is the maximum value of the corresponding value of the th feature of the evaluation matter in all class diagrams, is the corresponding minimum value.

[0071] The geometric meaning of formula (18) is: for reverse indicators, the original value is closer to (worse), and the dimensionless value is closer to 0; the original value is closer to (the better), the dimensionless is closer to 1. In this way, regardless of the original dimension of the index, the dimensionless represents "good degree", the larger the value, the better the index performance.

[0072] Special case processing: when , that is, all class diagrams have the same value on the th index, at this time the index has no contribution to distinguish different class diagrams. To avoid the denominator being zero, set: After the magnitude in formula (16) is dimensionless by formula (18) (for inverse index) or formula (17) (for positive index), the superior membership fuzzy matter-element is obtained: The superior membership matrix in formula (20) is the basic data for subsequent weight calculation and comprehensive evaluation. Through dimensionless, different dimensional indexes are unified to the [0, 1] interval, eliminating the influence of dimensional differences, so that different indexes can be compared and weighted comprehensively.

[0073] (Three) initial weight determination based on entropy method; Based on the magnitude obtained by reconstruction, the process of calculating the initial weight of each evaluation index by entropy weight method includes: Based on the magnitude obtained by reconstruction, the magnitude is standardized to obtain a standardized matrix, the information entropy of each evaluation index is calculated based on the standardized matrix, the information utility coefficient of each evaluation index is calculated according to the information entropy, and the initial weight is determined based on the information utility coefficient.

[0074] In the software quality evaluation process, the weight of a certain index reflects the relative importance of the index in the overall evaluation process. The reasonable determination of the weight directly affects the accuracy and reliability of the final evaluation result. Entropy method is an objective weighting method based on information theory, which determines the weight of each index according to the difference of information order contained in each index, avoiding the randomness of subjective weighting. The present application adopts entropy method to calculate the initial weight , as the starting point of subsequent RLAF mechanism adaptive feedback optimization.

[0075] For the system discussed, suppose that an initial data matrix of evaluation indexes of sample class diagrams is obtained. Since the dimensions, orders of magnitude and index advantages and disadvantages of each index are quite different, the initial data needs to be standardized. The normalization method is adopted to convert the data into a probability distribution form: Obviously, in formula (21) , the sum of the normalized values of the th indicator on all class diagrams is 1, satisfying the normalization condition of probability distribution. Thus, the normalized matrix of data is obtained .

[0076] Special case processing: if , standardization cannot be performed. At this time, if all , it means that the indicator has no difference on all samples, and it can be set as ; if there is a negative value, a translation transformation (where is a small positive number) is needed before standardization.

[0077] For each row of data in the matrix , i.e., the normalized value of the th class diagram on all indicators, reordering is performed in descending order to obtain the decision matrix . The purpose of ordering is to enhance the stability of information entropy calculation, so that data with the same size relationship have comparability in different samples.

[0078] According to the definition of information entropy, the information entropy value of the th indicator is calculated by formula (22): The constant in formula (22) is related to the sample number of the system, and is usually taken as , so that the information entropy . When , define (in the limit sense). The information entropy measures the information dispersion degree of the th indicator on all samples.

[0079] Physical meaning of information entropy: The larger the , the more uniform the distribution of the th indicator on different samples, the weaker the distinguishing ability, and the smaller the contribution to comprehensive evaluation; The smaller the , the greater the difference of the indicator on different samples, the stronger the distinguishing ability, and the greater the contribution to comprehensive evaluation. When completely disordered (all samples have the same value on the indicator, i.e. , the information entropy

[0080] , and the utility value of the information of the indicator to comprehensive evaluation is zero.

[0080] Therefore, the information utility value of a certain indicator depends on 1 and the information entropy of that indicator. The difference is defined as the information utility coefficient. : The larger the value, the higher the information utility value of the indicator, and it should be given greater weight in the comprehensive evaluation.

[0081] The initial weights of each indicator are estimated using the entropy method, which essentially involves calculating the weights using the value coefficient of that indicator's information. The higher the value coefficient, the greater its importance in the evaluation. Therefore, the first... Initial weights of the indicators for: Formula (24) ensures the normalization of the weight vector, that is The initial weight vector is obtained. Satisfying the normalization constraint conditions and .

[0082] Characteristics of initial weights: The initial weights obtained by the entropy weight method are objective weights based entirely on the data distribution, reflecting the distinguishing ability of each indicator. However, static initial weights cannot adapt to dynamic changes and uncertainties in the evaluation process, therefore, adaptive optimization is required through a subsequent RLAF mechanism.

[0083] (iv) Adaptive Feedback Optimization Mechanism (RLAF) Based on Reinforcement Learning; The optimization weights are obtained through multiple rounds of iterative optimization using a reinforcement learning adaptive feedback mechanism, including the following iterative process: Calculate the weighted decision matrix based on the current weight vector and the preferred membership matrix; calculate the measurement result deviation based on the weighted decision matrix; construct the state vector based on the measurement result deviation; calculate the reward signal based on the measurement result deviation of adjacent iterations; perform the first adjustment on the current weight vector based on the dynamic inertia weight strategy; perform the second adjustment on the weight vector after the first adjustment based on the near-end strategy optimization algorithm; determine whether to output the optimized weight vector through a multi-dimensional convergence judgment mechanism.

[0084] The multi-dimensional convergence judgment mechanism includes: Determine whether the standard deviation of the measurement result of multiple consecutive iterations is less than the first threshold; determine whether the ratio of the standard deviation to the mean of the reward signal of multiple consecutive iterations is less than the second threshold; determine whether the Euclidean distance between the weight vectors of two adjacent iterations is less than the third threshold; when all the judgment conditions are met at the same time, output the current weight vector as the optimized weight vector.

[0085] Traditional software quality measurement methods use fixed weights, which cannot adapt to dynamic changes, sample characteristic differences and uncertainty factors in the evaluation process. The present application innovatively proposes a reinforcement learning adaptive feedback (RLAF) optimization mechanism based on reinforcement learning, which realizes dynamic iterative optimization of weights through intra-task feedback loops.

[0086] (1) Theoretical basis of RLAF mechanism; Reinforcement learning (RL) is a machine learning method that learns from the feedback of evaluating performance through interaction with the environment, and is particularly suitable for optimizing sequential decision problems. Unlike supervised learning, reinforcement learning does not rely on a predefined training data set and labels, but uses reward signals to guide agents to achieve desired behavior. The core elements of reinforcement learning include state, action, policy, reward and value function.

[0087] In the software quality measurement scenario, the weight vector is regarded as the policy parameter of the agent, and the deviation of the measurement result is regarded as the observation of the state of the environment. By designing a reward function and using the Proximal Policy Optimization (PPO) algorithm, the iterative optimization of the weights is realized. The RLAF mechanism includes the following core components: 1) State space (State Space): defined as where represents the deviation vector of the measurement result at the th iteration. To capture the time series trend of the deviation, contains the deviation history of the recent steps, i.e. where is the deviation of the measurement result at the th iteration (see formula (26) for specific calculation). The parameter is the state history length, and is recommended to be .

[0088] 2) Action space (Action Space): defined as where represents the weight adjustment amount at the th iteration. In this application, the action is not to directly set the new weight, but to adjust the current weight through dynamic inertia weight and policy gradient to realize smooth weight update.

[0089] 3) Policy function (Policy Function): where The policy parameter represents the state. Select action The probability distribution is obtained. In this invention, the strategy is implicitly implemented through dynamic inertia weight adjustment (Formula (29)-(30)) and PPO algorithm (Formula (33)-(36)), without the need to explicitly construct the probability distribution.

[0090] 4) Reward Function: Used to evaluate actions The advantages and disadvantages of the problem. The reward function designed in this invention is based on the degree of deviation improvement (formula (28)). When the deviation decreases, a positive reward is given, and when the deviation increases, a negative reward (penalty) is given.

[0091] 5) Value Function: ,in Discount factor (recommended value) ), indicating from state Start following the strategy The expected value of the cumulative rewards that can be obtained. Discount factor. It balances the importance of immediate rewards and long-term rewards.

[0092] The innovation of the RLAF mechanism lies in introducing the adaptive capability of reinforcement learning into the weight optimization process. Through in-task feedback loops (i.e., multiple iterative optimizations in a single evaluation task), the weights can dynamically adapt to the characteristics of the current evaluation object, rather than using fixed static weights.

[0093] (2) Discrete maximization and state evaluation; In each iteration ( ,in To determine the maximum number of iterations, it is recommended to take [value]. In this process, the first step is based on the current weight vector. Perform discrete maximization calculation. Discrete maximization refers to weighting the optimal membership degree of each class graph on various indicators to obtain a weighted decision matrix, which is used to evaluate the effect of the current weight configuration.

[0094] From the perspective of superior membership degree fuzzy matter element Extracting the numerical matrix from formula (20) Calculate the weighted decision matrix : Formula (25) will... Weight of each indicator With the The preferred membership degree of each category diagram on this indicator Multiplication, get weighted value Weighted decision matrix Reflects the weighted performance of each class diagram on each indicator under the current weight configuration.

[0095] To evaluate the rationality of the current weight configuration, the standard deviation of the weighted decision matrix is calculated as the measurement result deviation: Wherein, is the element of the matrix , and is the mean of the weighted decision matrix. Measure the dispersion degree of all elements in the weighted decision matrix.

[0096] The physical meaning of the deviation is: Reflects the uneven degree of the weighted performance of different class diagrams on different indicators under the current weight configuration. A larger indicates that the distribution of weighted data is relatively dispersed, and there may be some indicators or class diagrams with abnormally high or low weighted values, and the weight configuration is not balanced; a smaller indicates that the distribution of weighted data is relatively concentrated, and the weight configuration is relatively reasonable. The goal of the RLAF mechanism is to gradually reduce through iterative optimization, so that the weight configuration tends to be optimal.

[0097] Based on the recent deviation history, a state vector is constructed: Wherein, is the state history length (it is recommended to take ). For the initial iteration of , the insufficient history value is filled with , that is, , when . The state vector contains the deviation information of the recent steps, which provides the time context for subsequent reward calculation and policy update.

[0098] (3) Reward function design; The reward function is the core of reinforcement learning, which is used to guide the agent to learn in the desired direction. The reward function designed in the application is based on the deviation improvement degree, which measures the change of the deviation from iteration to iteration : Wherein, is a small constant to prevent the denominator from being zero. The design logic of formula (28) is: When the difference between the two , the difference between the two , indicating a decrease in the difference, a positive reward is given to encourage this direction of weight adjustment. When , the difference between the two , the difference between the two , indicating an increase in the difference, a negative reward (penalty) is given to discourage this direction of weight adjustment. When , the difference between the two , indicating no change in the difference, neither reward nor penalty is given. At the first iteration , since there is no previous iteration difference to compare, we set . The denominator serves a normalizing role, making the reward value size relatively independent of the absolute value of the difference, and more concerned with the relative improvement rate.

[0099] To enhance the stability and comparability of the reward signal, a normalized reward is adopted: where and are the mean and standard deviation of the recent reward history, respectively, defined as: where is the reward statistics window length (recommended to take ). For the initial iterations of , the statistics window is . The normalized reward has a zero mean and unit variance, which helps to stabilize the subsequent policy gradient calculation.

[0100] (4) Dynamic inertia weight adjustment strategy; Inspired by the Particle Swarm Optimization (PSO) algorithm, a dynamic inertia weight is introduced to balance global exploration and local exploitation. The inertia weight controls the degree of influence of historical weight information on the current weight update.

[0101] The dynamic inertia weight decreases linearly with the iteration number: where is the maximum inertia weight, is the minimum inertia weight, is the maximum iteration number (recommended to take ), is the current iteration number. Formula (31) ensures that decreases linearly from to i.e., gradually decreases from 0.9 to 0.4.

[0102] Mechanism of dynamic inertia weight: in the early iteration ( small), close to the global optimal solution, the inertia weight is large, which makes the weight update range large, and the algorithm focuses on global exploration to avoid premature convergence to local optimum; in the later iteration ( close to the global optimal solution), close to the global optimal solution, the inertia weight is small, which makes the weight update range small, and the algorithm focuses on local development to fine-tune the weight to approach the optimal solution.

[0103] Weight adjustment factor based on state error : where, is the learning rate (recommended to take ), is the hyperbolic tangent function, defined as , and its value range is . In formula (32), maps the deviation to the interval , then multiplies the learning rate and adds 1 to get the adjustment factor . When the deviation is large, slightly larger than 1, which moderately amplifies the weight; when the deviation is small, close to 1, the weight adjustment range is small.

[0104] First adjustment (adaptive adjustment) of weight vector: where, is a dimensional vector, all components are . denotes the Hadamard product (element-wise multiplication), i.e., the th component of .

[0105] Formula (33) combines dynamic inertia weight and state error adjustment factor to realize adaptive adjustment of weight. Since the adjusted weight may not satisfy the normalization constraint, normalization processing is needed: Formula (34) ensures that the normalized weight vector satisfies .

[0106] (5) Proximal Policy Optimization (PPO) algorithm; The PPO algorithm is an advanced policy gradient method proposed by Schulman et al. in 2017. PPO improves the stability of training by limiting the magnitude of policy updates, avoiding the performance collapse problem caused by excessive policy updates in traditional policy gradient methods. The present application uses the PPO algorithm for the second adjustment of the weights (policy optimization).

[0107] First, calculate the advantage function: where, is the average of recent step rewards (suggested to take ). For the initial iterations of , the statistical window is . The advantage function represents the advantage of the current reward relative to the average level . indicates that the current action is better than the average level and should be enhanced; indicates that the current action is worse than the average level and should be suppressed.

[0108] Calculate the policy gradient: where, is the gradient with respect to the weight vector. Formula (36) multiplies the advantage function (scalar) with the state vector (vector) to obtain the gradient vector. Since the dimension of the state vector is usually smaller than the dimension of the weight vector , dimension matching is needed. The specific method is: map the first components of the state vector to the first components of the gradient vector, and set the remaining components to 0 or fill them by interpolation. To simplify, the broadcast mechanism can be used: That is, the gradient of each weight component is the product of the advantage function and the current deviation. This design allows all weights to be adjusted in the same direction and magnitude, maintaining the relative relationship of the weight vector.

[0109] Second adjustment of the weight vector (PPO optimization): where, is the learning rate (suggested to take , which is consistent with the learning rate in formula (32)). Formula (38) updates the weights along the policy gradient direction, increases the weights when , and decreases the weights when .

[0110] To prevent the weights from being updated too large and causing instability, a Clip mechanism is used to limit the value range of the weights: where is the lower bound of the weights, is the upper bound of the weights, is the truncation function, which limits to the interval . Specifically, for each component ( ) of the weight vector, the following is performed: The Clip mechanism ensures that all weight components are not less than (avoiding some indicator weights being too small and being ignored) and not greater than (avoiding a single indicator weight being too large and dominating the evaluation result).

[0111] The normalization process is performed again on : to obtain the optimized weight vector for the next iteration, which satisfies and .

[0112] (6) Multi-dimensional convergence judgment mechanism; To ensure the effectiveness of the RLAF mechanism and the stability of the optimization process, a multi-dimensional convergence judgment criterion is designed. A single convergence condition (such as only judging whether the deviation is small enough) may lead to premature convergence or oscillation, and the multi-dimensional convergence judgment considers the deviation stability, reward stability, and weight change, providing a more reliable convergence judgment.

[0113] The following three convergence conditions are defined: Condition C1 (deviation threshold convergence): where is the deviation threshold, denotes the standard deviation. Formula (42) requires that the deviation fluctuation of the last 5 iterations is less than the threshold , i.e., the recent deviation tends to be stable. The specific calculation is: where is the deviation of the last 5 iterations.is the mean of the deviation of the last five iterations.

[0114] Condition C2 (reward stability convergence): where, is the reward fluctuation threshold, is the mean of the reward of the last ten iterations, is a small constant to prevent the denominator from being zero. Formula (44) indicates that the coefficient of variation (standard deviation to mean ratio) of the recent reward is less than 10%, i.e., the reward signal tends to be stable.

[0115] Condition C3 (weight change convergence): where, is the weight change threshold, denotes the norm (Euclidean distance), defined as Formula (45) requires that the weight vector changes less than the threshold in the last two iterations, i.e., the weight has tended to be stable.

[0116] Comprehensive convergence judgment: where, denotes the logical AND operation. Only when the three conditions are met simultaneously, it is considered that the algorithm has converged. When the algorithm converges or reaches the maximum number of iterations , the iteration is stopped, and the optimized weight vector is output.

[0117] Advantages of multi-dimensional convergence judgment: Condition C1 ensures the stability of the deviation, avoiding false convergence in the case of severe fluctuations in the deviation; Condition C2 ensures the stability of the reward signal, reflecting the tendency of the optimization process to be stable; Condition C3 ensures the stability of the weight itself, avoiding the oscillation of the weight around the optimal value; the logical AND operation of the three conditions provides a strict convergence judgment, ensuring the reliability of the optimization process.

[0118] (5) Software quality comprehensive evaluation based on the MARCOS method; The process of calculating the comprehensive evaluation value of each software class diagram using the MARCOS method includes: Using the optimized weight to weight the from-optimal membership matrix to obtain the weighted decision matrix; determining the ideal solution vector and the anti-ideal solution vector from the weighted decision matrix; based on the weighted decision matrix, the ideal solution vector and the anti-ideal solution vector, calculating the relevant parameters of each software class diagram and the ideal solution and the anti-ideal solution; based on the relevant parameters, calculating the comprehensive evaluation value of each software class diagram through weighted fusion.

[0119] Calculate the correlation parameters of each software class diagram with the ideal solution and the anti-ideal solution, including performing the following calculations for each software class diagram: Calculate the first Euclidean distance between its weighted vector in the weighted decision matrix and the ideal solution vector; calculate the second Euclidean distance between the weighted vector and the anti-ideal solution vector; calculate the sum of all weighted values in the weighted decision matrix as the weighted attribute sum; calculate the first utility degree based on the sum of the weighted attribute sum and the ideal solution vector; calculate the second utility degree based on the sum of the weighted attribute sum and the anti-ideal solution vector.

[0120] Based on the correlation parameters, calculate the comprehensive evaluation value of each software class diagram through weighted fusion, including: For each software class diagram, based on its first utility degree and second utility degree, calculate the first uncertainty weight and the second uncertainty weight through the binary entropy function; based on the first uncertainty weight, the second uncertainty weight, the first Euclidean distance, and the second Euclidean distance, perform weighted fusion to obtain the comprehensive evaluation value of the software class diagram.

[0121] The MARCOS (Measurement of Alternatives and Ranking according to COmpromise Solution) method is a new type of multi-criteria decision-making method. Compared with the traditional TOPSIS method (proposed by Hwang and Yoon in 1981), MARCOS provides more balanced and reliable evaluation results by considering the ideal solution (AI) and anti-ideal solution (AAI) simultaneously and introducing the concept of utility function. The innovation of the MARCOS method lies in the use of binary entropy function for uncertainty weighting fusion, which comprehensively considers the relative relationship between the alternative solution and the ideal solution and the anti-ideal solution.

[0122] (1) Construct the weighted decision matrix; The weight vector optimized based on the RLAF mechanism The superior membership fuzzy matter-element The numerical matrix extracted in formula (20) , construct the weighted decision matrix : Formula (47) multiplies the optimized weight and the superior membership to obtain the element of the weighted decision matrix. , represents the weighted score of the th class diagram on the th index.

[0123] (2) Determine the ideal solution and the antiideal solution; Define the ideal solution (Anti-Ideal, AI) vector. and the anti-ideal (AAI) vector In software quality metrics, since most indicators are inverse indicators (the smaller the better), after dimensionless processing using formula (18), The larger the value, the better the quality; therefore, the ideal solution is to take the maximum value of each indicator. The inverse ideal solution takes the minimum value of each index: Ideal solution The corresponding attributes reaching their best values ​​in each solution represent the optimal quality level; the inverse ideal solution The corresponding attributes are the worst values ​​among the various options, representing the worst quality level.

[0124] (3) Calculate the distances to the ideal solution and the antiideal solution; For the Class diagram ( ), calculate its Euclidean distances to the ideal solution and the antiideal solution: In formula (50), The first was measured Each class diagram and the ideal solution are in Euclidean distance in dimensional weighted space The smaller the value, the closer the image is to the ideal quality level. In formula (51), The first was measured The distance between each class graph and the anti-ideal solution. The larger the value, the further away the graph is from the worst quality level.

[0125] The geometric meaning of distance: in In the weighted decision space, the ideal solution and anti-ideal solution Two extremes of quality evaluation are defined. Each class diagram... Corresponding to a point The distance between this point and the ideal solution The distance between the sum and the antiideal solution Together, they determine its overall quality level.

[0126] (4) Calculate the utility and overall evaluation value; The core innovation of the MARCOS method is the introduction of the concept of utility function, which evaluates the alternatives by calculating the relative relationship between the alternatives and the ideal and anti-ideal solutions, rather than simply using the distance ratio.

[0127] First, calculate the weighted attribute sum of each class diagram: Calculate the weighted attribute sum of the ideal and anti-ideal solutions: Calculate the utility degree with the ideal solution : Formula (55) represents the ratio of the weighted attribute sum of the th class diagram to the weighted attribute sum of the ideal solution, the closer to 1 indicates that the class diagram is closer to the ideal quality level.

[0128] Calculate the utility degree with the anti-ideal solution : Formula (56) represents the ratio of the weighted attribute sum of the th class diagram to the weighted attribute sum of the anti-ideal solution, (because , the weighted sum of all class diagrams is not less than the anti-ideal solution), the larger indicates that the class diagram is further away from the worst quality level.

[0129] Combining the two utility degrees, the binary entropy function is used to calculate the comprehensive weight to realize the uncertainty weighted fusion. Calculate the uncertainty weight of : Calculate the uncertainty weight of : Formulas (57) and (58) are based on the definition of Shannon entropy, which is used to measure the uncertainty of the utility degree. and reflect the relative importance of the two utility degrees in comprehensive evaluation.

[0130] Normalize the weight: After normalization, .

[0131] Software quality comprehensive evaluation value Through uncertainty-weighted fusion calculation: The design logic of formula (60) is as follows: First item This reflects the degree of closeness to the ideal solution, where The distance to the normalized ideal solution (the smaller the value, the better), therefore we take... As a measure of proximity (the higher the value, the better); the second item This reflects the degree of deviation from the anti-ideal solution. The distance to the normalized anti-ideal solution (the larger the value, the better); two terms are weighted by uncertainty. and The weighted fusion comprehensively considers both the degree of closeness to the ideal solution and the degree of distance from the anti-ideal solution.

[0132] In formula (60), It should be noted that, according to the design of this invention, The closer the value is to 0, the less complex the evaluated object is and the closer it is to the optimal ideal level (the better the quality). The closer the value is to 1, the greater the complexity of the evaluated object and the closer it is to the worst level (the worse the quality). This is because this invention focuses on inverse indicators such as software complexity; lower complexity indicates better quality.

[0133] according to The size of the value pair By sorting the class diagrams, a comprehensive measurement and evaluation of software quality can be achieved. The sorting rules are as follows: The smaller the value, the higher the ranking, indicating better software quality.

[0134] (vi) Complete algorithm flow; The complete process of software quality measurement methods is as follows: Step 1: Data Acquisition and Preprocessing; Treatment of evaluation Quality features are extracted from each software class diagram to obtain the original feature vector set. ,in, Include Several quality evaluation indicators (such as the weighted number of methods in a class, the depth of the inheritance tree, the degree of coupling between classes, the degree of lack of cohesion within a class, the number of response sets, the number of attributes, the complexity of methods, etc.).

[0135] Step 2: Information geometry manifold modeling; Based on information geometry theory, the quality characteristics of software class graphs are mapped to statistical manifolds. superior: (2.1) Estimate the parameters of the multivariate Gaussian distribution for the training samples. Calculate the mean vector of the training set. and covariance matrix , parameter vector ; (2.2) Calculate Fisher information metric tensor according to formula (3) , determine the Riemannian metric structure of the manifold; (2.3) Set the dimension of the manifold , realize dimension reduction.

[0136] Step 3: Sparse representation and key feature extraction; Use sparse representation theory to extract key quality features: (3.1) Learn over-complete dictionary using K-SVD algorithm (where , redundancy is 2): (3.1.1) Initialize the dictionary as a random orthogonal matrix, and normalize the column vectors to unit vectors; (3.1.2) Sparse coding stage: for each training sample ( ), use LARS algorithm to solve formula (7) to get sparse coefficient , error tolerance is ; (3.1.3) Dictionary update stage: fix the sparse coefficient matrix , update the dictionary atom column by column. For the th dictionary atom, if the sample index set using this atom, calculate the residual matrix , extract the column corresponding to and perform SVD decomposition, and take the left singular vector corresponding to the largest singular value as the updated dictionary atom; (3.1.4) Repeat steps (3.1.2)-(3.1.3) until convergence (reconstruction error relative change is less than ) or reach the maximum iteration number ; (3.2) For each to-be-evaluated class diagram , use LARS algorithm to solve formula (7) to get sparse coefficient ; (3.3) Extract non-zero sparse coefficients . Learn the projection matrix (where is the average sparsity) by PCA: center all non-zero sparse coefficients of the training samples, calculate the covariance matrix and perform eigenvalue decomposition, select the eigenvectors corresponding to the first maximum eigenvalues to construct the projection matrix; (3.4) Calculate manifold coordinates according to formula (8) .

[0137] Step 4: Mapping of manifold coordinates to evaluation indices According to formula (9)-(14), map manifold coordinates to evaluation index values : (4.1) Calculate the mean value and standard deviation of each index from the training set (formula (10)); (4.2) Determine the mapping function (formula (11)-(12)): Calculate the Pearson correlation coefficient of each index with all manifold coordinate components, and select the dimension with the largest correlation; (4.3) If , calculate using formula (9); if , calculate by weighted average of multiple manifold coordinate components using formula (13)-(14); (4.4) Obtain the original data matrix .

[0138] Step 5: Construct composite fuzzy matter-element Construct -dimensional composite fuzzy matter-element of class diagrams according to formula (16), where is the th class diagram identifier, is the th quality evaluation index, and is the corresponding value.

[0139] Step 6: Dimensionless processing Perform dimensionless processing on the evaluation indices: (6.1) According to the index type (positive index or inverse index), calculate the superior membership degree using formula (17) or formula (18). For most inverse indices in software quality evaluation, use formula (18): where ; (6.2) Handle special cases: if , set (formula (19)); (6.3) Obtain the superior membership degree fuzzy matter-element (formula (20)).

[0140] Step 7: Calculate initial weights by entropy method Calculate initial weight vector by entropy method : (7.1) Standardize data according to formula (21): , get standardized matrix ; (7.2) Sort each row of matrix from large to small, get decision matrix ; (7.3) Calculate information entropy according to formula (22): ; (7.4) Calculate initial weights according to formula (23)-(24): , get initial weight vector .

[0141] Step 8: RLAF iterative optimization; Initialize RLAF mechanism parameters: maximum number of iterations , learning rate , discount factor , state history length , reward average window , reward statistics window , bias threshold , reward fluctuation threshold , weight change threshold , maximum inertia weight , minimum inertia weight , lower weight limit , upper weight limit , small constant .

[0142] Set initial weights .

[0143] Enter RLAF iterative optimization loop ( ): Step 8.1: Discrete maximization calculation; Extract numerical matrix from , calculate weighted decision matrix according to formula (25), where ( , ).

[0144] Step 8.2: State evaluation; Calculate metric result bias according to formula (26): , where . Update state vector according to formula (27): (For , the insufficient historical values are filled in).

[0145] Step 8.3: Reward calculation; The reward is calculated according to formula (28): The normalized reward is calculated according to formula (29)-(30): , , .

[0146] Step 8.4: Dynamic inertia weight adjustment; The dynamic inertia weight is calculated according to formula (31): The weight adjustment factor is calculated according to formula (32): .

[0147] Step 8.5: First weight adjustment (adaptive adjustment); According to formula (33): , where is a dimensional vector. Normalize according to formula (34): .

[0148] Step 8.6: Advantage function and policy gradient calculation; The advantage function is calculated according to formula (35): , where The policy gradient is calculated according to formula (36)-(37): ( ), resulting in , where is a dimensional all-1 vector.

[0149] Step 8.7: Second weight adjustment (PPO optimization); According to formula (38): Apply the Clip mechanism according to formula (39)-(40): for each component ( ), perform to ensure . Normalize according to formula (41): , resulting in the weight vector for the next iteration.

[0150] Step 8.8: Convergence judgment; According to formula (42)-(43), judge condition C1 (deviation threshold convergence): if , calculate (where ), if the value is less than​ then is true, otherwise false; if then is false.

[0151] Judge condition C2 (reward stability convergence) according to formula (44): if , calculate and , if then is true, otherwise false; if then is false.

[0152] Judge condition C3 (weight change convergence) according to formula (45): calculate , if the value is less than then is true, otherwise false.

[0153] Judge the comprehensive convergence condition according to formula (46): (logical and operation). If is true, output the optimized weight and jump out of the loop; otherwise, let , if then return to step 8.1, otherwise output and end the iteration.

[0154] Step 9: MARCOS comprehensive evaluation; Use the MARCOS method to conduct software quality comprehensive evaluation: (9.1) Construct the weighted decision matrix according to formula (47) , where ( , ); (9.2) Determine the ideal solution and the anti-ideal solution according to formulas (48)-(49), where ; (9.3) Calculate the Euclidean distance between each type of graph and the ideal solution and the anti-ideal solution according to formulas (50)-(51): ( ); (9.4) Calculate the weighted attribute sum according to formulas (52)-(54): ( ), ; (9.5) Calculate the utility degree according to formulas (55)-(56): ( ); (9.6) Calculate the uncertainty weight according to formula (57)-(59): ( ); (9.7) Calculate the software quality comprehensive evaluation value according to formula (60): ( )。

[0155] Step 10: result output and sorting; According to value, the ascending order is sorted class diagram The smaller the value, the lower the complexity and the better the quality, the higher the ranking. Output the software quality measurement results and the sorting list. For each class diagram , output its comprehensive evaluation value , ranking, weighted score of each indicator and the optimized weight vector , providing decision support for software quality improvement.

[0156] The present application starts from information geometry and sparse representation theory, combines fuzzy matter element analysis method, innovatively introduces adaptive feedback optimization mechanism (RLAF) based on reinforcement learning, and uses the latest MARCOS method instead of traditional TOPSIS method, to build a software quality dynamic measurement model integrating multiple advanced technologies. The model describes the geometric structure of quality characteristics on Riemannian manifold through Fisher information metric tensor, extracts key features and realizes dimension reduction using sparse representation technology, uses fuzzy matter element theory to handle the fuzziness and incompatibility of evaluation indicators, realizes task-internal iterative optimization of weights through dynamic inertia weight adjustment in RLAF mechanism and PPO algorithm, and finally uses MARCOS method combined with binary entropy function to realize uncertainty weighted fusion to obtain the comprehensive evaluation value. The model can not only handle the situation of fuzzy or missing number of evaluation indicators, but also ensure the stability of the optimization process through multi-dimensional convergence judgment, and finally evaluate the complexity of UML class diagram with only one comprehensive complexity, truly predicting the quality of software.

[0157] The above is only the preferred specific embodiment of the present application, but the protection scope of the present application is not limited thereto, any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A software quality self-adaptive measurement method based on information geometry and reinforcement learning, characterized in that, The method comprises the following steps: obtaining original quality characteristic data of a plurality of software class diagrams; extracting low-dimensional manifold coordinates of each software class diagram based on the original quality characteristic data through information geometry mapping and sparse representation; reconstructing the values of each software class diagram on each quality evaluation index based on the low-dimensional manifold coordinates, and constructing a composite fuzzy matter element based on the values of all software class diagrams; performing dimensionless processing on the composite fuzzy matter element to obtain a suboptimal membership matrix; calculating initial weights of each evaluation index through an entropy weight method based on the reconstructed values; starting from the initial weights, performing multi-round iteration optimization through a reinforcement learning adaptive feedback mechanism to obtain optimized weights; calculating a comprehensive evaluation value of each software class diagram based on the optimized weights and the suboptimal membership matrix by using a MARCOS method; outputting a software quality measurement result according to the comprehensive evaluation value.

2. The software quality adaptive measurement method based on information geometry and reinforcement learning according to claim 1, wherein the process of extracting low-dimensional manifold coordinates of each software class diagram based on the original quality characteristic data through information geometry mapping and sparse representation comprises: mapping the original quality characteristic data to a statistical manifold composed of a probability distribution family, calculating a Fisher information metric tensor based on the statistical manifold to establish a Riemannian geometry structure; on the Riemannian manifold space, constructing an over-complete dictionary by using a K-SVD dictionary learning algorithm, and solving sparse representation coefficients of each software class diagram by using a LARS algorithm; extracting non-zero elements from the sparse representation coefficients, learning a projection matrix through principal component analysis, and mapping the non-zero sparse coefficients to a low-dimensional space by using the projection matrix to obtain the low-dimensional manifold coordinates.

3. The software quality adaptive measurement method based on information geometry and reinforcement learning according to claim 1, wherein the process of reconstructing the values of each software class diagram on each quality evaluation index based on the low-dimensional manifold coordinates, and constructing a composite fuzzy matter element based on the values of all software class diagrams comprises: establishing a mapping relationship from manifold coordinates to evaluation index values based on statistical characteristics of each evaluation index in a training set, determining a corresponding relationship between each evaluation index and a manifold coordinate component based on the mapping relationship through correlation analysis, reconstructing the low-dimensional manifold coordinates of each software class diagram into values on each evaluation index based on the corresponding relationship, and constructing a composite fuzzy matter element based on the reconstructed evaluation index values.

4. The software quality adaptive measurement method based on information geometry and reinforcement learning according to claim 1, wherein the process of performing dimensionless processing on the composite fuzzy matter element to obtain a suboptimal membership matrix comprises: ​ ​ ​ The characteristic values in the composite fuzzy matter element are dimensionless; wherein, the superior membership degree of the inverse index is obtained by calculating the ratio of the difference between the maximum value of the index and the current value to the difference between the maximum value and the minimum value of the index, the superior membership degree of the positive index is obtained by calculating the ratio of the difference between the minimum value of the index and the current value to the difference between the maximum value and the minimum value of the index, and the corresponding superior membership degree is set to a predetermined value when the maximum value of the index is equal to the minimum value; a superior membership degree matrix is constructed based on all the superior membership degrees. 5.The software quality adaptive measurement method based on information geometry and reinforcement learning according to claim 1, wherein, The process of calculating the initial weight of each evaluation index by the entropy weight method based on the obtained values after reconstruction comprises: The process of calculating the initial weight of each evaluation index by the entropy weight method based on the obtained values after reconstruction comprises: 6.The software quality adaptive measurement method based on information geometry and reinforcement learning according to claim 1, wherein, The process of obtaining the optimized weight through the multi-round iteration optimization of the adaptive feedback mechanism of reinforcement learning comprises the following iteration process: calculating a weighted decision matrix based on the current weight vector and the superior membership degree matrix; calculating a measurement result deviation based on the weighted decision matrix; constructing a state vector based on the measurement result deviation; calculating a reward signal based on the measurement result deviation of the adjacent iteration; performing a first adjustment on the current weight vector based on a dynamic inertia weight strategy; performing a second adjustment on the weight vector after the first adjustment based on a proximal policy optimization algorithm; determining whether to output the optimized weight vector through a multi-dimensional convergence judgment mechanism. 7.The software quality adaptive measurement method based on information geometry and reinforcement learning according to claim 6, wherein, The multi-dimensional convergence judgment mechanism comprises: judging whether the standard deviation of the measurement result deviation of the continuous multiple iterations is less than a first threshold value; judging whether the ratio of the standard deviation to the mean of the reward signal of the continuous multiple iterations is less than a second threshold value; judging whether the Euclidean distance of the weight vectors of the adjacent two iterations is less than a third threshold value; when all the judgment conditions are met at the same time, outputting the current weight vector as the optimized weight vector. 8.The software quality adaptive measurement method based on information geometry and reinforcement learning according to claim 1, wherein, The process of calculating the comprehensive evaluation value of each software class diagram using the MARCOS method comprises: weighting the superior membership degree matrix using the optimized weight to obtain a weighted decision matrix; determining an ideal solution vector and an anti-ideal solution vector from the weighted decision matrix; calculating the relevant parameters of each software class diagram and the ideal solution and the anti-ideal solution based on the weighted decision matrix, the ideal solution vector and the anti-ideal solution vector; and calculating the comprehensive evaluation value of each software class diagram by weighted fusion based on the relevant parameters. 9.The information geometry and reinforcement learning based software quality adaptive metric method of claim 8, wherein, computing correlation parameters of each software class diagram with the ideal solution and the anti-ideal solution, including performing the following calculations for each software class diagram: computing a first Euclidean distance between its weighted vector in the weighted decision matrix and the ideal solution vector; computing a second Euclidean distance between the weighted vector and the anti-ideal solution vector; computing a sum of all weighted values in the weighted decision matrix as a weighted attribute sum; computing a first utility degree based on a sum of the weighted attribute sum and the ideal solution vector; computing a second utility degree based on a sum of the weighted attribute sum and the anti-ideal solution vector. 10.The method of claim 9, wherein, computing a comprehensive evaluation value of each software class diagram by weighted fusion based on the correlation parameters, including: for each software class diagram, computing a first uncertainty weight and a second uncertainty weight by a binary entropy function based on its first utility degree and second utility degree; computing a comprehensive evaluation value of the software class diagram by weighted fusion based on the first uncertainty weight, the second uncertainty weight, the first Euclidean distance and the second Euclidean distance.

Citation Information

Patent Citations

  • Directed weighted network-based software security quantitative assessment method

    CN108549816A

  • Quantitative method and system of software quality

    CN109032926A

  • Software quality evaluation method, device, apparatus, and readable storage medium

    CN109117380A

  • Software quality evaluation method

    CN110196814A

  • Software quality prediction method

    CN112463643A