A GraphBased Metamodel for ObjectOriented Software Metrics - PowerPoint PPT Presentation

About This Presentation
Title:

A GraphBased Metamodel for ObjectOriented Software Metrics

Description:

the life-cycle phase (e.g., design or implementation) ... easy to use and customise at different levels of abstraction. 3. ICGT, 10 October 2002, Barcelona ... – PowerPoint PPT presentation

Number of Views:45
Avg rating:3.0/5.0
Slides: 25
Provided by: tomm70
Category:

less

Transcript and Presenter's Notes

Title: A GraphBased Metamodel for ObjectOriented Software Metrics


1
A Graph-Based Metamodelfor Object-OrientedSoftwa
re Metrics
  • Tom Mens (tom.mens_at_vub.ac.be)
  • Postdoctoral Fellow Fund for Scientific
    Research (Flanders)
  • Vrije Universiteit Brussel, Belgium

2
Goal
  • use graphs as an underlying formalism/representati
    on to
  • define a formal framework for OO metrics
    independent of
  • the programming language (e.g., Smalltalk, Java,
    or C)
  • the life-cycle phase (e.g., design or
    implementation)
  • identify a minimal set of primitive functions to
    cover an as wide variety of OO metrics as
    possible
  • implement open and customisable metrics tools
  • easy to add new OO metrics
  • easy to incorporate new language features
  • easy to use and customise at different levels of
    abstraction

3
Approach
  • top-down
  • improve existing metrics tools
  • CodeCrawler
  • SoulMetrics
  • bottom-up
  • develop generic graph-based formalism
  • validate
  • on a variety of OO metrics suites
  • on a significant number of different programs

4
Tool support CodeCrawler
  • a language independent reverse engineering tool
  • combines metrics and software visualization
  • based on the FAMIX language-independent metamodel
  • implemented in VisualWorks 3.0 Smalltalk
  • runs on every major platform

5
Tool support CodeCrawler
6
Tool support CodeCrawler
7
Tool support SoulMetrics
  • a generic logic-programming-based metrics tool
  • defined in SOUL, a logic meta-programming
    environment
  • on top of Smalltalk VisualWorks 7
  • a collection of logic predicates
  • fully integrated in the Smalltalk GUI (browser)
  • runs on every major platform

8
Tool support SoulMetrics
9
Tool support SoulMetrics
10
Tool support SoulMetrics
11
Represent software as graphs
  • Directed attributed multi-graphs

12
Primitive graph functions
  • pred Node ? PF(Node) predecessor nodes
  • succ Node ? PF(Node) successor nodes
  • fanIn Node ? PF(Edge) incoming edges
  • fanOut Node ? PF(Edge) outgoing edges
  • path Node ? Node ? PF(Edge) edge paths
  • iterative versions predi, pred, pred, succi,
    succ, succ

13
Primitive graph functions
  • pred(c4)

14
Primitive graph functions
  • succ(c4)

15
Primitive graph functions
  • fanIn(c3)

16
Primitive graph functions
  • fanOut(c3)

17
Primitive graph functions
  • path(c2,c)

18
Qualified graph functions
  • pred Node?NodeConstraint?EdgeConstraint ?
    PF(Node)
  • idem for predi, pred, pred, succi, succ, succ
  • fanIn Node?EdgeConstraint ? PF(Edge)
  • idem for fanOut
  • path Node?Node?NodeConstraint?EdgeConstraint ?
    PF(Edge)
  • begin is defined in terms of pred
  • calculates all nodes that have no predecessors
  • end is defined in terms of succ
  • calculates all nodes that have no successors

19
Qualified graph functions
  • fanIn(c,isNoUsesEdge)

20
Qualified graph functions
  • pred(c,isClassNode,isUsesEdge)

21
Object-oriented inheritance metrics
  • Let n?Node such that isClassNode(n)
  • subclasses(n) pred(n,isClassNode,isInheritsEdge
    )
  • descendants(n) pred(n,isClassNode,isInheritsEd
    ge)
  • leafClasses(n) start(n,isClassNode,isInheritsEd
    ge)
  • inheritanceToRoot(n) ? path(n,m,isClassNode,is
    InheritsEdge)
  • m?end(n,isClassNode,isInheritsEdge
    )
  • NOS(n) subclasses(n)
  • NOD(n) descendants(n)
  • NOL(n) leafClasses(n)
  • DIT(n) average(inheritanceToRoot(n),map(length))

22
Object-oriented inheritance metrics
  • subclasses(c) NOS(c)2

23
Object-oriented inheritance metrics
  • descendants(c) NOD(c)4

24
Object-oriented inheritance metrics
  • leafClasses(c) NOL(c)2

25
Object-oriented inheritance metrics
  • inheritanceToRoot(c2) DIT(c2)2

26
Ratio Metrics
  • MethodHidingFactor(n)
  • 1 Ratio(succ,isMethodNode,isPublicNode,isConta
    insEdge)(n)
  • 1- succ(n,isMethodNode?isPublicNode,isContainsE
    dge)
  • succ(n,isMethodNode,isContainsEd
    ge)
  • AbstractSubclassRatio(n)
  • 1 Ratio(pred,isClassNode,isAbstractNode,isInhe
    ritsEdge)(n)
  • LeafclassRatio(n)
  • 1 Ratio(pred,isClassNode,isInheritanceLeaf,is
    InheritsEdge)(n)
Write a Comment
User Comments (0)
About PowerShow.com