74
Collaborative and practical reverse engineering research with Moose Tudor Gîrba www.tudorgirba.com

Collaborative and practical reverse engineering research with Moose

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Collaborative and practical reverse engineering research with Moose

Collaborative and practicalreverse engineering researchwith Moose

Tudor Gîrbawww.tudorgirba.com

Page 2: Collaborative and practical reverse engineering research with Moose

forward engineering

actual development }

{

}

{

}

{

}

{}

{

}

{

}

{}

{

}

{

reve

rse

engin

eerin

g

Page 3: Collaborative and practical reverse engineering research with Moose

Moose is built in Bern

Page 4: Collaborative and practical reverse engineering research with Moose

Moose is built in Bern

Page 5: Collaborative and practical reverse engineering research with Moose

used for research in several universities

~100 men years of effort

>130 publications

since 1997

Page 6: Collaborative and practical reverse engineering research with Moose

an analysis tool

Page 7: Collaborative and practical reverse engineering research with Moose

}

{

}

{

}

{}

{

}

{

McCabe = 21

LOC =

753,0

00NOM = 102

Metrics Queries Visualizations ...

Page 8: Collaborative and practical reverse engineering research with Moose

}

{

}

{

}

{}

{

}

{

McCabe = 21

LOC =

753,0

00NOM = 102

Metrics Queries Visualizations ...

Page 9: Collaborative and practical reverse engineering research with Moose

Metrics compress systems into numbers.

NOM number of methods

LOC number of lines of code

CYCLO McCabe cyclomatic complexity

TCC tight class cohesion

...

Lorentz, Kidd, 1994Chidamber, 1994

McCabe 1977

Page 10: Collaborative and practical reverse engineering research with Moose

}

{

}

{

}

{}

{

}

{

McCabe = 21

LOC =

753,0

00NOM = 102

Metrics Queries Visualizations ...

Page 11: Collaborative and practical reverse engineering research with Moose

Queries reduce the analysis space.

Page 12: Collaborative and practical reverse engineering research with Moose

Detection Strategies are metric-based queries to detect design flaws.

METRIC 1 > Threshold 1

Rule 1

METRIC 2 < Threshold 2

Rule 2

AND Quality problem

Lanza, Marinescu 2006

Page 13: Collaborative and practical reverse engineering research with Moose

Example: a God Class centralizes too much intelligence in the system.

ATFD > FEW

Class uses directly more than a

few attributes of other classes

WMC ! VERY HIGH

Functional complexity of the

class is very high

TCC < ONE THIRD

Class cohesion is low

AND GodClass

Lanza, Marinescu, 2006

Page 14: Collaborative and practical reverse engineering research with Moose

We can always resort to Smalltalk for querying.

Page 15: Collaborative and practical reverse engineering research with Moose

}

{

}

{

}

{}

{

}

