Object-Oriented Metrics Alex Evans Jonathan Jakse Cole Fleming Matt Keran Michael Ababio.

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

Bartłomiej Bodziechowski 1, Eryk Ciepiela 2, Marian Bubak 1,2 1 AGH University of Science and Technology, Department of Computer Science AGH, 2 AGH University.
Metrics for OO Design Distinct & measurable characteristics of OO design:- Size:-it is defined as – population,volume,length & functionality Population.
Visual Studio Tips and Tricks Code Metrics Zain Naboulsi Sr. Developer Evangelist Microsoft Blog: blogs.msdn.com/
Software Metrics for Object Oriented Design
Software Metrics Software Engineering.
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.
Page 1 Building Reliable Component-based Systems Chapter 7 - Role-Based Component Engineering Chapter 7 Role-Based Component Engineering.
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.
PVK-Ht061 Contents Introduction Requirements Engineering Project Management Software Design Detailed Design and Coding Quality Assurance Maintenance.
Software Metrics portions ©Ian Sommerville 1995
Vrije Universiteit amsterdamPostacademische Cursus Informatie Technologie Themes and Variations abstraction -- the object metaphor modeling -- understanding.
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.
Chapter 9: Software Metrics
Software Metrics.
Cyclomatic Complexity Dan Fleck Fall 2009 Dan Fleck Fall 2009.
Lecture 17 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.
Paradigm Independent Software Complexity Metrics Dr. Zoltán Porkoláb Department of Programming Languages and Compilers Eötvös Loránd University, Faculty.
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.
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.
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,
740f02measure17 1 An Evaluation of the MOOD Set of Object-Oriented Software Metrics Harrison, Counsell and Nithi IEEE Trans on Soft Eng June 1998.
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
Measurement - part 5 1 An Evaluation of the MOOD Set of Object-Oriented Software Metrics Harrison, Counsell and Nithi IEEE Trans on Soft Eng June 1998.
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.
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.
OBJECT-ORIENTED DESIGN JEAN SIMILIEN. WHAT IS OBJECT-ORIENTED DESIGN? Object-oriented design is the process of planning a system of interacting objects.
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.
Object Oriented Metrics
School of Business Administration
Course Notes Set 12: Object-Oriented Metrics
Design Characteristics and Metrics
Object-Oriented Metrics
CS427: Software Engineering I
Design Metrics Software Engineering Fall 2003
Design Metrics Software Engineering Fall 2003
3 Fundamentals of Object-Oriented Programming
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:

Object-Oriented Metrics Alex Evans Jonathan Jakse Cole Fleming Matt Keran Michael Ababio

What is OOM? Measurements ManagePredictImprove

LOCOM - Lack of CohesionWMC - Weighted Method CountDIT - Depth of Inheritance TreeNOC - Number of ChildrenRFC - Response for ClassCBO - Coupling Between Object Classes Chidamber-Kemerer (CK) Suite

Metrics of OO Design (MOOD) CF - Coupling FactorAHF - Attribute Hiding FactorMHF - Method Hiding FactorMIF - Method Inheritance FactorAIF - Attribute Inheritance FactorPF - Polymorphism Factor

Coupling Factor (CF) Low coupling Improves modular design Encourages reuse of components

Coupling Example Coupling Example Coupling Example Number of non-inheritance couplings: 7 Max Number of Couplings: (9 * 8) / 2 = 36 CF = 7/36 =

Lack of Cohesion (LOCOM)

Correct class subdivision Decrease complexity Reduced risk of errors Increased reusability Low LOCOM

Cohesion Example Number of methods in class: 4 %x = 2/4 = 0.5 %y = ¼ = 0.25 %z = ¼ = 0.25 LOCOM = 1 - ( )/4 = 0.75

Hide attributes Large AHF Prevent access Attribute Hiding Factor (AHF)

Hide methods Large MHF Prevent Access Method Hiding Factor (MHF)

Encapsulation Example

AHF Results AttributesNumber classes not visible in%invisibilityAHF GUIfield1685%57% GUIfield2685% GUIfield3685% P1field1571% P2field1685% P3field1685% P4field1571% DS1field % DS2field %

MHF Results AttributesNumber classes not visible in%invisibilityMHF GUImethod()685%77% P1method1()571% P1method2()685% P1method3()571% P2method1()457% P2method2()685% P3method1()571% P4method1()571% P4method2() %

Depth of Inheritance Tree (DIT) Max length from class node to parent Classes should be distributed evenly DIT

Low DIT Less complex Less reuse

Number of Children (NOC) Number of direct subclasses for each class NOC

Low NOC Reduced testing Decrease complexity Less risk of faults Less reuse

DIT and NOC Example

Some Results ClassInheritance DepthNumber of Children Entity03 Bullet12 Player10 Enemy13 Zombie20 Boss21 NeonCat30

Most of the classes are subclasses: Evenly Distributed DIT Results Analysis

Most of the classes have no children: Shallow NOC Results Analysis

McCabe’s Cyclomatic Complexity CC Necessary to compute WMC Evaluate complexity of algorithm Create Control Flow Graph

Low CC Decreased testing Increased Understanding

Weighted Method Count (WMC) Low WMC Increased usability Increased readability Improved Understanding

Edges: 8 Nodes: 7 CC: = 3 CC Example

Weighted Method Count Example Redo classes with WMC 25 and 29 Decrease complexity

Response For a Class RFC Number of methods invoked by class Methods executed in response to message

Low RFC Reduced complexity Increased understanding Improved readability

RFC for Class B

Class B can call: FooA(), FooB(), FooB1(), FooC() (4) FooA() calls FooA1() (1) FooC() calls FooC1() (1) FooB1() and FooC1() call System.out.print () (1) RFC for Class B = 7

Class B Flow Chart

RFC Graphical Representation

References