Mei-Huei Tang October 25, 2000 Computer Science Department SUNY Albany

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

Metrics for OO Design Distinct & measurable characteristics of OO design:- Size:-it is defined as – population,volume,length & functionality Population.
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.
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.
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.
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
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.
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.
Metrics.
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.
Object-Oriented Metrics Alex Evans Jonathan Jakse Cole Fleming Matt Keran Michael Ababio.
Japan Advanced Institute of Science and Technology
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 Metric- A definition 2. Types of Software metrics 3. Frame work of product metrics 4. Product 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,
Intelligent Database Systems Lab 國立雲林科技大學 National Yunlin University of Science and Technology Mining Source Code Elements for Comprehending Object- Oriented.
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
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.
Design Metrics CS 406 Software Engineering I Fall 2001 Aditya P. Mathur Last update: October 23, 2001.
Object Oriented Metrics
Pragmatics 4 Hours.
School of Business Administration
Assessment of Geant4 Software Quality
Software Metrics 1.
Course Notes Set 12: Object-Oriented Metrics
Design Characteristics and Metrics
Towards a Multi-paradigm Complexity Measure
Object-Oriented Metrics
Design Metrics Software Engineering Fall 2003
Design Metrics Software Engineering Fall 2003
Information flow-Test coverage measure
Software Metrics SAD ::: Fall 2015 Sabbir Muhammad Saleh.
Software Metrics using EiffelStudio
Chapter 8: Design: Characteristics and Metrics
Presentation transcript:

Mei-Huei Tang October 25, 2000 Computer Science Department SUNY Albany Software Metrics Mei-Huei Tang October 25, 2000 Computer Science Department SUNY Albany

Software Metrics Units of measurement Characterize essential features of software quantitatively. Software products, Software processes, and Software people. Quantitative measures, enable gaining insight of efficiency of software process, productivity and quality of software project Characterize, evaluate, predict, and improve.

Software Metrics Categories Generally software metrics can be divided into two categories Project Metrics (Process Metrics) Predict project needs Measure dynamic changes Design Metrics (Product Metrics) Measure the static state of project at a particular point in time.

Object-Oriented Project Metrics (Lorenz and Kidd) Application Size Number of Scenario Scripts (NSS) Number of Key Classes (NKC) Number of Subsystems (NOS) Staffing Size Person-days per class (PDC) Classes per developer (CPD) Scheduling Number of major iterations (NMI) Number of contracts completed (NCC)

Chidamber & Kemerer (CK) Metrics Weighted Methods per Class (WMC) Depth of Inheritance Tree (DIT) Number of Children (NOC) Coupling Between Object Classes(CBO) Response For a Class (RFC) Lack of Cohesion in Methods (LCOM)

Weighted Methods Per Class (WMC) Consider a Class C1 , with methods M1, …, Mn that are defined in the class. Let c1, …, cn be the complexity of the methods. Then: WMC = If all method complexities are considered to be unity, then WMC = n

WMC Example Assume all methods with the same complexity: WMC(foo) = 4 Class foo { int local_var; int *pInt; public: foo(){local var = 1; pInt = new int;} int f1(){return local_var;} int f2(){return ++local_var;} int f3(){return 1/f1();} } Assume all methods with the same complexity: WMC(foo) = 4

Depth of Inheritance Tree (DIT) Depth of inheritance of the class is the DIT metric for the class. DIT = depth of the class in the inheritance tree If multiple inheritance is allowed, DIT = the maximum length from the node to the root of the tree

DIT Example DIT(A) = DIT (B) = 2

Number of Children (NOC) NOC = number of immediate subclasses subordinated to a class in the class hierarchy

NOC Example NOC(C) = 2

Coupling Between Objects (CBO) A count of the number of other classes to which it is coupled. An object is coupled to another object if one of them acts on the other. Two classes are coupled when methods declared in one class use methods or instance variables defined by the other class.

