detecting cycles with dsm

42
DETECTING SYSTEM CYCLES WITH DSM Jannik Laval PhD Student - RMod Team http://rmod.lille.inria.fr !"#$

Upload: esug

Post on 20-May-2015

1.264 views

Category:

Technology


0 download

DESCRIPTION

Detecting Cycles with DSM by J. Laval, ESUG09, Brest, France.

TRANSCRIPT

Page 1: Detecting Cycles with DSM

DETECTINGSYSTEM CYCLES WITH DSM

Jannik LavalPhD Student - RMod Team

http://rmod.lille.inria.fr

!"#$

Page 2: Detecting Cycles with DSM

DSM?

• Dependency Structural Matrix

• How to organize tasks based on their dependencies?

Page 3: Detecting Cycles with DSM

ROADMAP

• A cycle?

• What is DSM?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 4: Detecting Cycles with DSM

ROADMAP

• A cycle?

• What is DSM?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 5: Detecting Cycles with DSM

A CYCLE

• a path which comes back to its origin

• between 2 or more elements

A B

C D

Page 6: Detecting Cycles with DSM

CYCLE PROBLEMS

• Dependency logic

• Modular?

• Build dependenciesA B

C D

Page 7: Detecting Cycles with DSM

YOU SAID GRAPH?

Page 8: Detecting Cycles with DSM

ROADMAP

• A cycle?

• What is DSM?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 9: Detecting Cycles with DSM

DEPENDENCY MATRIX

• Origin: process optimization

• Applied to dependency in software reengineering

• Compact

• Support cycle and layer identification

A B C DA xB x xC x xD x

Page 10: Detecting Cycles with DSM

A DEPENDENCY MATRIX

A B C D

A X

B X X

C X X

D X

A B

C D

A B C D

A 0 1 0 0

B 1 0 1 0

C 1 0 0 1

D 0 0 1 0

Page 11: Detecting Cycles with DSM

PACKAGE STRUCTURE WITH DSM

• a cell is a dependency

• information in a cell

• a column represents used packages

• a line represents using packages

A B C DA 2B 1 2C 4 8D 1

Page 12: Detecting Cycles with DSM

DEPENDENCIES

• Inheritances

• Direct class references

• Invocations

• Extensions

Page 13: Detecting Cycles with DSM

EXTENSIONS

• reverse dependencies

• structure packages by concerns

Core

asUrl

String

Network

Url

^ Url new path: self

Core

String

Network

Url

String

asUrl

^ Url new path: self

Page 14: Detecting Cycles with DSM

ROADMAP

• A cycle?

• What is DSM?

• detecting cycles

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 15: Detecting Cycles with DSM

2 METHODS TO DETECT CYCLES

• Squared adjacency matrix

• Path searching

Page 16: Detecting Cycles with DSM

SQUARED ADJACENCY MATRIX

Page 17: Detecting Cycles with DSM

SQUARED ADJACENCY MATRIX

• Pros

• mathematical approach

• Cons

• blurry cycles

• no information about path

Page 18: Detecting Cycles with DSM

PATH SEARCHING

Page 19: Detecting Cycles with DSM

PATH SEARCHING

• Pros

• information about path

• Cons

• slow

Page 20: Detecting Cycles with DSM

BLACK AND WHITE NETWORK

• what do we see?

x x x x x x x x x x

x

x

x 71 3x 2 1 8 7 6x 3x 4 51 2 2 2x 4 10 4 34 3x 15 1x 30x 2 2 6

Page 21: Detecting Cycles with DSM

ROADMAP

• A cycle?

• What is DSM?

• what about cycles ?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 22: Detecting Cycles with DSM

FOLDING CYCLES TO FIND LAYERS

• When we have cycles we can consider the packages as a single one and continue...

Page 23: Detecting Cycles with DSM

FOLDING ...1 2 3 4 5 6 7 8 9 10

1

2

3 71 34 2 1 8 7 65 36 4 51 2 2 27 4 10 4 34 38 15 19 3010 2 2 6

1 2 3+ 9 10

1

2

3+ 10 679 3010 2 8

Layer3 1 2Layer2 3+Layer1 9 10

Page 24: Detecting Cycles with DSM

DSM...

• Pros

• Cycle spotting

• Layer

• Cons

• Reading

• Where to fix first?

Page 25: Detecting Cycles with DSM

ROADMAP

• A cycle?

• What is DSM?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 26: Detecting Cycles with DSM

ENHANCEMENT ONE: COLOR

• Direct Cycle in red

• Indirect cycle in yellow

• Complexe cycle in pale blue

A B C D

A X

B X X

C X 8

D 1

Page 27: Detecting Cycles with DSM

ENHANCEMENT TWO: DEPENDENCIES

• Inheritances

• Direct class references

• Invocations

• Extensions

Page 28: Detecting Cycles with DSM

AN EXAMPLE1 2 3 4 5 6 7 8 9 10

1

2

3 71 34 2 1 8 7 65 36 4 51 2 2 27 4 10 4 34 38 15 19 3010 2 2 6

Page 29: Detecting Cycles with DSM

CLARIFY DEPENDENCIESNetworkTest

Page 30: Detecting Cycles with DSM

DETECT CYCLES

Page 31: Detecting Cycles with DSM

OFFER PROGNOSTIC

Page 32: Detecting Cycles with DSM

DISYMMETRIC

• Remove ?

• Reverse links ?

• ???

Page 33: Detecting Cycles with DSM

SYMMETRIC

• Merge ?

• Make two different packages ?

• ???

Page 34: Detecting Cycles with DSM

ROADMAP• A cycle?

• What is DSM?

• Using color for cycle detection

• DSM at Work

• Seaside 2.9 (no cycle....)

• Pharo

• Advanced features (research)

Page 35: Detecting Cycles with DSM

SEASIDE 2.9

Page 36: Detecting Cycles with DSM

PHARO

Page 37: Detecting Cycles with DSM

ROADMAP

• A cycle?

• What is DSM?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 38: Detecting Cycles with DSM

EDSMP3

P4

P2

YX Z D

P1

B A C D'

Source P1

Target P2

Background color: cycle

Tot Inh Acc Msg Ext

C

Z X Y

BA D'

D

Page 39: Detecting Cycles with DSM

EXAMPLE OF A CELL

Page 40: Detecting Cycles with DSM

DETAILED INFORMATION

Classes in Morphic-Widgets

use classes in Morphic-Basic

Classes in Morphic-Basic

use classes in Morphic-Widgets

Page 41: Detecting Cycles with DSM
Page 42: Detecting Cycles with DSM

DSM IN SOFTWARE REENGINEERING

• Clarify dependencies

• Detect cycles

• Offer prognostic (pink/red)

• Lattix (www.lattix.com)

• http://moose.unibe.ch/