Top Banner
Design Recovery 1 Informatics 122 Alex Baker
47

Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Dec 21, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Design Recovery 1

Informatics 122

Alex Baker

Page 2: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

What is Design Recovery?

Sort of like reverse engineering

Page 3: 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)

Page 4: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

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)

Page 5: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Also like a double-waterfall…

General model for recovery (Byrne, 1992)

Existing System Target System

Implementation

Design

Requirements Requirements

Con-ceptual

Con-ceptual

Design

Implementation

re-think

re-specify

re-design

re-build

Alteration

ReverseEngineeringAbstraction

ForwardEngineeringRefinement

Page 6: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Why do we need to know this? Working with others’ code…

Debugging

Maintenance

Reuse

Working with your own code

Page 7: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Motivation: No design

Lost design Build-and-fixed Agile methodologies

Incomprehensible design

Page 8: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Motivation: Design Drift

Page 9: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Motivation: Design Drift

Design not followed

Page 10: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Motivation: Design Drift

Design deviations

Page 11: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Motivation: Design Drift

Design deviations

Page 12: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Motivation: Design Drift

Design deviations

?

Page 13: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Motivation: Design Drift

Design deviations

Page 14: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

???

Motivation: Design Drift

Design deviations

???

Page 15: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

???

Motivation: Design Drift

Design deviations

???

Page 16: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

???

Motivation: Design Drift

Design deviations

???

Page 17: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Motivation: Design Drift

???

Page 18: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Motivation: Design Drift

???

Page 19: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Could even be your own code

You’re often recovering, in some sense

???

Page 20: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Design Recovery in our Models

Feasible Desirable

Conceivable

Outcome Space

Design Space

Page 21: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Design Recovery (Product)

Feasible Desirable

Conceivable

Outcome Space

Design Space

Page 22: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Design Recovery (Product)

Feasible Desirable

Conceivable

Outcome Space

Design Space

Page 23: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Design Recovery (Product)

Feasible Desirable

Conceivable

Outcome Space

Design Space

Page 24: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Design Recovery in Our Models

activities

goals (languages) knowledge (languages)

ideas (languages) representations (languages)

tools

Page 25: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Design Recovery (Process)

activities

Ideas (languages) representations (languages)

activities

Ideas (languages)

representations (languages)

if(condition) functionCall(X);else functionCall(Y);

Page 26: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Design Recovery (Process)

activities

Ideas (languages) representations (languages)

activities

Ideas (languages)

representations (languages)

if(condition) functionCall(X);else functionCall(Y);

Page 27: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Design Recovery (Process)

activities

Ideas (languages) representations (languages)

activities

Ideas (languages)

representations (languages)

if(condition) functionCall(X);else functionCall(Y);

Page 28: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Design Recovery (Process)

activities

Ideas (languages) representations (languages)

activities

Ideas (languages)

representations (languages)

if(condition) functionCall(X);else functionCall(Y);

goals

knowledge

Page 29: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Design Recovery (Process)

activities

goals (languages) knowledge (languages)

ideas (languages) representations (languages)

tools

Page 30: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Also, remember

Design recovery recreates design abstractions from Code Existing design documentation (if available) Personal experience General knowledge about problem and

application domains

Page 31: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Isn’t this Reverse Engineering?

Not just recreating the UML diagram… Program flows Rationale Metaphor

Page 32: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Object Orientation

Something of an advantageClass names, function namesEstablished relationships (inheritance,

members, etc.)

Important details can be subtle

Page 33: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

The Ideal Program (again!)

vs.

Page 34: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Also like a double-waterfall…

General model for recovery (Byrne, 1992)

Existing System Target System

Implementation

Design

Requirements Requirements

Con-ceptual

Con-ceptual

Design

Implementation

re-think

re-specify

re-design

re-build

Alteration

ReverseEngineeringAbstraction

ForwardEngineeringRefinement

Page 35: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Finding the structure(not the same as the design) Entities

Classes Methods Variables

Relationships Inheritance Member Objects Method calls

Page 36: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Approaches

Reverse engineering toolsE.g. Omondo

Reading documentation Code reading Reading class names Talking to people

Page 37: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

But where’s the design?

What principles were applied?What were their priorities?What patterns emerged?What actual patterns were used?

What would developers making changes need to consider?

This will save you a lot of trouble

Page 38: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

An example: Jetris

http://jetris.sourceforge.net/

Page 39: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Jetris Design Recovery

Run the game Reading names What is HTMLLink? What is Figures.java? FigureFactory? TetrisGrid (wait, what’s with those arrays?) AddFigure, dropNext, addFigureToGrid… Actual loop? (nextMove) UI

Page 40: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Goals and Knowledge

Of Tetris

Based on other artifacts (running program)

Of tendencies?

Patterns?

Page 41: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

What will you actually create? It depends:

How difficult? Who else? The future…

We could make UML UI map Program flow Depiction of array metaphors …

Page 42: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

The other side of the coin…

How easy is your program to understand?

How is your: Documentation Naming Code

Page 43: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Assignment 3 – Design Recovery

Recover the design of VBoardSketching program developed for software

engineering researchYou may use any tools you like

Get the VBoard code from the subversion repository, detailed instructions are here:http://vboard.bhnet.us/download/VBoard/

Page 44: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Assignment 3 – Design Recovery Each group must turn in:

A Complete UML (-ish) Diagram At least 1 additional diagram of your choice (might be informal) A document describing the design of VBoard (at least 4 pages)

Your audience is someone unfamiliar with VBoard who needs to make very significant changes to it

Graded on completeness, clarity, accuracy

Each person also needs to submit a team evaluation (forms available on class webpage)

Paper copy due Tuesday, Oct. 29th, at start of class

Page 45: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Suggestions for Group Work

Everyone start by taking their own look at the whole systemMultiple perspectives will be very useful

Work out the high level architecture Understand program flows Look out for subtle details

Page 46: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Further tips

Use representations of classes to organize

Rote completeness is not the answer, will need to be elegant

Page 47: Design Recovery 1 Informatics 122 Alex Baker. What is Design Recovery? Sort of like reverse engineering.

Team AssignmentsTeam 1 BAMBAEEROW, CAMERON DAUZ, JONATHAN JONAS, NICHOLAS LAVAVESHKUL, MICHAEL SHI, LINDA

Team 2 DEMPSEY, MITCHELL KOLLA, SUBODH LAM, CYNTHIA LEE, RICK STEWART, DAVID

Team 3 BEDFORD, AURORA CHIU, ARTHUR DYKZEUL, BRADLEY IGNACIO, JAN YEGANYAN, MICHAEL

Team 4 BAUTISTA, JEREMIAH BOSCH, CHRISTOPHER ESQUENAZI, NATHAN PURPURA, DAVID

Team 5 CHISLOM, ALTON HIRANO, SEN KWOK, MATHEW SAM, VINH

Team 6 HUANG, ALLEN KNOBEL, JACOB LIU, ZHE SHAFER, THOMAS