towards probabilistic assessment of modularity

19
TOWARDS PROBABILISTIC ASSESSMENT OF MODULARITY Kevin Hoffman and Patrick Eugster, C.S. Department, Purdue University ACoM 2008 @ OOPSLA

Upload: kevin-hoffman

Post on 25-Dec-2014

450 views

Category:

Technology


0 download

DESCRIPTION

We propose new modularity metrics based on probabilistic computations over weighted design structure matrices, also known as dependency structure matrices.We define how these metrics are calculated, discuss some practical applications, and conclude with future work.

TRANSCRIPT

Page 1: Towards Probabilistic Assessment of Modularity

TOWARDS PROBABILISTIC

ASSESSMENT OF MODULARITY

Kevin Hoffman and Patrick Eugster, C.S. Department, Purdue University

ACoM 2008 @ OOPSLA

Page 2: Towards Probabilistic Assessment of Modularity

Questions of Interest

Q1) Which program elements are the most

depended upon?

Q2) Which program elements are the most likely to

change? (i.e. the most fragile?)

Q3) Which program elements are the most likely to

be affected by rippled effects given a set of

changes?

Q4) Which program elements were most influential

during some execution of a test case?

Page 3: Towards Probabilistic Assessment of Modularity

Strategy for Answering

Model software using Design Structure Matrices (DSMs)

Assign weights to each cell as relevant to the question

Formulate an Assessment Graph from the DSM

Normalize data to produce a time-homogenous

Markov chain

Compute the stationary distribution of the Markov

chain (à-la PageRank, EigenTrust)

Overlay visualization onto DSM

Page 4: Towards Probabilistic Assessment of Modularity

DSM Generation

Page 5: Towards Probabilistic Assessment of Modularity

Weighted DSM Generation

Weights based on knowledge of other subsystems

Weights based on actual use of other subsystems

Weight assignment strategy governed by question

Page 6: Towards Probabilistic Assessment of Modularity

Form the Assessment Graph

3

1 6

2

4

5

9

10

8

7

17

13

8

7 2

1

3

5

Page 7: Towards Probabilistic Assessment of Modularity

Normalize Edge Weights

3

1 6

2

4

5

9

10

8

7

1.0

1.0

1.0

0.778 0.222

1.0

1.0

1.0

Page 8: Towards Probabilistic Assessment of Modularity

All Nodes Have > 0 out-Edges

3

1 6

2

4

5

9

10

8

7

1.0

1.0

1.0

0.778 0.222

1.0

1.0

1.0

0.1 0.1 0.1

0.1

0.1

0.1

0.10.10.1

Page 9: Towards Probabilistic Assessment of Modularity

Metric Calculation

Weighted edge matrix of Assessment Graph now

forms a time-homogenous Markov chain

Stationary distribution of the Markov chain provides

the metric results

Calculated by finding the left eigenvector of the

transition matrix of the Markov chain

Computed using Power Iteration algorithm

“Damping factor” to ensure convergence (guarantees

aperiodicity of Markov chain)

Page 10: Towards Probabilistic Assessment of Modularity

Metric Calculation Example

Page 11: Towards Probabilistic Assessment of Modularity

Q1) Which program elements are the

most depended upon?

Calculate DSM weights based on coupling measures

Form Assessment Graph from DSM and normalize

Algorithm output defined as the…

Dependency Propagation Ranking

Page 12: Towards Probabilistic Assessment of Modularity

Q2) Which program elements are the

most likely to change?

Calculate DSM weights based on coupling measures

Form Assessment Graph from DSM and normalize

REVERSE DIRECTION of edges in graph

Algorithm output defined as the…

Impact Propagation Ranking

Impact Propagation RankingDependency Propagation Ranking

Page 13: Towards Probabilistic Assessment of Modularity

Q3) Which program elements are the most likely to be

affected by rippled effects given a set of changes?

Calculate the Impact Propagation Ranking for two

versions of a program

Define the absolute value of the difference

between these vectors to be the…

Impact Shift Ranking

Page 14: Towards Probabilistic Assessment of Modularity

Q4) Which program elements were most

influential during some execution of a test case?

Construct weighted DSM from elements in execution

traces

Which parts of execution traces

How to abstract to the appropriate level of detail?

What should be used to formulate the weights?

Form Assessment Graph from DSM and normalize

Use output of algorithm to understand Q4

Page 15: Towards Probabilistic Assessment of Modularity

Normalization Choices

By Row (Local) By Table (Global)

Page 16: Towards Probabilistic Assessment of Modularity

PetStore – Exceptions w/ AspectJ

Page 17: Towards Probabilistic Assessment of Modularity

PetStore – Exceptions w/ AJ/EJPs

Page 18: Towards Probabilistic Assessment of Modularity
Page 19: Towards Probabilistic Assessment of Modularity

Future Directions

Refine metric definitions

Appropriate normalization strategies

Other sources for weights

Logical coupling

Data flow analysis

Execution trace data

Apply to several large bodies of software

Integrated tool chain for fast visualization

Send comments and questions to [email protected]