object oriented metrics n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Object-Oriented Metrics PowerPoint Presentation
Download Presentation
Object-Oriented Metrics

Loading in 2 Seconds...

play fullscreen
1 / 18

Object-Oriented Metrics - PowerPoint PPT Presentation


  • 64 Views
  • Uploaded on

Object-Oriented Metrics. Localization Encapsulation Information hiding Inheritence Object abstraction. Characteristics of OO. Is a process of placing items in close proximity to each other - OO approaches localize information around objects which means that:

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Object-Oriented Metrics' - cortez


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
localization encapsulation information hiding inheritence object abstraction
Localization

Encapsulation

Information hiding

Inheritence

Object abstraction

Characteristics of OO
localization

Is a process of placing items in close proximity to each other

- OO approaches localize information around objects

which means that:

- metrics identification and gathering effort

recognize “object” as the basis unit of software

- within systems of objects, the localization between

functionality and objects is not one-to-one

relationship. for example one function may involve

several objects, and one object may provide many

functions

localization
encapsulation

Is the packaging (or binding together) of a collection items

- in oo programming languages, encapsulating

mechanisms are eg. C++'s classes, Ada's pakages,

and modula 3's modules

- objects encapsulate:

= knowledge of state, advertised capabilities

(sometimes called operations, method interfaces,

method selectors, or method interfaces), methods,

[in the case of composite objects] other objects,

[optionally] exceptions, constants,

Encapsulation
slide5
Impact on metrics:

- the basic unit will be object

- modify thinking on characterizing and estimating systems

Encapsulation
information hiding

Is the suppression (or hiding) of details

- The general idea is that we show only that

information which is necessary to accomplish our

immediate goals.

-Information hiding plays a direct role in such

metrics as object coupling and the degree of

information hiding

Information hiding
inheritence

Is a mechanism whereby one object acquires characteristics from one, or more, other objects

- Some object oriented languages support only single

inheritance, i.e., an object may acquire characteristics

directly from only one other object

-Some object-oriented languages support multiple

inheritance, i.e. an object may acquire characteristics

directly from two, or more, different objects

Inheritence
abstraction

Is a mechanism for focusing on the important details of a concept or items, while ignoring the inessential details

- In object abstraction, we treat objects as

high-level entities (i.e., as black boxes).

-

Abstraction
morris s oo metrics

Method per class

From the standpoint of code reuse ... a large number of methods per object class is desirable because subclasses tend to inherit a larger number of methods from superclasses.

It was seem that extensibility will suffer if the number of methods per object class gets too large.

A larger number of methods per object class is likely to complicate testing due to the increased object size and complexity.

Total no. of methods

No. of Methods per Object Class = --------------------------

Total No. of Object Classes

Morris's OO Metrics
morris s oo metrics1

Inheritance Denpendencies

-Inheritance tree depth is likely to be more favorable than breadth in terms of reusability via inheritance. Deeper inheritance trees would seem to promote greater method sharing than would broad trees.

-A deep inheritance tree may be more difficult to test than a broad one.

-Comprehensibility may also be diminished with a large number inheritance layers

Inheritance Tree Depth = max{Inheritance Tree Path Length}

Morris's OO Metrics
morris s oo metrics2

Degree of coupling between objects

-A higher degree of coupling between objects is likely to complicate application maintenance because object interconnections and interactions are more complex.

-The higher the degree of object independence (i.e. the more 'uncoupled' objects are from each other) the more likely it is that objects will suitable for reuse within the same applications and within other applications.

-Uncoupled objects should be easier to augment than those with a high degree of 'uses' dependencies, due to the lower degree of interaction.

-Testability is likely to degrade with a more highly coupled system of objects.

-Object interaction complexity associated with coupling can lead to increased error generation during development.

Morris's OO Metrics
morris s oo metrics3

Degree of coupling between objects

Average No. of Uses Dependencies per Object

Total No. of Arcs

= -------------------

Total No. of Objects

Morris's OO Metrics
morris s oo metrics4

Degree of cohesion of objects

-Objects which are less dependent on other objects for data are likely to be more reusable.

-Low cohesion is likely to produce a higher degree of errors in the development process. Low cohesion adds complexity which can translate into a reduction in application reliability.

Degree of cohesion of Object

Total Fain-in for all Objects

= -----------------------------------

Total No. of Objects

Morris's OO Metrics
morris s oo metrics5

Object Library Effectiveness

-If objects are actually being designed to be reusable beyond a single application, then the effects should appear in object library usage statistics.

Average Number of object reuse

Total Number of Objects Reuse

= -----------------------------------

Total No. of Library Objects

Morris's OO Metrics
morris s oo metrics6

Factoring Effectiveness

-the more highly factored an application is, the smaller the number of implementation locations for the average method.

-The more highly factored an inheritance hierarchy is the greater degree to which method reuse is likely to occur.

-Highly factored applications are likely to be more reliable for reasons similar to those which argue that such applications are more maintainable. The smaller the number of implementation locations for the average task, the less likely that errors were made during coding

factoring effectiveness

Number of Unique Methods

= -----------------------------------

Total number of Methods

Morris's OO Metrics
morris s oo metrics7

Average Method Complexity

-More complex methods are likely to be more difficult to maintain.

-Greater method complexity is likely to lead to a lower degree of overall application comprehensibility.

-Greater method complexity is likely to adversely affect application reliability.

-More complex methods are likely to be more difficult to test.

Average Method Complexity

Sum of V(g) of all Methods

= -----------------------------------

Total number of application Methods

Morris's OO Metrics
chidamber and kemerer metrics
Chidamber and Kemerer Metrics
  • There are many existing proposed measures developed specifically for object-oriented systems
  • The representative work conducted by Chidamber and kemerer (1994 in IEEE Trans Software engineering) proposed 6 major metrics
    • WMC (Weighted Methods per Class)
      • For a class C with methods M1, M2, …, Mn, weighted respectively with complexity X1,X2,…,Xn, WMC is calculated as the sum of Xu, u = 1 ~ n
    • DIT (Depth of Inheritance Tree)
      • The length of the maximum path from the node to the root of the inheritance tree
slide18
NOC (Number of Children)
      • The number of immediate successors of the class
    • CBO (Coupling Between Object Classes)
      • the number of other classess to which the class is coupled
    • RFC (Response for Class)
      • the number of local methods plus the number of methods called by the local methods
    • LCOM (Lack of Cohesion Metric)
      • the number of disjoint (non-intersection) sets of local methods
  • Li and Henry (1995) conducted empirical study and concluded that these metrics can predict maintenance effort