CBO Example Class A { : M1(){ B.M1(); C.M2(); : } } CBO (A) = 2 : } } CBO (A) = 2 Class B { : M1(){ : } } Class C { M2(){ : }

Response for a Class (RFC) RFC = | RS | where RS is the response set for the class RS = {M}  all i {Ri} where {Ri} = set of methods called by method I and {M} = set of all methods in the class

RFC Example Class C1{ M1(){…}; M2 (){…}; M3(){… C2.M1()};} Class C2{

Lack of Cohesion in Methods (LCOM) Consider a Class C1 , with n methods M1, …, Mn. Let {Ij}= set of instance variables used by method Mi. There are n such sets {I1}, …, {In}. Let P = {(Ii, Ij)| Ii  Ij = } and Q = {(Ii, Ij)| Ii  Ij  }. If all n sets {I1}, …, {In} are  then let P = . LCOM = | P | - | Q | , if | P | > | Q | = 0 , otherwise

LCOM Example Consider a Class C with 3 methods M1, M1 and M3. Let {I1}= {a, b, c, d, e}, {I2}= {a, b, c} and {I3}= {x, y, z}. {I1}  {I2} is nonempty, but {I1}  {I3} and {I2}  {I3} are null sets. LCOM = | P | - | Q | = 2 – 1 = 1

New Metrics Inheritance Coupling (IC) Coupling Between Methods (CBM) Number of Object/Memory Allocation (NOMA) Average Method Complexity (AMC)

Inheritance Coupling (IC) The number of parent classes to which a given class is coupled. One of its inherited methods uses a variable (or data member) that is defined in a new/redefined method. One of its inherited methods calls a redefined method and uses the return value of the redefined method. One of its inherited methods is called by a redefined method and uses a parameter that is defined in the redefined method. One of its inherited methods uses a variable X, and the value of X depends on the value of a variable Y which is defined in a new/redefined method.

New Metrics Example Class foo_c1 :: Public foo{ Class foo { int f1(){return --local_var;} int f4(){return local_var++;} } Class foo_c2 :: Public foo{ int f2(){return 0;} Class foo { int local_var; int *pInt; public: foo(){local var = 1; L2: pInt = new int;} int f1(){return local_var;} int f2(){return ++local_var;} int f3(){return 1/f1();} }

Coupling Between Methods (CBM) The total number of new/re-defined methods to which all the inherited methods are coupled. Inherited method uses a variable (or data member) that is defined in a new/redefined method. Inherited method calls a redefined method and uses the return value of the redefined method. Inherited method is called by a redefined method and uses a parameter that is defined in the redefined method. Inherited method uses a variable X, and the value of X depends on the value of a variable Y which is defined in a new/redefined method.

New Metrics Example Class foo_c1 :: Public foo{ Class foo { int f1(){return --local_var;} int f4(){return local_var++;} } Class foo_c2 :: Public foo{ int f2(){return 0;} Class foo { int local_var; int *pInt; public: foo(){local var = 1; L2: pInt = new int;} int f1(){return local_var;} int f2(){return ++local_var;} int f3(){return 1/f1();} }

New Metrics Inheritance Coupling (IC) Coupling Between Methods (CBM) Number of Object/Memory Allocation (NOMA) The total number of statements that allocate new objects or memories in a class. Average Method Complexity (AMC) The average method size of a class.

New Metrics Example Class foo_c1 :: Public foo{ Class foo { int f1(){return --local_var;} int f4(){return local_var++;} } Class foo_c2 :: Public foo{ int f2(){return 0;} Class foo { int local_var; int *pInt; public: foo(){local var = 1; L2: pInt = new int;} int f1(){return local_var;} int f2(){return ++local_var;} int f3(){return 1/f1();} }

New Metrics Inheritance Coupling (IC) Coupling Between Methods (CBM) Number of Object/Memory Allocation (NOMA) The total number of statements that allocate new objects or memories in a class. Average Method Complexity (AMC) The average method size of a class.

New Metrics Example Class foo_c1 :: Public foo{ Class foo { int f1(){return --local_var;} int f4(){return local_var++;} } Class foo_c2 :: Public foo{ int f2(){return 0;} Class foo { int local_var; int *pInt; public: foo(){local var = 1; L2: pInt = new int;} int f1(){return local_var;} int f2(){return ++local_var;} int f3(){return 1/f1();} }