International Journal of Digital Multimedia Broadcasting

Volume 2018, Article ID 7624768, 9 pages

https://doi.org/10.1155/2018/7624768

## A Novel Method of Complexity Metric for Object-Oriented Software

School of Information Management, Jiangxi University of Finance and Economics, Nanchang 330013, China

Correspondence should be addressed to Tong Yi; moc.qq@8612477331

Received 8 September 2018; Accepted 16 October 2018; Published 1 November 2018

Guest Editor: Yuanlong Cao

Copyright © 2018 Tong Yi and Chun Fang. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

With the rapid development and wide application of multimedia technology, the demand for the actual development of multimedia software in many industries is increasing. How to measure and improve the quality of multimedia software is an important problem to be solved urgently. In order to calculate the complicated situation and fuzziness of software quality, this paper introduced a software quality evaluation model based on the fuzzy matter element by using a method known as the fuzzy matter element analysis, combined with the TOPSIS method and the close degree. Compared with the existing typical software measurement methods, the results are basically consistent with the typical software measurement results. Then, Pearson simple correlation coefficient was used to analyse the correlation between the existing four measurement methods and the metric of practical experience, whose results show that the results of software quality measures based on fuzzy matter element are more in accordance with practical experience. Meanwhile, the results of this method are much more precise than the results of the other measurement methods.

#### 1. Introduction

At present, with the rise and application of multimedia technology, it is a great challenge to provide more reliable technical support and strong technical support for the development of multimedia software. At the same time, object-oriented technology has become the mainstream of current software development, which is suitable for developing multimedia software, for example, using the image processing software Adobe Photoshop developed by C++, using Action Script to develop animation processing software Flash, and using C++ for the Jedi survival and heroic alliance games.

We must point out that multimedia software is a typical complex system; therefore, how to scientifically measure the complexity of multimedia software plays a vital role in developing high-quality multimedia software. Software metrics has become the important and long-term focused research field of software engineering and also became an important and effective method in assessing and predicting software development activities. The purpose of software metrics research is to provide guidance for developing high-quality software [1].

Since the concept of software measurement was first proposed by Rubey R. J. and Hartwick R. D. in 1968[2], the researches, development, and applications have been carried out for more than fifty years. Through literature review, this paper found that previous researches mainly from internal attributes, external attributes, and other aspects of the research of software quality metric. Over these years, many scholars have made a broad and deep research on the software quality metric and prefer to find the key or the important software quality measurement factors from the inner elements of software itself. The factors were measured or counted directly or indirectly to construct the corresponding metric model. Early metrics on structured programs were primarily focused on Lines of Code (LOC) [3], McCabe coloring graph method [4], Function Point Analysis (FPA) [5], etc.

In 1994, Chidamber S. and Kemerer C. proposed a CK metrics set for object-oriented software quality metrics research. The Weighted Methods per Class (WMC), Number of Children (NOC), Depth of Inheritance (DIT), Coupling Between Objects (CBO), Lack of Cohesion (LCOM), and Response for a Class (RFC) are included in set, which are the fundamental of object-oriented software quality metrics. Padhy N. et al. proposed the three metrics based on CK metrics set and combined WMC, RFC, CBO, DIT. and NOC together [6]. In addition, Misra S. and Adewumi A. et al. proposed a cognitive complexity metrics set for evaluating object-oriented software projects [7], including method complexity, message complexity, attribute complexity, weighted class complexity, and code complexity. According to software measurement experience, Gupta D. L. et al. proposed some possible exist the hypothetical situation in measurement validation and design 14 measurement elements, including WMC, CBO, and RFC. Furthermore, Gupta D. L. et al. took open source software code as the data source and used SPSS software make logistic regression analysis. The results of the study showed that these methods can predict design flaw of class in software quality metric, and software defects prediction methods based on object-oriented metrics are developed [8]. Wang J. and Wang Q. found that dependency relationship is an important reason of software complexity. The dependency relationship can reflect cohesion and coupling between software elements. Meanwhile, cohesion and coupling are recognized as a measure of software quality of the important indicators. Besides, the dependency relationship of software is proved to be an important factor of software defects prediction through the experimental study. It can predict software integration errors and provide help for software quality metric in early stage [9]. The above methods of object-oriented software metrics are all belong to research of software quality metric based on software internal attributes.

However, developers and researchers paid attention to broad software quality characteristics in the process of software quality metric research based on external attributes of software quality. These characteristics include software quality characteristics of ISO/IEC 25010 software quality model in narrow sense and other software quality characteristics associated with software development and application. Gosain A. and Sharma G. defined the dynamic software quality characteristics, including robust, unambiguous, dynamic, discriminating, and machine independent. Then they evaluated cases with Java software and found that the dynamic software quality characteristic has significant positive correlation with maintainability by Pearson correlation analysis and principal component analysis [10]. Similarly, Hu X and Zuo J. et al. choose 6 software quality characteristics from GB/T16260 series of standards. The 6 software quality characteristics include capability, reliability, usability, efficiency, maintainability, and portability. Then the hierarchical model of evaluation is established for research and analysis external attributes of software quality [11].

