Design Pattern Recovery in ObjectOriented Software - PowerPoint PPT Presentation

1 / 19
About This Presentation
Title:

Design Pattern Recovery in ObjectOriented Software

Description:

Design Pattern Recovery in Object-Oriented Software. G. Antoniol, R. Fiutem ... of each class within the pattern ... extract design pattern from OO design ... – PowerPoint PPT presentation

Number of Views:53
Avg rating:3.0/5.0
Slides: 20
Provided by: salmosa
Category:

less

Transcript and Presenter's Notes

Title: Design Pattern Recovery in ObjectOriented Software


1
Design Pattern Recovery in Object-Oriented
Software
  • G. Antoniol, R. Fiutem and L. Cristoforetti
  • In 6th International Workshop on Program
    Comprehension, 1998
  • 2002. 1. 28
  • Presented by Jeon, Sanguk

2
Contents
  • Introduction
  • Overview
  • Recovery process
  • Experimental results
  • Conclusion

3
Introduction(1/2)
  • OO design patterns
  • Represent well-known solutions to common design
    problems in a given context
  • Give some indications to managers about the
    quality of the system
  • Modularity, separation of concerns,
    maintainability

4
Introduction(2/2)
  • Discovery of patterns in software
  • Helps in understanding a piece of design or code
  • Knowledge about the role of each class within the
    pattern
  • The reason of certain relationship among pattern
    constituents and/or the remaining parts
  • This paper presents
  • A conservative approach to extract structural
    design patterns from OO design or code

5
Overview
6
Recovery Process
  • AOL Representation Extraction
  • AOL Representation Parsing
  • Class Metrics Extraction
  • Pattern Recognition

7
Process 1. AOL Representation
  • Adapter Pattern

CLASS Target OPERATIONS
PUBLIC Request() CLASS
Adapter OPERATIONS
PUBLIC Request() CLASS Adaptee
OPERATIONS
PUBLIC SpecificRequest() GENERALIZATION
Target SUBCLASSES Adapter RELATION
Delegates ROLES
CLASS Adapter MULT One,
CLASS Adaptee MULT One
Client
Target
Request()
Adapter
Request()
Adaptee
Adaptee
SpecificRequest()
Adaptee-gtSpeificRequest()
8
Process - 2. Class Metrics Extraction
  • Class level metrics
  • Number of public, private, protected attribute
  • Number of public, private, protected operations
  • Number of associations, aggregations,
    inheritance(or generalization) relationships in
    which a class is involved

9
Process 3. Pattern Recognition(1/6)
  • Identify a set of classes which exhibits the
    exact relationships
  • Aggregations, associations, inheritances
  • Brute force approach
  • Identify all possible pattern candidates
  • Combinatorial explosion
  • Reduction is needed
  • Metrics constraint evaluation
  • Structural and delegation constraints evaluation

10
Process 3. Pattern Recognition(2/6)
  • Metrics Constraint Evaluation
  • Find candidate classes for a pattern element

Pattern element
Class Q M1 ? a M2 ? b M3 ? c
Candidate All values are equal to or greater
than those of class P
Class P M1 a M2 b M3 c
Class R M1 ? a M2 lt b M3 lt c
11
Process 3. Pattern Recognition(3/6)
  • Metrics Constraint Evaluation(cont)
  • Find one candidate set with minimum number of
    elements

Set C2 Class D Class E Class F Class G
Set C1 Class A Class B Class D
Set C3 Class A Class G
Set C4 Class I Class J Class K
Set C3 Class A Class G
12
Process 3. Pattern Recognition(4/6)
  • Metrics Constraint Evaluation(cont)
  • Find candidates whose shortest paths to each
    other are same with pattern

Pattern
Candidate
Class P
Class R
Class A
Class C
Shortest Path a
Shortest Path a
Shortest Path b
Shortest Path b
Class Q
Class B
13
Process 3. Pattern Recognition(5/6)
  • Structural Constraint Evaluation
  • Check the relationships

Pattern
Candidate
Class P
Class R
Class A
Class C
Class Q
Class B
14
Process 3. Pattern Recognition(6/6)
  • Delegation Constraint Evaluation
  • Verify that a given method of a class actually
    calls a method of another class
  • Information is extracted from code

15
Experimental Results(1/4)
  • Public domain code
  • Reduction of candidates through the stage filters

16
Experimental Results(2/4)
  • Public domain code
  • Results of recovery on code

17
Experimental Results(3/4)
  • Industrial code
  • Characteristics

18
Experimental Results(4/4)
  • Industrial system Result

Result on Design
Result on Code
19
Conclusion
  • This paper presented
  • An approach to extract design pattern from OO
    design or code
  • Reduction of search space complexity
  • Software metrics
  • Structural and delegation information
Write a Comment
User Comments (0)
About PowerShow.com