group 8 presentation_metrics_for_object_oriented_system

12
Metrics for Object-Oriented System Group 8 Hung Ho Rui Tang Chuyi Feng Muhammad Yousaf Sarah Makona

Upload: hung-ho-ngoc

Post on 14-Apr-2017

9 views

Category:

Technology


0 download

TRANSCRIPT

Metrics for Object-Oriented System

Group 8

Hung Ho Rui Tang Chuyi Feng

Muhammad Yousaf

Sarah Makona

ContentIntroduction

Basic Definitions

Metric Properties For Evaluation Criteria

Applied Metrics Suite

Conclusion

OOA, OOD and OOP Object-oriented programming (OOP) is a programming paradigm based on the concept of "objects", which may contain data, often known as attributes; and methods.

DefinitionsObject: X = (x, p(x))

x: substantial individualp(x): collection of properties and methods

Cohesion: refers to what object (of class) will doLow Cohesion: Does many actions but not focus what it should doHigh Cohesion: Should focus what it should do

Coupling: refers to how related / dependent are objects on each other

DefinitionsComplexity of Object

+ Large number of properties+ Number of compositions

Scope of Properties+ Depth of Inheritance+ Number of Children

Metric Properties for Evaluation Criteria1. Non-coarseness

Not every class can have same value for a metric

2. Non-uniqueness (Notion of Equivalence)Two classes can have same metric value

3. Design details are importantEven though two classes perform same functions, the details of the

design matter in determining the metric for the class

Metric Properties for Evaluation Criteria (cont)4. Monotonicity

The metric for the combination of two classes can never be less than the metric for either of the component classes: u(P + Q) > u(P)

5. Non-equivalence of interactionInteraction between P + Q # Q + R

6. Interaction increases complexityWhen two classes are combined, the interactions increase complexity

Applied Metrics Suite1. Weighted Methods Per Class (WMC)2. Depth Of Inheritance Tree (DIT)3. Number Of Children (NOC)4. Coupling Between Object Classes (CBO)5. Response For A Class (RFC)6. Lack Of Cohesion In Methods (LCOM)

Examples with project+ Site A use C++ language+ Site B use Smalltalk language

Both 6 applied metrics satisfy property 1, 2, 3, 4, 5 except property 6 fails

Applied Metrics Suite1. Weighted Methods Per Class (WMC)

+ To predict how much time and effort to develop and maintain class+ Large numbers of methods in class will limit possibility of reuse

2.Depth Of Inheritance Tree (DIT)+ The deeper of class

=> More number of method to inherit => complex to predict+ The deeper a class is in hierarchy, the greater the reuse of inherited methods

Applied Metrics Suite (cont)3. Number Of Children (NOC)

If a class has large number of children=> misuse subclassing=> require more testing

4. Coupling Between Object Classes (CBO)Excessive coupling=> prevent reuse and modular design=> difficult maintenance

Applied Metrics Suite (cont)5. Response For A Class (RFC)

A large number of method invoked in response => Testing and debugging are complicated => The greater the complexity of the class

6. Lack Of Cohesion In Methods (LCOM)Cohesion promotes encapsulationLow cohesion increase complexity and errors

ConclusionFailing to meet property 6 implies that a complexity metric could increase if a class is divided into more classes

Possible new set of software metrics for OO design

The suite provides designers and managers with indication of the integrity of the design

It may serve as a generalized solution when other researchers to develop metrics for particular purposes or customized environment.