Class diagram, a very important software model diagram, describes the classes and their relationships among the systems. They can be scientifically constructed whether or not it has a significant impact on the complexity of software. At present, the class complexity measure method is still rare. Marchesi M. [12] uses 7 indicators to measure the complexity of the class diagram from different angles. However, the method only considers the relationship between classes and inheritance, without considering other relationships, such as the association relationship and aggregation relationship. On the basis of Marchesi M. research, Genero M. [13] uses 14 indicators to further distinguish the relationship between classes and classes, that is, the combination of relative complexity measure and absolute complexity measure. The theories of Dr. Zhang Y. [14], In P. [15], Gosain A. [10], Gupta D. L. [8], and Padhy N. [6] are similar with Genero M’s, which use a set of indicators to evaluate the complexity of class diagrams. The advantage of it could analyse the complexity of a class diagram from different perspectives, but its disadvantage is that it is difficult to compare two or two class diagrams. Dr. Zhou Y. transforms UML class diagrams into weighted dependencies. And then he uses the information entropy to define the complexity of UML class diagram [16], which has achieved good measure results. Dr. Yi T. has made improvements on the basis of Dr. Zhou Y. making a comprehensive consideration of interclass relationships, class attributes, and class complexity of the method. He proposed a UML class diagram complexity measurement method based on dependency analysis [17, 18].

In this paper, the research work mentioned above is a part of existing domestic and international research work, but there is no doubt that the results of researches in the UML class diagram model are not enough. One of the important reasons is that UML standard issued by the object management group (OMG) only gives the description of the semantic conceptual level in various modelling elements, which leads to the fact that the researchers often use different weighting indicators for the class diagram model. It means that researchers do not have a uniform standard, resulting in different metrics for the same class diagram. Meanwhile, because of the comprehensiveness, fuzziness, and complexity of the software quality measurement system, the software quality measurement is a process of multiple indicator decision making; the fuzzy matter element theory is introduced in this paper. In order to overcome the limitation of weight precision of the class relationship between two classes in the literature [16–18], this paper proceeds from fuzzy matter element theory, introducing the concept of close degree, and used entropy method to calculate the weight of every indicator; software quality measurement model was established in fuzzy matter element that based on entropy weight and TOPSIS method applied to UML class diagram metric. Firstly, element indicators of UML class diagram constitute the compound fuzzy matrix of matter elements and then fuzzy matrix of matter elements of the optimal subordinate degree obtained with the dimensionless, calculating the weight of each element indicators by entropy method, finally, through TOPSIS method and the concept of Euclid approach degree got comprehensive attribute values of each UML class diagrams. This paper hopes to only use a comprehensive complexity value to evaluate the complexity of UML class diagram and enough really predicts the complexity of software quality.

#### 2. A Novel Method of Complexity Metric for Software Quality

##### 2.1. Building Evaluate Compound Fuzzy Matter Element of Software Quality

Matter element analysis [19] is a new discipline that studies laws and methods for solving incompatible problems. It is an intersecting edge discipline of thinking science, systems science, and mathematics. Matter element analysis itself is not a branch of mathematics. It is a new discipline that develops on the basis of classical mathematics and fuzzy mathematics and is different from them. The new subject, Matter Element Analysis, which was created in 1994 by Chinese scholar Cai Wen, was specifically designed to solve incompatible problems. The fuzzy matter element combines fuzzy set theory and matter element analysis theory, which can not only solve the ambiguity of measurement indicators, but also solve the incompatibility of measurement results. Because of its simple calculation method, reliable evaluation results, and strong practicality, this theory is widely used in logistics science and technology [20], electromechanical [21], architecture [22], and other fields.

The matter element for evaluating the software quality was constructed in this paper, where denotes the software class diagram to be evaluated,* C* denotes the evaluation indicator, and denotes the corresponding magnitude of the evaluation indicator. If* X* has ambiguity, is called a fuzzy matter element. If* T* has* n* evaluation indicators whose corresponding magnitudes are ,* R* is said to be* n*-dimensional fuzzy matter elements[23]. The -dimensional matter elements of m the software diagrams to be evaluated are combined to form the -dimensional compound fuzzy matter elements of m the software diagram to be evaluated. is defined as follows:

In formula (1), represents the* i* (*i*=1,2,...* m*) software class diagram, is the* j *(*j*=1,2,...,*n*) evaluation indicator of the software class diagram, and represents the corresponding magnitude of the j evaluation indicator of the i software class diagram.

##### 2.2. Dimensionless of Evaluation Indicators

