detecting system cycles with dsm · •applied to dependency in software reengineering ... •pros...

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

Upload: others

Post on 29-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

DETECTINGSYSTEM CYCLES WITH DSM

Jannik LavalPhD Student - RMod Team

http://rmod.lille.inria.fr

!"#$

Page 2: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

DSM?

• Dependency Structural Matrix

• How to organize tasks based on their dependencies?

Page 3: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

ROADMAP

• A cycle?

• What is DSM?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 4: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

ROADMAP

• A cycle?

• What is DSM?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 5: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

A CYCLE

• a path which comes back to its origin

• between 2 or more elements

A B

C D

Page 6: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

CYCLE PROBLEMS

• Dependency logic

• Modular?

• Build dependenciesA B

C D

Page 7: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

YOU SAID GRAPH?

Page 8: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

ROADMAP

• A cycle?

• What is DSM?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 9: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

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 SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

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 SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

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 SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

DEPENDENCIES

• Inheritances

• Direct class references

• Invocations

• Extensions

Page 13: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

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 SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

ROADMAP

• A cycle?

• What is DSM?

• detecting cycles

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 15: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

2 METHODS TO DETECT CYCLES

• Squared adjacency matrix

• Path searching

Page 16: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

SQUARED ADJACENCY MATRIX

Page 17: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

SQUARED ADJACENCY MATRIX

• Pros

• mathematical approach

• Cons

• blurry cycles

• no information about path

Page 18: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

PATH SEARCHING

Page 19: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

PATH SEARCHING

• Pros

• information about path

• Cons

• slow

Page 20: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

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 SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

ROADMAP

• A cycle?

• What is DSM?

• what about cycles ?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 22: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

FOLDING CYCLES TO FIND LAYERS

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

Page 23: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

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 SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

DSM...

• Pros

• Cycle spotting

• Layer

• Cons

• Reading

• Where to fix first?

Page 25: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

ROADMAP

• A cycle?

• What is DSM?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 26: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

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 SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

ENHANCEMENT TWO: DEPENDENCIES

• Inheritances

• Direct class references

• Invocations

• Extensions

Page 28: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

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 SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

CLARIFY DEPENDENCIESNetworkTest

Page 30: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

DETECT CYCLES

Page 31: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

OFFER PROGNOSTIC

Page 32: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

DISYMMETRIC

• Remove ?

• Reverse links ?

• ???

Page 33: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

SYMMETRIC

• Merge ?

• Make two different packages ?

• ???

Page 34: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

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 SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

SEASIDE 2.9

Page 36: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

PHARO

Page 37: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

ROADMAP

• A cycle?

• What is DSM?

• Using color for cycle detection

• DSM at Work

• Advanced features (research)

Page 38: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

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 SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

EXAMPLE OF A CELL

Page 40: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

DETAILED INFORMATION

Classes in Morphic-Widgets

use classes in Morphic-Basic

Classes in Morphic-Basic

use classes in Morphic-Widgets

Page 41: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path
Page 42: DETECTING SYSTEM CYCLES WITH DSM · •Applied to dependency in software reengineering ... •Pros •mathematical approach •Cons •blurry cycles •no information about path

DSM IN SOFTWARE REENGINEERING

• Clarify dependencies

• Detect cycles

• Offer prognostic (pink/red)

• Lattix (www.lattix.com)

• http://moose.unibe.ch/