Application of a Fuzzy Inference System to Measure Maintainability of Object-Oriented Software

Similar documents
Reusability Metrics for Object-Oriented System: An Alternative Approach

Application of Object Oriented Metrics to Java and C Sharp: Comparative Study

Technical Metrics for OO Systems

FUZZY LOGIC TECHNIQUES. on random processes. In such situations, fuzzy logic exhibits immense potential for

Effects of Dependency Injection on Maintainability. Kate Razina

Investigation of Metrics for Object-Oriented Design Logical Stability

Object Oriented Measurement

Class Break Point Determination Using CK Metrics Thresholds

Towards Cohesion-based Metrics as Early Quality Indicators of Faulty Classes and Components

Metrics and OO. SE 3S03 - Tutorial 12. Alicia Marinache. Week of Apr 04, Department of Computer Science McMaster University

Evaluation of a Business Application Framework Using Complexity and Functionality Metrics

SNS College of Technology, Coimbatore, India

CHAPTER 4 HEURISTICS BASED ON OBJECT ORIENTED METRICS

International Journal of Software and Web Sciences (IJSWS)

Risk-based Object Oriented Testing

Empirical Evaluation and Critical Review of Complexity Metrics for Software Components

Analysis of Various Software Metrics Used To Detect Bad Smells

Research Article ISSN:

A Study of Software Metrics

Analysis of Reusability of Object-Oriented System using CK Metrics

HOW AND WHEN TO FLATTEN JAVA CLASSES?

REAL-TIME SCHEDULING OF SOFT PERIODIC TASKS ON MULTIPROCESSOR SYSTEMS: A FUZZY MODEL

Quality Metrics Tool for Object Oriented Programming

A Comparative Study on State Programming: Hierarchical State Machine (HSM) Pattern and State Pattern

Measuring the quality of UML Designs

How to Realization Architectural testing model using Measurement Metrics

1 Introduction. Abstract

Procedia Computer Science

CHAPTER 5 FUZZY LOGIC CONTROL

Using Metrics To Manage Software Risks. 1. Introduction 2. Software Metrics 3. Case Study: Measuring Maintainability 4. Metrics and Quality

Effective Modular Design

ISSN: [Gupta* et al., 6(5): May, 2017] Impact Factor: 4.116

CHAPTER 3 FUZZY RULE BASED MODEL FOR FAULT DIAGNOSIS

Effectiveness of software metrics for object-oriented system

ICAD A USE CASE BASED OBJECT-ORIENTED SOFTWARE DESIGN APPROACH USING THE AXIOMATIC DESIGN THEORY

Metrics in assessing the quality and evolution of jedit

Mixing SNA and Classical Software Metrics for Sub-Projects Analysis.

CHAPTER 6 SOLUTION TO NETWORK TRAFFIC PROBLEM IN MIGRATING PARALLEL CRAWLERS USING FUZZY LOGIC

Efficacious approach for satellite image classification

Software Design & Evolution. Lecture 04. You cannot control what you cannot measure. Metrics & Problem Detection. Michele Lanza

Chapter 4 Fuzzy Logic

CHAPTER 4 FUZZY LOGIC, K-MEANS, FUZZY C-MEANS AND BAYESIAN METHODS

J2EE Development Best Practices: Improving Code Quality

MODELING FOR RESIDUAL STRESS, SURFACE ROUGHNESS AND TOOL WEAR USING AN ADAPTIVE NEURO FUZZY INFERENCE SYSTEM

International Journal of Advanced Research in Computer Science and Software Engineering

ARTIFICIAL INTELLIGENCE. Uncertainty: fuzzy systems

Introduction 3 Fuzzy Inference. Aleksandar Rakić Contents

Taxonomy Dimensions of Complexity Metrics

2IS55 Software Evolution. Software metrics (3) Alexander Serebrenik

Object Oriented Metrics. Impact on Software Quality

Figure 2-1: Membership Functions for the Set of All Numbers (N = Negative, P = Positive, L = Large, M = Medium, S = Small)

FUZZY INFERENCE SYSTEMS

