Design Recovery. Today’s Lecture Reverse engineering Assignment 3 Benumbered design continued (if...

Post on 13-Dec-2015

212 views 0 download

Tags:

Transcript of Design Recovery. Today’s Lecture Reverse engineering Assignment 3 Benumbered design continued (if...

Design Recovery

Today’s Lecture

Reverse engineering

Assignment 3

Benumbered design continued (if time)

Reverse Engineering

Recreating design abstractions from: Code Existing design documentation (if available)

Personal experience / general knowledge about problem and application domains

Talking to people

(Biggerstaff, 1989)

Design Recovery We might need

Formal specifications Dataflows Underlying patterns Informal knowledge

We want to understand What How Why

This might be more than just re-creating…

Why do we have to do this?

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

Debugging Maintenance Modification Reuse

Working with your own code You will work with code in the absence of a

complete design

Why do we have to do this?

No designLost designBuild-and-fixedAgile methodologies

Design driftCommon!

Incomprehensible design

Design Recovery’s Goals

Recover lost information Cope with complexity Generate alternate views

Detect side effects Facilitate Reuse

(Chikofsky and Cross, 1990)

Design Recovery Tips

Object Orientation

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

members, etc.)

High cohesion helpsA holistic sense of purpose

Finding the structure

Entities Classes Methods Variables

Relationships Inheritance Member Objects Method calls

Approaches Reverse engineering tools

E.g. Omondo Running the program Eclipse’s References and Declarations Reading documentation Reading class names Talking to people Code reading

Also, remember

Existing artifacts, but also Personal experience Knowledge about problem Knowledge about the context Knowledge about solution

A (Small) Example

addAllPixels(Image image){

for(int i = 0; i < image.getWidth(); i++){

for(int j = 0; j < image.getHeight(); j++){

Color c = image.getColor(i, j);

addPixel(new Pixel(i, j, c));

addToColumn(i, new Pixel(i, j, c));

updateColorTotals(c);

}}}

We might be able to guess that:

Need for a pixel class Different instances for

addPixeladdToColumn

Concerned about speedNot so much about space

Concerned about changability?Or just following convention

Could have just been

addAllValues(ImageNumber n){

for(int i = 0; i < image.height; i++){

for(int j = 0; j < image.height; j++){

colorArray[n][i][j] = image.colorAt(i, j);

}}}

Assignment 3 – Design Recovery

Recover the design of Calico (surprise!)Tool for electronic whiteboard software design

developed at UC IrvineYou may use any tools you likeDo not ask anyone about it (despite that

normally being a good resource)

Get the Calico code from the subversion repository, detailed instructions follow

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 Calico (at least 4 pages) Your audience is someone unfamiliar with Calico who needs to

make very significant changes to it The code may not compile Your submission graded on completeness, clarity, accuracy

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

Paper copy due Thursday, February 4th, at start of class

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

Further tips

There are papers available on Calico on André's website; feel free to consult them

Use representations of classes to organize

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

Team AssignmentsTeam 1 Warren Applebaum Stacey Dao Sam Kaufman Kyle Lutze Ryan Nissenbaum

Team 2 James Benson Hunter Gillane Garrett Kim Francesco Mantovani Hiroe Ono

Team 3 Alex Chung Sohrab Hejazi Tae Kim Michael Merchant Matthew Palmer

Team 4 Andrew Ziming Ryan Hsu Frank Morales Joshua Papa Jordaniel Wolk

Team 5 Jessie Danielson Simon Huynh Patrick Lu Kyle Musler Sean Tsusaki Leo Zen

Detailed Checkout Instructions

Two Steps:

1) Install Subclipse plugin for Eclipse

2) Check out the Calico repository

NB: this assumes that you're using Eclipse and are otherwise comfortable with it.

Detailed Checkout Instructions1. In Eclipse, go to Help > Software Updates > “Available Software” tab

Detailed Checkout Instructions2. Hit “add site”, enter location: http://subclipse.tigris.org/update_1.4.x

Detailed Checkout Instructions3. Hit “OK” => Check the Subclipse main box => hit “Install”

Detailed Checkout Instructions4. Make sure everything is checked off and hit “Finish”

Detailed Checkout Instructions5. Let the libraries download => hit “Yes” at this dialogue box

Detailed Checkout Instructions6. Make a new Project (NOT Java Project) and choose this

Detailed Checkout Instructions7. Make a new repository location

Detailed Checkout Instructions8. Enter https://calico.ics.uci.edu/svn/calico3client/tags/inf122/ and hit

“next”

Detailed Checkout Instructions9. Select the root of the tree => hit “Next” (NOT “Finish”)

Detailed Checkout Instructions10. Check out in the workspace => give it a name => hit “Finish”

Server Checkout To checkout the server version, you will need to repeat steps 6 through

10. Just replace the SVN URL with:

https://calico.ics.uci.edu/svn/calico3server/tags/inf122

Note: You will need to login with your ICS username and password.

(If you receive any SSL certificate errors, you can safely ignore them)

If you have any problems, please feel free to email mitch.dempsey@uci.edu or stop by my office (ICS2 room 110)