{

McCabe = 21

LOC =

753,0

00NOM = 102

Metrics Queries Visualizations ...

Page 16: Collaborative and practical reverse engineering research with Moose

Visualization compresses the system into pictures.

Page 17: Collaborative and practical reverse engineering research with Moose

Polymetric views show up to 5 metrics.

Color metric

Width metric

Height metric

Position metrics

Lanza, 2003

Page 18: Collaborative and practical reverse engineering research with Moose

System Complexity shows class hierarchies.

lines

attributes

methods

Lanza, Ducasse, 2003

Page 19: Collaborative and practical reverse engineering research with Moose

Class Blueprint shows class internals.Ducasse, Lanza, 2005

schizophrenic classtwin classes

Page 20: Collaborative and practical reverse engineering research with Moose

Package Blueprint shows how classes are used across packages. Ducasse etal, 2007

a sumo package

Page 21: Collaborative and practical reverse engineering research with Moose

Distribution Map shows properties over structure. Ducasse etal, 2006

31 parts, 394 elements and 9 properties

Page 22: Collaborative and practical reverse engineering research with Moose

Semantic Clustering reveals implementation topics.

user, run, load, message, file, buffer, util

property, AWT, edit, show, update, sp, set

start, buffer, end, text, length, line, count

action, box, component, event, button, layout, GUI

start, length, integer, end, number, pre, count

XML, dispatch, microstar, reader, XE, register, receive

current, buffer, idx, review, archive, endr, TAR

BSH, simple, invocation, assign, untype, general, arbitrary

maximum, label, link, item, code, put, vector

Kuhn etal 2006

9 concepts spread over 394 classes

Page 23: Collaborative and practical reverse engineering research with Moose

Softwarenaut explores the package structure.Lungu etal, 2006

Page 24: Collaborative and practical reverse engineering research with Moose

Code City shows where your code lives.Wettel, Lanza, 2007

classes are buildings grouped in quarters of packages

Page 25: Collaborative and practical reverse engineering research with Moose

Trace Signals reveal similar execution traces.Kuhn, Greevy 2006

lines show traces and colors denote concepts

Page 26: Collaborative and practical reverse engineering research with Moose

Feature Views show how features cover classes.Greevy etal, 2006

addFolder addPage

boxes are features and squares are classes colored by activity

Page 27: Collaborative and practical reverse engineering research with Moose

Object Dependencies show how features depend on each other.

OpenConnect

Join ChannelSend Message

Lienhard etal, 2007

dependencies between objects and their age measured in features

Page 28: Collaborative and practical reverse engineering research with Moose

Object Flow shows how objects move through the system. Lienhard etal, 2007

objects flowing through other objects

Page 29: Collaborative and practical reverse engineering research with Moose

Hierarchy Evolution reveals evolution patterns.Girba etal, 2005

histories of classes and of their inheritances

Page 30: Collaborative and practical reverse engineering research with Moose

Evolution Radar shows co-change relationships.D’Ambros, Lanza 2006

one package and its co-change relationships

Page 31: Collaborative and practical reverse engineering research with Moose

Ownership Map reveals patterns in CVS.Girba etal, 2006

Page 32: Collaborative and practical reverse engineering research with Moose

Clone Evolution shows who copied from whom.Balint etal, 2006

colors represent authors

Page 33: Collaborative and practical reverse engineering research with Moose

}

{

}

{

}

{}

{

}

{

McCabe = 21

LOC =

753,0

00NOM = 102

Metrics Queries Visualizations ...

Page 34: Collaborative and practical reverse engineering research with Moose

}

{

}

{

}

{}

{

}