Combination of fuzzy sets with the Object Constraint Language (OCL)

European Journal of Science and Engineering Vol. 1, Issue 1, 2013 ADAPTIVE NEURO-FUZZY INFERENCE SYSTEM IDENTIFICATION OF AN INDUCTION MOTOR

Analysis of Object Oriented Metrics on a Java Application

SOFTWARE ASSESSMENT USING OBJECT METRICS

A Hierarchical Model for Object- Oriented Design Quality Assessment

fuzzylite a fuzzy logic control library in C++

A Complete and Comprehensive Metrics Suite for Object-Oriented Design Quality Assessment

Lecture notes. Com Page 1

CHAPTER 4 FREQUENCY STABILIZATION USING FUZZY LOGIC CONTROLLER

Towards the re-usability of software metric definitions at the meta level

Quantify the project. Better Estimates. Resolve Software crises

Influence of Design Patterns Application on Quality of IT Solutions

Moonzoo Kim CS Division of EECS Dept.

Utilizing Computational Intelligence to Assist in Software Release Decision

CHAPTER 3 ROLE OF OBJECT-ORIENTED METRICS IN SOFTWARE MEASUREMENT

EasyChair Preprint. Software Metrics Proposal for Conformity Checking of Class Diagram to SOLID Design Principles

EVALUATING IMPACT OF INHERITANCE ON OBJECT ORIENTED SOFTWARE METRICS

Introduction to Fuzzy Logic and Fuzzy Systems Adel Nadjaran Toosi

Prediction of Software Readiness Using Neural Network

ARTIFICIAL INTELLIGENCE - FUZZY LOGIC SYSTEMS

PREDICTION OF SOFTWARE DEFECTS USING OBJECT-ORIENTED METRICS

Enhancing Object Oriented Coupling Metrics w.r.t. Connectivity Patterns

Principal Component Analysis of Lack of Cohesion in Methods (LCOM) metrics

Fuzzy Reasoning. Outline

Why Fuzzy Fuzzy Logic and Sets Fuzzy Reasoning. DKS - Module 7. Why fuzzy thinking?

An Object-Oriented Metrics Suite for Ada 95

RULE BASED SIGNATURE VERIFICATION AND FORGERY DETECTION

On the Applicability of Predictive Maintainability Models onto dynamic Languages

Software Testing: A Craftsman s Approach, 4 th Edition. Chapter 16 Software Complexity

Various Strategies of Load Balancing Techniques and Challenges in Distributed Systems

ISSN: ISO 9001:2008 Certified International Journal of Engineering and Innovative Technology (IJEIT) Volume 3, Issue 11, May 2014

7. Decision Making

Using Fuzzy Logic to Improve Cache Replacement Decisions

Fuzzy time series forecasting of wheat production

CHAPTER 3 MAINTENANCE STRATEGY SELECTION USING AHP AND FAHP

Class Inheritance Metrics-An Analytical and Empirical Approach

Analysis of Cohesion and Coupling Metrics for Object Oriented System

Using Fuzzy Threshold Values for Predicting Class Libraries Interface Evolution

An Empirical and Analytical View of New Inheritance Metric for Object-Oriented Design

An Empirical Study to Redefine the Relationship between Software Design Metrics and Maintainability in High Data Intensive Applications