In the evaluation of software class diagrams, there are many evaluation indicators involved. If there are no uniform metrics among the indicators, the evaluation process will be difficult to carry out. In order to compare the different dimension indicators together for comparison, the magnitude of these evaluation indicators must be dimensionless [23]. The dimensionless process is to remove the dimension's influence on the physical value through mathematical methods. There are generally two types of indicators for quantification processing results, some of which are larger and better indicators, that is, positive indicators; others are smaller, better indicators, that is, negative indicators. According to the actual situation, this paper selects the smaller and better indicators in the software quality evaluation.

In formula (4),* u*_{ij} is the dimensionless result of the* j*-th evaluation indicator of the* i*-th software class diagram. max_{j} is the maximum value of the* j*-th evaluation indicator of the software class diagram, and min_{j} is the minimum value of the* j*-th evaluation indicator of the software class diagram.

After the dimensionless treatment of formula (1) through formula (4), formula (5) is obtained, that is, the fuzzy matter element weight matrix of optimal membership degree .

##### 2.3. Evaluation Indicator Weight Determining Based on Entropy Method

In the process of software quality evaluation, the weight of an indicator reflects the relative importance of the indicator in the overall evaluation process. Therefore, the determination of weight is very important. Common weight determination methods include entropy method, expert scoring method, and analytic hierarchy process. This paper uses entropy method to calculate weights to achieve the subjective and objective unity of weights. The entropy method is based on the difference in the degree of information contained in each indicator, that is, the utility value of the information to determine the weight of the indicator. It is an objective weighting method.

The formula for calculating the information entropy and weight function in the comprehensive evaluation is as follows: For the software quality evaluation model in question, if there are initial data matrix of the n evaluation indicators of the m software class diagram to be evaluated, each indicator is significantly different in the dimension, order of magnitude, and merits of indicators. Therefore, the initial data must be standardized:

Get information entropy of the j-th evaluation indicator according to formula (7):

The constant k in formula (7) is related to the number of samples, m, and is often taken. Because of information entropy can be used to measure the information utility value of the* j*-th evaluation indicator. When the sample is completely disordered, =1; meanwhile, the information value of is zero for the utility value of the comprehensive evaluation. Therefore, the information utility value of an evaluation indicator is determined by the difference between 1 and the information entropy of the evaluation indicator; that is,

The entropy method is used to estimate the weight of the evaluation indicator. Its essence is to use the information utility value of the evaluation indicator to measure. When the difference* h*_{j} is higher, the importance of the evaluation is bigger, so the weight of the* j*-th evaluation indicator is

Fuzzy matter element weight matrix of optimal membership degree is

##### 2.4. Fuzzy Compound Matter Element for Evaluating the Quality Characteristics

is a weighted fuzzy compound matter element for evaluating the quality characteristics, and then there are

In formula (11), the calculation value of the* j*-th evaluation indicator of the* i*-th software class diagram is represented.

##### 2.5. Calculating Comprehensive Evaluation of Software Quality

TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) [24] is a multiobjective decision-making method. The basic idea is to define the ideal solution and negative ideal solution of the decision problem. It is assumed that the ideal solution is the optimal program and the negative ideal solution is the worst program. If there is an evaluation plan in the feasible evaluation plan, the evaluation plan is the closest to the ideal, while far away from the negative ideal solution, we call this program the optimal program.

Further determine the ideal solution vector and negative ideal solution vector of matrix :

There are several ways to calculate the distance between ideal solutions and negative ideal solutions, such as Euclidean distance, Manhattan distance, Chebyshev distance, and so on. Among them, Euclidean distance is an easy-to-understand distance calculation method, which is derived from the distance formula between two points in Euclidean geometry. In this paper, the Euclidean distance is used, and its calculation formula is as follows [23]:

In formula (14) and formula (15), ; is the* i*-th column vector of matrix *.*

In this paper, the comprehensive evaluation of software quality adopts entropy method for consideration. The source has and . The binary entropy function can be used to calculate the weights of the Euclidean distance between each class diagram to be evaluated and the ideal solution.

Similarly, the binary entropy function is used to calculate the weights of the Euclidean distances of each class diagram to be evaluated and the negative ideal solution; namely,

According to the concept of close degree [23], combined with the uncertainty of the ideal solution and the negative ideal solution, the fuzzy matter element software quality metric measures the software quality by the following uncertainty-weighted fusion method. The calculation formula is as follows:

In formula (18), the value is between 0 and 1. The closer the value is to 0, the evaluation object complexity is smaller and the closer to the optimal ideal level.

#### 3. Case Analysis

##### 3.1. Data Sources

In order to validate the measurement method proposed in this paper, we will do an experiment to estimate the metric values. With the permission of Genero M., we selected twenty-six UML class diagrams [13] related to the bank information systems as the object of the experiment. For better representation, NDep represents dependency, NAssoc represents normal association, NAgg represents aggregation, NGen represents generalization, NM represents class method, NA represents class attribute, and NC represents the number of classes. For specific indicators and data for details, see Table 1.