{

McCabe = 21

LOC =

753,0

00NOM = 102

Metrics Queries Visualizations ...

Page 35: Collaborative and practical reverse engineering research with Moose

an analysis tool

Page 36: Collaborative and practical reverse engineering research with Moose

an analysis tool

a platform for modeling

Page 37: Collaborative and practical reverse engineering research with Moose

Class

Method

Attribute

Access

Inheritance

Package

Namespace

*

belongsTo

*

belongsTo

belongsTopackagedIn

superclass

subclass

* *

InvocationinvokedBy

candidate

*

accessedIn

*

accesses

FAMIX is a language independent meta-model.

Page 38: Collaborative and practical reverse engineering research with Moose

FAMIX

Class Method...

Page 39: Collaborative and practical reverse engineering research with Moose

FAMIX

Class Method...

Dynamix

Activation... Instance

Page 40: Collaborative and practical reverse engineering research with Moose

FAMIX

Class Method...

Dynamix

Activation... Instance

ObjectFlow

Alias...

Page 41: Collaborative and practical reverse engineering research with Moose

FAMIX

Class Method...

Dynamix

Activation... Instance

Dude

Duplication...

ObjectFlow

Alias...

Page 42: Collaborative and practical reverse engineering research with Moose

FAMIX

Class Method...

Dynamix

Activation... Instance

Dude

Duplication...

CVS

FileHistory

FileVersion

...

ObjectFlow

Alias...

Page 43: Collaborative and practical reverse engineering research with Moose

FAMIX

Class Method...

Dynamix

Activation... Instance

Dude

Duplication...

CVS

FileHistory

FileVersion

...

BugsLife

Bug Activity...

ObjectFlow

Alias...

Page 44: Collaborative and practical reverse engineering research with Moose

FAMIX

Class Method...

Dynamix

Activation... Instance

Dude

Duplication...

Hismo

ClassHistory

MethodHistory

...

CVS

FileHistory

FileVersion

...

BugsLife

Bug Activity...

ObjectFlow

Alias...

Page 45: Collaborative and practical reverse engineering research with Moose

FAMIX

Class Method...

Dynamix

Activation... Instance

Dude

Duplication...

Hismo

ClassHistory

MethodHistory

...

CVS

FileHistory

FileVersion

...

Subversion

FileHistory

FileVersion

...

BugsLife

Bug Activity...

ObjectFlow

Alias...

Page 46: Collaborative and practical reverse engineering research with Moose

FAMIX

Class Method...

Dynamix

Activation... Instance

Dude

Duplication...

Hismo

ClassHistory

MethodHistory

...

CVS

FileHistory

FileVersion

...

Subversion

FileHistory

FileVersion

...

BugsLife

Bug Activity...

ObjectFlow

Alias...

...

...

Page 47: Collaborative and practical reverse engineering research with Moose

FAMIX

Class Method...

Dynamix

Activation... Instance

Dude

Duplication...

Hismo

ClassHistory

MethodHistory

...

CVS

FileHistory

FileVersion

...

Subversion

FileHistory

FileVersion

...

BugsLife

Bug Activity...

ObjectFlow

Alias...

...

...

FAMIX is now more than a

language independent meta-model

Page 48: Collaborative and practical reverse engineering research with Moose

FAMIX Core

Class Method...

Dynamix

Activation... Instance

Dude

Duplication...

Hismo

ClassHistory

MethodHistory

...

CVS

FileHistory

FileVersion

...

Subversion

FileHistory

FileVersion

...

BugsLife

Bug Activity...

ObjectFlow

Alias...

...

...

Page 49: Collaborative and practical reverse engineering research with Moose

FAMIX

FAMIX Core

Class Method...

Dynamix

Activation... Instance

Dude

Duplication...

Hismo

ClassHistory

MethodHistory

...

CVS

FileHistory

FileVersion

...

Subversion

FileHistory

FileVersion

...

BugsLife

Bug Activity...

ObjectFlow

Alias...

...

...

Page 50: Collaborative and practical reverse engineering research with Moose

FAMIX

FAMIX Core

Class Method...

Dynamix

Activation... Instance

Dude

Duplication...

Hismo

ClassHistory

MethodHistory

...

CVS

FileHistory

FileVersion

...

Subversion

FileHistory

FileVersion

...

BugsLife

Bug Activity...

ObjectFlow

Alias...

...

...

We are now working on FAMIX 3.0.

Would you like to join?

Page 51: Collaborative and practical reverse engineering research with Moose

MSE is the exchange file format.

Page 52: Collaborative and practical reverse engineering research with Moose

Moose is based on Fame :)

Page 53: Collaborative and practical reverse engineering research with Moose

Where to get Fame from?

VisualWorks just download Moose

Java http://smallwiki.unibe.ch/fame/

Python http://smallwiki.unibe.ch/fame/

Page 54: Collaborative and practical reverse engineering research with Moose

an analysis tool

a platform for modeling

Page 55: Collaborative and practical reverse engineering research with Moose

an analysis tool

a platform for modeling

a platform for visualization

Page 56: Collaborative and practical reverse engineering research with Moose

view := ViewRenderer new.view nodes: classes forEach: [:each |

view nodes: each methods.view gridLayout].

view edgesFrom: #superclass.view treeLayout.view open.

Mondrian is an engine for scripting graph visualizations. Meyer etal 2006

Page 57: Collaborative and practical reverse engineering research with Moose

EyeSee is an engine for scripting charts.Junker, Hofstetter 2007

Page 58: Collaborative and practical reverse engineering research with Moose

CodeCity is an engine for 3D visualizations.Wettel, Lanza, 2007

Page 59: Collaborative and practical reverse engineering research with Moose

an analysis tool

a platform for modeling

a platform for visualization

Page 60: Collaborative and practical reverse engineering research with Moose

an analysis tool

a platform for modeling

a platform for visualization

a platform for building tools

Page 61: Collaborative and practical reverse engineering research with Moose

Repository Meta MondrianUIFAMIX Core

EyeSee

Page 62: Collaborative and practical reverse engineering research with Moose

MSE

Repository Meta MondrianUI