Final Exam. Controller, F. Expert Sys.., Solving F. Ineq.} {Hopefield, SVM, Comptetive Learning,

CLASSIFYING SOFTWARE FAULTS THROUGH BOOLEAN CLASSIFICATION MODEL BASED ON DISCRETIZED DEFECT DATASETS

Types of Expert System: Comparative Study

CHAPTER 4 QUANTIFICATION AND EVALUATION OF INTERFACE COMPLEXITY IN COTS BASED SYSTEMS

Fuzzy Expert Systems Lecture 8 (Fuzzy Systems)

Effect of Principle Component Analysis and Support Vector Machine in Software Fault Prediction

Object Oriented Design Metrics for Predicting Fault Proneness using Naïve Bayes and Random Forest

Lecture 5 Fuzzy expert systems: Fuzzy inference Mamdani fuzzy inference Sugeno fuzzy inference Case study Summary

Transcription:

Application of a Fuzzy Inference System to Measure Maintainability of Object-Oriented Software Nasib Singh Gill and Meenakshi Sharma Department of Computer Science & Applications Maharshi Dayanand University, Rohtak-124001 Haryana, India Abstract - In the software development life cycle, maintenance is the most costly activity because it requires more effort compared to other activities. To reduce the cost of software maintenance, it is essential to predict software maintainability during the early phases of software development. As a consequence of early estimation, further corrective and preventive actions can be performed more efficiently to improve the maintainability of the software. Predicting maintainability of software using fuzzy logic is gaining more attention among researchers due to its ability to deal with uncertain, imprecise and incomplete data. This paper develops a fuzzy logic-based model for predicting the maintainability of a class. The given model is based on the Mamdani s fuzzy inference system. Chidamber and Kemerer metrics are used as inputs to the model and the maintainability is computed as output. Maintainability can be used as an indicator of the quality of software at design time. Keywords: Maintainability, Metric, Fuzzy Inference Engine 1. Introduction Software maintenance in software engineering is the modification of a software product after delivery to correct and to improve performance or other attributes [1]. Software maintenance is the most important activity in the life of a software product. The total cost of the maintenance phase is much higher than the development cost of the software. It can consume 40% to 90% of the cost of the entire life cycle [2,3]. There are four types of software maintenance: Corrective, Adaptive, Preventive and Perfective. Software maintainability is the ease with which a software system can be understood, modified and adapted [4]. It is an important software quality attribute. Software maintenance is a post-development activity, but it is highly influenced by the way the software was developed. The object-oriented software development approach has the ability to produce highly maintainable software. The maintainability of a software system can significantly impact software costs. For effective management of software cost, software maintainability must be evaluated. Many metrics have been proposed by various researchers to evaluate the maintainability of software. Among these metrics, the Chidamber and Kemerer (CK) metrics suite [5] is the most widely used metric suite for assessing the maintainability of object-oriented software. Software maintainability is a difficult factor to quantify [6]. In object-oriented software, the maintainability of a class can be assessed in terms of its complexity using design-oriented metrics. However predicting the maintainability of a class using crisp logic is not appropriate in the presence of fuzzy input factors. Therefore, the fuzzy logicbased approach of measuring maintainability is being used by many researchers. Fuzzy logic is a generalization of classical boolean logic. It provides a mechanism for representing linguistic constructs such as low, medium, high, very high etc. The conventional binary set theory describes crisp data, which is either fully true or false. Fuzzy logic operates on the concept of degree of membership. The degree of membership is continuous on an interval [0,1]. A fuzzy set captures vagueness using membership functions by assigning a degree of membership to each element of the set. The fuzzy logic also uses a fuzzy inference engine to manipulate imprecise, uncertain and conflicting data. The fuzzy inference engine maps the input fuzzy set to an output fuzzy set using a fuzzy rule base. This paper evaluates the maintainability of object-oriented software using Mamdani s Fuzzy Inference System (MFIS). Six CK metrics are used as inputs to the model. The value of each metric is fuzzified into one of three values: Low, Medium and High. The trapezoidal membership function is used for fuzzification. A total of 729 fuzzy rules were developed, which are used by the fuzzy inference engine. The maintainability computed by MFIS is correlated with the composite complexity, which is computed as a weighted sum of the CK metrics. The weight that will be multiplied to each CK metric is derived from the corresponding importance factor given by Jubair et al. [7]. The rest of the paper is divided into three sections. Section 2 describes the MFIS along with inputs, outputs, membership functions and rules. Section 3 applies the given model to 15 classes and correlates the composite complexity of each class with its maintainability. Finally, the conclusions of paper and the future directions are given in section 4. 2. 2. Model Adopted 3. This paper uses the MFIS proposed in 1975 by Ebrahim Mamdani [8]. The main components of the MFIS are a fuzzy rule base, dictionary and reasoning mechanism. A fuzzy rule base is a collection of fuzzy rules obtained from experts. Fuzzy rules are linguistic statements, which describe how the fuzzy inference system should make a decision regarding classifying

an input or controlling an output [9]. The general format of a fuzzy rule is if (input-1 is membership function- 1) and/or (input-2 is membership function-2) and/or (inputn is membership function-n) then (output is output membershipfunction). The dictionary defines all the membership functions used in the fuzzy rules. The fuzzy reasoning mechanism performs the inference procedure. The input to the FIS can be either fuzzy or crisp. If the input is a crisp value, it can be converted to a fuzzy value using a fuzzification process. Generally the output produced by MFIS is fuzzy; however if crisp output is required it can be converted into crisp form using a defuzzification process. This model uses the following steps to compute the output [10]. 1. Design a set of fuzzy rules. 2. Convert the input into fuzzy form. 3. Combine the fuzzified inputs according to the fuzzy rules for establishing rule strength. 4. Determine the consequent of the rules for establishing rule strength and the output membership function. 5. Combine all consequents to get an output distribution. 6. Defuzzify the output distribution. class. It is the sum of the methods defined in the class and the methods that are directly invoked by methods of the class. A higher value of RFC indicates a higher complexity of the class, therefore less maintainability. 2.1.6 Lack of Cohesion in Methods (LCOM) The LCOM of a class is the difference between the number of pairs of methods that have no common attribute and the number of pairs of methods that have common attributes. It measures the dissimilarity of methods in a class on the basis of attributes used by methods of the class. A positive value of LCOM for the class indicates that the class is less cohesive. For good quality design a positive value of LCOM is not desirable. Low cohesion is an indicator of higher complexity. 2.1 Inputs and Output of Model Software maintainability is an important attribute of software quality. It can not be measured directly. It can be measured indirectly using measures of design structures such as class diagram. For object-oriented software, Chidamber and Kemerer proposed a metrics suite consisting of six metrics that can be used to measure the complexity, reusability, coupling and cohesion of a class [11]. These metrics are further correlated with the maintainability of a class. This paper uses the CK metrics suite as input for the adopted model. The CK metrics suite includes the following six metrics. 2.1.1 Weighted Methods Per Class (WMC) WMC is the sum of the complexities of all the methods of a class. It is one the predictors of class maintainability. A higher value of WMC indicates a lower maintainability of the class. 2.1.2 Depth of Inheritance Tree (DIT) The DIT of a class is its maximum depth from the root node in the inheritance hierarchy. An empirical study by Daly et al. [12] indicates that a class with DIT 3 is easier to maintain compared to a class with no inheritance. 2.1.3 Number of Children (NOC) The NOC of a class is the total number of immediate subclasses of that class. A class with higher NOC requires more testing efforts. 2.1.4 Coupling Between Object Classes (CBO) The CBO of a class is the total number of other classes with which it is coupled. A higher value of CBO indicates lower maintainability of a class due to higher sensitivity to changes in the other classes. 2.1.5 Response For a Class (RFC) The RFC of a class is the total number of methods that can be executed in response to a message received by an object of that Figure 1: Mamdani s Fuzzy Inference System The output of the model is the maintainability of the class, which measures how easily we can understand and modify the class. The lower values of input complexity parameters indicate better maintainability of the class. 2.2 Membership Functions for Inputs and Output All inputs and outputs are represented using three fuzzy values - Low, Medium and High. The trapezoidal membership function is used for representing fuzzy values. The trapezoidal function depends upon four scalar parameters - a, b, c and d. Different threshold values of CK metrics are given by various researchers [13,14,15,16]. This paper designs three membership functions (LOW, MEDIUM and HIGH) for each input and output. Details of all inputs (Input1 to Input6) and output (Output1) along with their graphics representations are as follows. MF and trapmf stand for membership function and trapezoidal membership function respectively. Each membership function is defined in terms of four parameters. [Input1] Name='WMC' Range=[0 30] MF1='LOW':'trapmf',[0 0 5 10] MF2='MEDIUM':'trapmf',[5 10 15 20] MF3='HIGH':'trapmf',[15 20 30 30]

Figure 2: Membership functions of WMC [Input2] Name='DIT' MF1='LOW':'trapmf',[0 0 1 3] MF2='MEDIUM':'trapmf',[1 3 4 6] MF3='HIGH':'trapmf',[4 6 10 10] Figure 5: Membership functions of RFC [Input5] Name='CBO' MF1='LOW':'trapmf',[0 0 2 4] MF2='MEDIUM':'trapmf',[2 4 5 7] MF3='HIGH':'trapmf',[5 7 10 10] Figure 3: Membership functions of DIT [Input3] Name='NOC' Range=[0 12] MF1='LOW':'trapmf',[0 0 2 4] MF2='MEDIUM':'trapmf',[2 4 6 8] MF3='HIGH':'trapmf',[6 8 12 12] Figure 6: Membership functions of CBO [Input6] Name='LCOM' MF1='LOW':'trapmf',[0 0 1 3] MF2='MEDIUM':'trapmf',[1 3 4 6] MF3='HIGH':'trapmf',[4 6 10 10] Figure 4: Membership functions of NOC [Input4] Name='RFC' Range=[0 60] MF1='LOW':'trapmf',[0 0 10 20] MF2='MEDIUM':'trapmf',[10 20 30 40] MF3='HIGH':'trapmf',[30 40 60 60] Figure 7: Membership functions of LCOM [Output1] Name='Maintainability' Range=[0 1] MF1='LOW':'trapmf',[0 0 0.2 0.4]

MF2='MEDIUM':'trapmf',[0.2 0.4 0.6 0.8] MF3='HIGH':'trapmf',[0.6 0.8 1 1] 3. Measuring Class Complexity and Maintainability The given model was applied to 15 classes and the results are shown in Table 1. Table 1: Maintainability of classes Class WMC DIT NOC RFC CBO LCOM Composite Complexity Maintainability (Mamdani Model) C1 17 0 0 9 0 5 5.37 0.83 C2 21 3 0 32 5 5 12.86 0.44 C3 28 7 0 36 0 0 13.53 0.34 C4 6 3 1 12 3 4 5.48 0.63 Figure 8: Membership functions of Maintainability 2.3 Rule Base In general with n inputs and m membership functions, m n rules can be generated. In this model, six inputs are used and for each input three membership functions are used; as a result 729 rules are designed. The format of a rule is as follows. If (WMC is LOW/MEDIUM/HIGH) and (DIT is LOW/MEDIUM/HIGH) and (NOC is LOW/MEDIUM/HIGH) and (RFC is LOW/MEDIUM/HIGH) and (CBO is LOW/MEDIUM/HIGH) and (LCOM is LOW/MEDIUM/HIGH) then (Maintainability is LOW/MEDIUM/HIGH). For example If (WMC is LOW) and (DIT is LOW) and (NOC is LOW) and (RFC is LOW) and (CBO is LOW) and (LCOM is LOW) then (Maintainability is HIGH). The following snapshot displays a graphical representation of the rules. C5 6 0 0 7 1 0 2.74 0.84 C6 25 7 0 46 0 5 16.13 0.17 C7 8 3 1 12 1 0 4.72 0.72 C8 9 5 0 8 1 2 4.47 0.63 C9 12 0 1 18 1 0 6.25 0.84 C10 7 0 0 5 1 0 2.43 0.83 C11 12 0 0 6 0 0 3.18 0.85 C12 26 4 0 30 0 0 11.4 0.5 C13 3 0 0 9 3 0 3.21 0.83 C14 27 4 2 50 6 1 17.84 0.38 C15 15 2 0 25 6 5 10.43 0.5 Jubair et al. [7] suggested an importance factor for each CK metric, which is represented by LOW(1), MEDIUM(2) and HIGH(3). The importance factor reflects the importance of the metric in determining the software quality. WMC, DIT, NOC, CBO, RFC and LCOM are assigned importance factors 2, 2, 1, 3, 3 and 2 respectively [7]. On the basis of the normalized values (0.08 for Low, 0.15 for Medium and 0.23 for High) of the importance factors, a weight is assigned to each CK metric. WMC, DIT, NOC, CBO, RFC and LCOM are assigned the weights 0.15, 0.15, 0.08, 0.23, 0.23 and 0.15 respectively. Using these weights, the composite complexity is computed. The coefficient of correlation between the composite complexity and the maintainability of the class is -0.92, which indicates that a higher value of class complexity lowers the maintainability of class. 4. Conclusion and Future Directions This paper presents the application of MFIS for computing the maintainability of a class in object-oriented software. The results produced by the MFIS satisfy the relationship between complexity and maintainability i.e. higher complexity leads to lower maintainability. However, the given model was applied to small academic-level classes and the same study can be replicated with larger industrial projects. Figure 9: Graphical Representation of Rules

5. References [1] ISO/IEC 14764:2006 Software Engineering Software Life Cycle Processes Maintenance. http://www.iso.org/iso/catalogue_detail.htm?csnumber=390 64 [2] Yunsik Ahn, Jungseok Suh, Seungryeol Kim and Hyunsoo Kim 2003. The Software Maintenance Project Effort Estimation Model Based on Function Points. Journal of Software Maintenance and Evolution: Research and Practice, 15:71 85. [3] How to Save on Software Maintenance Costs. Omnext white paper, March 2010. http://www.omnext.net/downloads/whitepaper_omnext.pdf [14] Edith Linda P and E. Chandra, 2010. Class Break Point Determination Using CK Metrics Thresholds. Global Journal of Computer Science and Technology, 73 Vol. 10 Issue 14 (Ver. 1.0). [15] Mago Jagmohan and Kaur Parwinder, 2012. Analysis of Quality of the Design of the Object Oriented Software using Fuzzy Logic, irafit, p 21-25. [16] Camrazo Cruz Ana Erika,2008. Chidamber & Kemerer suite of Metrics. Thesis submitted to Japan Advanced Institute of Science and Technology. [4] Pressman, R, Software Engineering. A Practitioner s Approach, Fourth Edition, McGraw Hill, ISBN: 0-07- 709411-5, 1997. [5] S.R. Chidamber, C.F. Kemerer, A Metrics Suite for Object Oriented Design. IEEE Transactions on Software Engineering, Vol. 20, No.6, pp. 476-492, 1994. [6] Dimitris Stavrinoudis, Michalis Xenos and Dimitris Christodoulakis 1999 Relation Between Software Metrics And Maintainability. Proceedings of the FESMA99 International Conference, Federation of European Software Measurement Associations, Amsterdam, The Netherlands, pp. 465-476. [7] Jubair Al-Ja afer and Khair Eddin Sabri, 2004. Chidamber- Kemerer (CK) and Lorenze-Kidd (LK) Metrics to Assess Java Programs. International Workshop on Software System (IWSS 04) Turkey. [8] Mamdani, E.H. and S. Assilian 1975. An experiment in Linguistic Synthesis with a Fuzzy Logic Controller. International Journal of Man-Machine Studies, Vol. 7, No. 1, pp. 1-13. [9] http://www.cs.princeton.edu/courses/archive/fall07/cos436/ HIDDEN/Knapp/fuzzy004.htm [10] Jyh-Shing Roger Jang, Chuen-Tsai Sun and Eiji Mizutani, Neuro-Fuzzy and Soft Computing: A Computational Approach to Learning and Machine Intelligence, PHI Learning Private Limited. [11] Sandeep Srivastava, 2012. Software Metrics and Maintainability Relationship with CK Matrix. International Journal of Innovations in Engineering and Technology (IJIET) Vol. 1 Issue 2. [12] Daly J., Brooks A., Miller J., Roper M. and Wood M. 1996. An Empirical Study Evaluating Depth of Inheritance on Maintainability of Object-Oriented Software. Empirical Software Engineering, Vol. 1, No. 2, pp. 109-132. [13] Zhou Yuming and Hareton Leung, 2006. Empirical Analysis of Object-Oriented Design Metrics for Predicting High and Low Severity Faults. IEEE Trans. Softw. Eng.,32(10):771-789.