Title: Design Pattern Automation for ReEngineering
1Design Pattern Automation for Re-Engineering
- Paul Gestwicki and Fu-Shing Sun
- Ball State University
- New Proposal
- SERC Showcase
- December 6, 2007
2Outline
- Introduction to Design Patterns
- Pattern-Oriented Re-Engineering
- Proposed Research
3Design Patterns
4Design Patterns Defined
Each pattern describes a problem which occurs
over and over again in our environment, and then
describes the core of the solution to that
problem, in such a way that you can use this
solution a million times over, without ever doing
it the same way twice.
5Design Patterns in Software
6Major Benefits ofPattern-Orientation
- Facilitates object-oriented design and analysis
- Improves reusability
- Improves software maintenance
- Increase software comprehension
- Reduce training costs
7Example State Machines
8Naïve Implementation
const int ACCEPTING_INPUT 1 const int
PROCESSING 2 int state ... void
handleInput() switch (state) case
ACCEPTING_INPUT ... case PROCESSING
... void handleWindowClosed() switch
(state) case ACCEPTING_INPUT ... case
PROCESSING ...
9Pattern-Oriented Design
10Outline
- Introduction to Design Patterns
- Pattern-Oriented Re-Engineering
- Proposed Research
11Re-Engineering
- May include refactoring or redesign
- A combination of
- Reverse engineering legacy systems
- Forward engineering new systems
12Forward Engineering
- Requirements-driven development
- Adopt patterns based on
- Requirements
- Domain
- Expertise
13Forward Engineering Example
14Object-Oriented Solution
15Pattern-Oriented Solution
16Reverse Engineering
- Understand an unfamiliar system
- Identify patterns
- Limited tool support exists
17Tool-Supported Pattern Recovery
- State-of-the-art tools
- FUJABA, DP-Miner, Borland Together
- Structural, behavioral, and semantic analysis
- Machine learning approaches
18Sample Pattern Recovery
- JHotDraw 6.0 beta 1
- 530 classes in 484 files
- Tool-supported pattern recovery found
- 4 adapters, 58 bridges, 64 strategies
- JEdit 4.2
- 1001 classes in 394 files
- Tool-supported pattern recovery found
- 17 adapters, 24 bridges, 24 strategies
19Observations
- Design patterns are not formulas
- Reification depends on language, idioms, style
- Strategy, Adapter, and Bridge
- Naïve implementations are obvious
- Clever implementations are subtle... and
therefore difficult to detect
20Outline
- Introduction to Design Patterns
- Pattern-Oriented Re-Engineering
- Proposed Research
21Long-Term Goal
- Automated pattern recommendations based on formal
requirements - An expert system for pattern-oriented software
22Short-Term Goal
- Given a legacy system
- Predict patterns through requirements analysis
- Detect patterns through reverse-engineering
- Result
- Pattern-oriented software analysis
- Useful for refactoring or redesign
23Major Challenges
- Lack of design documentation
- Pattern reification and language idioms
- Imprecise or nondeterministic recovery
- False positive and true-negative
- Manual verification is error-prone
24Proposed Deliverables
- Comprehensive analysis of an existing system
- Pattern analysis (reverse engineering)?
- Pattern recommendations (forward engineering)?
- Details of the research methodology
- Recommendations for automation
25Budget and Contact Information
Proposed budget 26,000 Project duration One
year Paul Gestwicki pvgestwicki_at_bsu.edu Fu-Shi
ng Sun fsun_at_bsu.edu http//www.cs.bsu.edu/pvg
/patterns