Smalltalk

Java

C++

ExternalParser

FAMIX Core

EyeSee

Page 63: Collaborative and practical reverse engineering research with Moose

MSE

Repository Meta MondrianUI

Smalltalk

Java

C++

ExternalParser

FAMIX Core

HapaxDynaMoose SoftwarenautChronia SmallDude

EyeSee

Cook CodeCity

Page 64: Collaborative and practical reverse engineering research with Moose

MSE

Repository Meta MondrianUI

Smalltalk

Java

C++

ExternalParser

FAMIX Core

HapaxDynaMoose SoftwarenautChronia SmallDude

EyeSee

Cook

CVS

CodeCity

MSE SourceJ-Wiretap

Page 65: Collaborative and practical reverse engineering research with Moose

MSE

Repository Meta MondrianUI

Smalltalk

Java

C++

ExternalParser

FAMIX Core

HapaxDynaMoose SoftwarenautChronia SmallDude

EyeSee

Cook

CVS

CodeCity

MSE SourceJ-Wiretap

YellowSubmarine

BugsLife ClusteringConceptAnalysis ...

Page 66: Collaborative and practical reverse engineering research with Moose

an analysis tool

a platform for modeling

a platform for visualization

a platform for building tools

Page 67: Collaborative and practical reverse engineering research with Moose

an analysis tool

a platform for modeling

a platform for visualization

a platform for building tools

a collaboration

Page 68: Collaborative and practical reverse engineering research with Moose

Current TeamStéphane DucasseTudor GîrbaAdrian KuhnToon Verwaest

Previous TeamSerge DemeyerMichele LanzaSander Tichelaar

Current ContributorsHani Abdeen Ilham AllouiGabriela Arevalo Mihai BalintPhilipp Bunge Marco D’AmbrosOrla Greevy Markus Hofstetter Matthias Junker Adrian LienhardMartin von Löwis Mircea LunguMichael Meyer Damien PolletSara Sellos Lucas StreitToon Verwaest Roel Wuyts Richard Wettel

Previous ContributorsTobias Aebi Frank BuchliThomas Bühler Calogero ButeraDaniel Frey Georges GolomingiDavid Gurtner Reinout HeeckMarkus Kobel Michael LocherPietro Malorgio Michael MeerLaura Ponisio Daniel RatiuMatthias Rieger Azadeh Razavizadeh Andreas Schlapbach Daniel SchweizerMauricio Seeberger Lukas SteigerDaniele Talerico Herve VerjusVioleta Voinescu.

Page 69: Collaborative and practical reverse engineering research with Moose

Current TeamStéphane DucasseTudor GîrbaAdrian KuhnToon Verwaest

Previous TeamSerge DemeyerMichele LanzaSander Tichelaar

Current ContributorsHani Abdeen Ilham AllouiGabriela Arevalo Mihai BalintPhilipp Bunge Marco D’AmbrosOrla Greevy Markus Hofstetter Matthias Junker Adrian LienhardMartin von Löwis Mircea LunguMichael Meyer Damien PolletSara Sellos Lucas StreitToon Verwaest Roel Wuyts Richard Wettel

Previous ContributorsTobias Aebi Frank BuchliThomas Bühler Calogero ButeraDaniel Frey Georges GolomingiDavid Gurtner Reinout HeeckMarkus Kobel Michael LocherPietro Malorgio Michael MeerLaura Ponisio Daniel RatiuMatthias Rieger Azadeh Razavizadeh Andreas Schlapbach Daniel SchweizerMauricio Seeberger Lukas SteigerDaniele Talerico Herve VerjusVioleta Voinescu.

~ 100 men years

Page 70: Collaborative and practical reverse engineering research with Moose

an analysis tool

a platform for modeling

a platform for visualization

a platform for building tools

a collaboration

Page 71: Collaborative and practical reverse engineering research with Moose

an analysis tool

a platform for modeling

a platform for visualization

a platform for building tools

a collaboration

an idea

Page 72: Collaborative and practical reverse engineering research with Moose

an analysis tool

a platform for modeling

a platform for visualization

a platform for building tools

a collaboration

an idea

Page 73: Collaborative and practical reverse engineering research with Moose

moose.unibe.ch