Using Metrics to Identify Design Patterns in Object-Oriented Software Using Metrics to Identify Design Patterns in Object-Oriented Software
EPM
Patterns in Object-Oriented Software Patterns in Object-Oriented Software
G.
- G. Antoniol
Using Metrics to Identify Design Using Metrics to Identify Design - - PowerPoint PPT Presentation
Using Metrics to Identify Design Using Metrics to Identify Design Patterns in Object-Oriented Software Patterns in Object-Oriented Software Patterns in Object-Oriented Software Patterns in Object-Oriented Software G. G. Antoniol Antoniol
EPM
EPM
EPM
Reusable, well
Proxy Pattern Subject
Proxy
EPM
Categories:
structural
creational
behavioral.
RealSub
Refers
RealSub -> op()
Pattern also means
Motif is just an instance
The pattern encompasses
Actually we observe the
Motif intent may never
EPM
EPM
EPM
AOL: a design
Captures OO design
CLASS Subject OPERATIONS PUBLIC op(); CLASS RealSub OPERATIONS PUBLIC op();
EPM
UML
StP/OMT
C++
PUBLIC op(); CLASS Proxy OPERATIONS PUBLIC op(); GENERALIZATION Subject SUBCLASSES Realsub, Proxy; RELATION Refers ROLES CLASS Proxy MULT one, CLASS RealSub MULT one
EPM
association
aggregation
inheritance
1
k
EPM
Software metrics allows to effectively prune the search
EPM
First kind of constraints:
single class level metrics;
Output:
a set of class candidate sets for each pattern searched.
k p
1
1
k
, i , i ij j i j i p i
EPM
1 2 3
3 3 2 1
Proxy
Suppose collected metrics are: kids nbr, father nbr, association nbr
EPM
EPM
min
min
EPM
min 1
i i n
s
EPM
1 t p t p s n
EPM
Code to AOL translation is affected by inherent
EPM
Heuristics example:
associations: object pointer/reference data member or
aggregations: object instance or array data member, class
Solution: search also
Design pattern recovery from code;
6 C++ applications, ranging from 5 to 127KLOC for a
EPM
Not explicitly designed using patterns;
Reduction effectiveness of the three stages:
metrics
structural: 1
delegation: 2
25 /100KLOC identified, 9 /100KLOC actual;
EPM
no delegation: ave = 20.1%, range = 3.4
delegation: ave = 55.4%, range = 18.2
Assessment of design pattern use;
Telecommunication software: 8 complete C++
EPM
Pattern recovery on design:
delegation constraints not applicable;
two kinds of patterns, 32
Pattern Recovery on Code:
actual pattern instances present in 2 of 8 systems;
Precision: no delegation:16%, delegation:80%;
EPM
Precision: no delegation:16%, delegation:80%;
Design
no code
EPM
EPM
DP structure can be represented as a graph (or a multi-
A class diagram is just a graph
EPM
A class diagram is just a graph Graph isomorphism is actually not a point as a DP is
We need something different define a graph similarity
The WEB is a huge graph Certain nodes are more important than others
a good hub is pointed by many good authorities
EPM
a good authority is pointed by many good hub;
authoritative
Goal assign a hub score and authority score
it is kind of a graph weighting itself
but how …
+ A Z B A BZ
T T
EPM
,... 2 , 1 ,
1
= + + =
+
k A Z B A BZ A Z B A BZ Z
F k T T k k T T k k
k
+ A Z B A BZ
T T
EPM
,... 2 , 1 ,
1
= + + =
+
k A Z B A BZ A Z B A BZ Z
F k T T k k T T k k
k
association, inheritance, aggregation
EPM
Giuliano Antoniol Antoniol et al Object et al Object-oriented design patterns recovery.
Journal of Systems and Software 59 and Software 59(2): 181 (2): 181-196 (2001) 196 (2001)
Vincent Blondel Blondel et al A MEASURE OF SIMILARITY BETWEEN GRAPH et al A MEASURE OF SIMILARITY BETWEEN GRAPH VERTICES: APPLICATIONS TO SYNONYM EXTRACTION AND WEB VERTICES: APPLICATIONS TO SYNONYM EXTRACTION AND WEB SEARCHING SEARCHING
Nikolaos Tsantalis Tsantalis et al, " et al, "Design Pattern Detection Using Similarity Scoring Design Pattern Detection Using Similarity Scoring," ," IEEE IEEE Transactions on Software Engineering Transactions on Software Engineering, vol. 32, no. 11, pp. 896 , vol. 32, no. 11, pp. 896-909, November 2006 909, November 2006
Laura A. Zager Zager, George C. , George C. Verghese Verghese: Graph similarity scoring and matching. Appl. : Graph similarity scoring and matching. Appl. Math.
. 21(1): 86-94 (2008) 94 (2008)
Laura A. Zager Zager: : Graph similarity MIT dissertation June 2005 Graph similarity MIT dissertation June 2005