Design Metrics Software Engineering Fall 2003

Slides:



Advertisements
Similar presentations
SPEC Workshop 2008 Laboratory for Computer Architecture1/27/2008 On the Object Orientedness of C++ programs in SPEC CPU 2006 Ciji Isen & Lizy K. John University.
Advertisements

CLUSTERING SUPPORT FOR FAULT PREDICTION IN SOFTWARE Maria La Becca Dipartimento di Matematica e Informatica, University of Basilicata, Potenza, Italy
Software Metrics for Object Oriented Design
Presentation of the Quantitative Software Engineering (QuaSE) Lab, University of Alberta Giancarlo Succi Department of Electrical and Computer Engineering.
Software Metrics Software Engineering.
1 Predicting Bugs From History Software Evolution Chapter 4: Predicting Bugs from History T. Zimmermann, N. Nagappan, A Zeller.
Prediction of fault-proneness at early phase in object-oriented development Toshihiro Kamiya †, Shinji Kusumoto † and Katsuro Inoue †‡ † Osaka University.
Figures – Chapter 24.
Metrics for Object Oriented Design Shyam R. Chidamber Chris F. Kemerer Presented by Ambikadevi Damodaran.
Applying and Interpreting Object Oriented Metrics
March 25, R. McFadyen1 Metrics Fan-in/fan-out Lines of code Cyclomatic complexity Comment percentage Length of identifiers Depth of conditional.
Nov R. McFadyen1 Metrics Fan-in/fan-out Lines of code Cyclomatic complexity* Comment percentage Length of identifiers Depth of conditional.
Object Oriented Design
Page 1 Building Reliable Component-based Systems Chapter 7 - Role-Based Component Engineering Chapter 7 Role-Based Component Engineering.
Object-Oriented Metrics. Characteristics of OO ● Localization ● Encapsulation ● Information hiding ● Inheritence ● Object abstraction.
Design Metrics Software Engineering Fall 2003 Aditya P. Mathur Last update: October 28, 2003.
Software engineering for real-time systems
© S. Demeyer, S. Ducasse, O. Nierstrasz Duplication.1 7. Problem Detection Metrics  Software quality  Analyzing trends Duplicated Code  Detection techniques.
Object-Oriented Metrics
March R. McFadyen1 Software Metrics Software metrics help evaluate development and testing efforts needed, understandability, maintainability.
1 Complexity metrics  measure certain aspects of the software (lines of code, # of if-statements, depth of nesting, …)  use these numbers as a criterion.
Software Metrics portions ©Ian Sommerville 1995
Predicting Class Testability using Object-Oriented Metrics M. Bruntink and A. van Deursen Presented by Tom Chappell.
Object Oriented Metrics XP project group – Saskia Schmitz.
Comp 587 Parker Li Bobby Kolski. Automated testing tools assist software engineers to gauge the quality of software by automating the mechanical aspects.
Software Metrics.
Chidamber & Kemerer Suite of Metrics
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University 1 Refactoring.
Object-Oriented Metrics Alex Evans Jonathan Jakse Cole Fleming Matt Keran Michael Ababio.
Japan Advanced Institute of Science and Technology
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
Software Measurement & Metrics
1 Software Engineering: A Practitioner’s Approach, 6/e Chapter 15b: Product Metrics for Software Software Engineering: A Practitioner’s Approach, 6/e Chapter.
Quality Assessment for CBSD: Techniques and A Generic Environment Presented by: Cai Xia Supervisor: Prof. Michael Lyu Markers: Prof. Ada Fu Prof. K.F.
The CK Metrics Suite. Weighted Methods Per Class b To use this metric, the software engineer must repeat this process n times, where n is the number of.
1 OO Metrics-Sept2001 Principal Components of Orthogonal Object-Oriented Metrics Victor Laing SRS Information Services Software Assurance Technology Center.
The CK Metrics Suite. Weighted Methods Per Class b To use this metric, the software engineer must repeat this process n times, where n is the number of.
Concepts of Software Quality Yonglei Tao 1. Software Quality Attributes  Reliability  correctness, completeness, consistency, robustness  Testability.
Software Engineering Research Group, Graduate School of Engineering Science, Osaka University 1 Evaluation of a Business Application Framework Using Complexity.
1 These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 5/e and are provided with permission by.
1 Metrics and lessons learned for OO projects Kan Ch 12 Steve Chenoweth, RHIT Above – New chapter, same Halstead. He also predicted various other project.
An Automatic Software Quality Measurement System.
CSc 461/561 Information Systems Engineering Lecture 5 – Software Metrics.
Measurement and quality assessment Framework for product metrics – Measure, measurement, and metrics – Formulation, collection, analysis, interpretation,
Daniel Liu & Yigal Darsa - Presentation Early Estimation of Software Quality Using In-Process Testing Metrics: A Controlled Case Study Presenters: Yigal.
Object-Oriented (OO) estimation Martin Vigo Gabriel H. Lozano M.
Ontology Support for Abstraction Layer Modularization Hyun Cho, Jeff Gray Department of Computer Science University of Alabama
These courseware materials are to be used in conjunction with Software Engineering: A Practitioner’s Approach, 6/e and are provided with permission by.
Object Oriented Metrics
Software Engineering Lecture 19: Object-Oriented Testing & Technical Metrics.
1 OO Technical Metrics CIS 375 Bruce R. Maxim UM-Dearborn.
Software Engineering Object Oriented Metrics. Objectives 1.To describe the distinguishing characteristics of Object-Oriented Metrics. 2.To introduce metrics.
CS223: Software Engineering Lecture 21: Unit Testing Metric.
1 Week 7 Software Engineering Spring Term 2016 Marymount University School of Business Administration Professor Suydam.
Design Metrics CS 406 Software Engineering I Fall 2001 Aditya P. Mathur Last update: October 23, 2001.
Architecting Complexity HOW UNDERSTANDING COMPLEXITY PROMOTES SIMPLICITY.
Object Oriented Metrics
School of Business Administration
Software Metrics 1.
Software Metrics.
Course Notes Set 12: Object-Oriented Metrics
Design Characteristics and Metrics
Object-Oriented Metrics
CS427: Software Engineering I
Design Metrics Software Engineering Fall 2003
Information flow-Test coverage measure
Mei-Huei Tang October 25, 2000 Computer Science Department SUNY Albany
Software Metrics SAD ::: Fall 2015 Sabbir Muhammad Saleh.
Software Metrics using EiffelStudio
Chapter 8: Design: Characteristics and Metrics
Presentation transcript:

Design Metrics Software Engineering Fall 2003 Aditya P. Mathur Last update: October 28, 2003

Design Metrics Design Metrics are useful in measuring the complexity and “goodness” of a design. A large number metrics have been proposed for OO designs. Some of these have been validated experimentally, others are mere proposals or have received little or no validation. October 23, 2001 Design Metrics

Effort Assumption: The effort in developing a class is determined by the number of methods. Hence the overall complexity of a class can be measured as a function of the complexity of its methods. Proposal: Weighted Methods per class (WMC) October 23, 2001 Design Metrics

WMC Let denote the complexity of method Let class C have methods M1, M2, .....Mn. Let denote the complexity of method How to measure WMC? October 23, 2001 Design Metrics

WMC: validation Most classes tend to have a small number of methods, are simple, and provide some specific abstraction and operations. WMC metric has a reasonable correlation with fault-proneness of a class. October 23, 2001 Design Metrics

Depth of inheritance tree (DIT) Depth of a class in a class hierarchy determines potential for re-use as more methods are available. Deeper classes have higher potential for re-use though are more complex. Inheritance increases coupling. Changing classes becomes harder. Depth of Inheritance (DIT) of class C is the length of the shortest path from the root of the inheritance tree to C. In the case of multiple inheritance DIT is the maximum length of the path from the root to C. October 23, 2001 Design Metrics

DIT evaluation Most classes tend to be close to the root. Basili et al. study,1995. Chidamber and Kemerer study, 1994. Most classes tend to be close to the root. Maximum DIT value found to be 10. Most classes have DIT=0. DIT is significant in predicting error proneness of a class. Higher DIT leads to higher error-proneness. October 23, 2001 Design Metrics

Number of children (NOC) NOC is the number of immediate subclasses of C. Higher values of NOC suggest reuse of the definitions in the super-class in a larger number of subclasses. Higher NOC suggests the extent of influence of a class on other elements of a design. Higher influence demands higher quality of that class. October 23, 2001 Design Metrics

Validation of NOC Classes generally have a small NOC value. Vast majority have NOC=0. Larger NOC value is associated with lower probability of detecting faults in that class. October 23, 2001 Design Metrics

Coupling between classes (CBC) Class C1 is coupled to class C2 if at least one method of C1 uses a method or an instance variable of C2. Coupling is usually easy to identify though often pointers may make it difficult. CBC of C=total number of other classes to which C is coupled. October 23, 2001 Design Metrics

Validation of CBC Most classes are self contained and have CBC=0. Interface classes tend to have higher CBC values. CBC is significant in predicting fault-proneness of classes. October 23, 2001 Design Metrics

Response for a class (RFC) Response set of class C is the total number of methods that can be invoked when a message is sent to an object of C. This includes all methods of C and any methods executed outside of C as a result of this message. RFC of class C is the cardinality of the response set of C. Note that even when CBC=1 RFC may be high. This indicates that the “volume” of interaction is high. October 23, 2001 Design Metrics

Validation of RFC Most classes tend to invoke a small number of methods (low RFC values). Classes for interface objects tend to have larger RFC values. RFC is very significant in predicting the fault-proneness of a class. October 23, 2001 Design Metrics

Lack of cohesion in methods (LCOM) [1] Let I1 and I2 denote sets of instance variables accessed by methods M1 and M2, respectively, in class C. M1 and M2 are considered similar, or cohesive, if I1 and I2 are not disjoint. Let Q be the set of all cohesive method pairs. Let P be the set of all non-cohesive method pairs. LCOM=|P| - |Q| if |P| > |Q|, 0 otherwise. October 23, 2001 Design Metrics

October 23, 2001 Design Metrics

LCOM [2] A larger number of cohesive pairs implies smaller LCOM. A high value of LCOM suggests that a class is trying to support multiple abstractions. Perhaps the class needs to be partitioned into smaller and more cohesive classes. LCOM is not found to be very significant in predicting fault-proneness. October 23, 2001 Design Metrics

Guidelines for interpretation [1] Ref: http://satc.gsfc.nasa.gov/support/STC_APR98/apply_oo/apply_oo.html METRIC OBJECTIVE Cyclomatic Complexity Low Lines of Code/Executable Statements Low Comment Percentage ~ 20 – 30 % Weighted Methods per Class Low Response for a Class Low October 23, 2001 Design Metrics

Guidelines for interpretation [2] METRIC OBJECTIVE Lack of Cohesion of Methods Cohesion of Methods/ Low/ High Coupling Between Objects Low Depth of Inheritance Low (trade-off) Number of Children Low (trade-off) October 23, 2001 Design Metrics

Guidelines for interpretation [3] October 23, 2001 Design Metrics

Guidelines for interpretation [4] October 23, 2001 Design Metrics

Guidelines for interpretation [5] Almost 66% of this project’s classes are below other classes in the tree, which indicates a moderate level of reuse. Higher percentages for DIT’s of 2 and 3 would show a higher degree of reuse, but increased complexity. October 23, 2001 Design Metrics

Summary of OO metrics SOURCE METRIC OO CONSTRUCT Ref: http://satc.gsfc.nasa.gov/support/STC_APR98/apply_oo/apply_oo.html SOURCE METRIC OO CONSTRUCT Traditional Cyclomatic complexity (CC) Method Traditional Lines of Code (LOC) Method Traditional Comment percentage (CP) Method NEW Weighted methods per class Class/Method NEW Response for a class (RFC) Class/Message NEW Lack of cohesion of methods (LCOM) Class/Cohesion NEW Coupling between objects (CBC) Coupling NEW Depth of inheritance tree (DIT) Inheritance NEW Number of children (NOC) Inheritance October 23, 2001 Design Metrics