410 likes | 424 Views
Learn about design recovery in software engineering, including its importance, motivation, methods, and practical applications. Discover how to analyze and recreate design abstractions from existing code and documentation.
E N D
Design Recovery 1 Informatics 122 Alex Baker
What is Design Recovery? • Sort of like reverse engineering
What is Design Recovery? • Design recovery recreates design abstractions from • Code • Existing design documentation (if available) • Personal experience / general knowledge about problem and application domains • Talking to people (Biggerstaff, 1989)
What is Design Recovery? • Recovered abstractions need: • Formal specifications • Module breakdowns • Data abstractions • Dataflows • Informal knowledge • All information required to understand • What • How • Why (Biggerstaff, 1989)
Also like a double-waterfall… • General model for recovery (Byrne, 1992) Alteration Reverse Engineering Abstraction Con- ceptual re-think Con- ceptual Forward Engineering Refinement re-specify Requirements Requirements re-design Design Design re-build Implementation Implementation Existing System Target System
Why do we need to know this? • Working with others’ code… • Debugging • Maintenance • Reuse • Working with your own code
Motivation: No design • Lost design • Build-and-fixed • Agile methodologies • Incomprehensible design
Motivation: Design Drift • Design not followed
Motivation: Design Drift • Design not followed
Motivation: Design Drift • Design deviations
Motivation: Design Drift • Design deviations ?
Motivation: Design Drift • Design deviations
Motivation: Design Drift • Design deviations ??? ???
Motivation: Design Drift • Design deviations ??? ???
Motivation: Design Drift • Design deviations ??? ???
Motivation: Design Drift • Design deviations
Domain of Use Knowledge Design Recovery in Diamond Dom Materials Rep (Code) Ideas Activity concern manipulates informs captures enhances Goal
Domain of Use Knowledge Design Recovery in Diamond • Someone made a design… Dom Materials Representation Ideas Activity concern manipulates informs captures enhances Goal
Domain of Use Knowledge Design Recovery in Diamond • Someone used that to create code (fairly rotely) Dom Materials Rep (Design) Rep (Code) Ideas Activity concern manipulates informs captures enhances Goal
Domain of Use Knowledge Design Recovery in Diamond • You get ideas from the code • But do the captures relationships hold? Dom Materials Rep (Code) Ideas Activity concern manipulates informs captures enhances Goal
Domain of Use Knowledge Design Recovery in Diamond • So when you modify the code, who knows? Dom Materials Rep (Code) Ideas Activity concern manipulates informs captures enhances Goal
Could even be your own code • You’ve often recovering, in some sense ???
Also, remember • Design recovery recreates design abstractions from • Code • Existing design documentation (if available) • Personal experience • General knowledge about problem and application domains
Domain of Use Knowledge Design Recovery in Diamond • Every part is involved Dom Materials Representation Ideas Activity concern manipulates informs captures enhances Goal
Isn’t this Reverse Engineering? • Not just recreating the UML diagram… • Program flows • Rationale • Metaphor
Also like a double-waterfall… • General model for recovery (Byrne, 1992) Alteration Reverse Engineering Abstraction Con- ceptual re-think Con- ceptual Forward Engineering Refinement re-specify Requirements Requirements re-design Design Design re-build Implementation Implementation Existing System Target System
Finding the structure(not the same as the design) • Entities • Classes • Methods • Variables • Relationships • Inheritance • Method calls • References
Approaches • Reverse engineering tools • E.g. Omondo • Reading documentation • Code reading • Reading class names • Talking to people
But where’s the design? What principles were applied? What were their priorities? What patterns emerged? What actual patterns were used? • This will save you a lot of trouble
Jetris Design Recovery • Run the game • Reading names • What is HTMLLink? • What is Figures.java? • What’s with those arrays? • What about the big classes? • Omondo
What will you actually create? • It depends: • How difficult? • Who else? • The future…
The other side of the coin… • How easy is your program to understand? • How is your: • Documentation • Naming • Code
Assignment 4 • Recover the design of Cake • Layered design environment, uses Archstudio’s BnA Framework • You may use any tools you like • Each group: • A Complete UML (-ish) Diagram • Each group member: • A 4-6 page double-spaced paper explaining your understanding of the program’s design, including patterns, principles etc. • Must provide good high and low level explanation • Due Sunday at Midnight • Email to abaker@ics.uci.edu and andre@ics.uci.edu • Paper copies in class on Monday
Possible subjects • What types of classes appear • What do they do? What do they mean? • What do other specific classes do? • How to they all relate? • How is layering implemented? • What was the effect of using BnA in the design? • What principles might have guided the design?
Some tips • Won’t have room for rote completeness, will need to be elegant • Use representations of classes to organize • Look for implements relationships
Useful links • Archstudio Source • http://www.isr.uci.edu/projects/archstudio/setup-fromsource.html • Descriptions for BnA Package Classes • http://www.isr.uci.edu/projects/archstudio/javadoc/archstudio/edu/uci/ics/bna/package-summary.html • BNA Hierarchy • http://www.isr.uci.edu/projects/archstudio/javadoc/archstudio/edu/uci/ics/bna/package-tree.html