Modular Analysis of Formal Design Models

34
07/04/22 1 Yuanfang Cai Modular Analysis of Formal Design Models Kevin Sullivan

description

Modular Analysis of Formal Design Models. Yuanfang Cai. Kevin Sullivan. Problem Analysis. A Real Story. Change Impact Change Options Refactor or not …. Reasoning. Economic-Oriented Properties. Design Structure. Current Design Representations are not Designed for this Purpose. - PowerPoint PPT Presentation

Transcript of Modular Analysis of Formal Design Models

Page 1: Modular Analysis of  Formal Design Models

04/22/23 1

Yuanfang Cai

Modular Analysis of Formal Design Models

Kevin Sullivan

Page 2: Modular Analysis of  Formal Design Models

04/22/23 2

Problem Analysis

A Real Story

Change Impact Change Options Refactor or not …

Economic-Oriented Properties

Reasoning

Design Structure

Current Design Representations are not Designed for this Purpose

Page 3: Modular Analysis of  Formal Design Models

04/22/23 3

Modularity in Design: Formal Modeling and Automated Analysis

Value-oriented Decision-Making: Theory and ToolAnalyzable Design Modeling Framework

Traditional Design Representations Emerging New Approach Formal Models and Analysis Tool (CS05)

Scalability Issue of Formal Techniques

Page 4: Modular Analysis of  Formal Design Models

04/22/23 4

(A) (B)

Choose which? “information hiding”?“memory size”, “input size”?

Environment condition? Implicit design decisions? Design structure reasoning? Evolvability analysis? Quantitative analysis?

Traditional Design Representations

Page 5: Modular Analysis of  Formal Design Models

04/22/23 5

Emerging New Approach

“Design Rule: the Power of Modularity” [Baldwin 00] Design Rules Modeling: Design Structure Matrix (DSM)

[Steward81,Eppinger91] Economic Analysis: Net Option Value (NOV)

“The Structure and Value of Modularity” [SWC01]

Page 6: Modular Analysis of  Formal Design Models

04/22/23 6

A B C D E F G H I J K L M

A - In Sig . X X

B - In Data X . X X X X X XC - In Impl X X .

D - Circ Sig . X X

E - Circ Data X X . X X XF - Circ Impl X X X .

G - Alph Sig . X X

H - Alph Data X X X . X XI - Alph Impl X X X X .

J - Out Sig . X X

K - Out Data X . XL - Out Impl X X X X .M - Master X X X X .

Design Variables Dependences Design Rule Proto-Modules Reorder

Design Structure Matrix (DSM)Input Circular Shift

OutputAlphabetizing Master Control

Page 7: Modular Analysis of  Formal Design Models

04/22/23 7

X Y Z A D G J B E H K C F I L M

X - Computer .

Y - Corpus X . X

Z - User X .

A - In Type .

D - Circ Type .

G - Alph Type .

J - Out Type .

B -In Data X X . X X

E - Circ Data X X X . X

H - Alph Data X X X X .

K - Out Data X X .

C - In Alg X X X X .

F - Circ Alg X X X X X .

I - Alph Alg X X X X X X X .

L - Out Alg X X X X X X .

M - Master X X X X X .

X Y Z N A D G J O P B C E F H I K L M

X - Computer .

Y - Corpus X . X

Z - User X .

N - Line Type .

A - In Type .

D - Circ Type .

G - Alph Type .

J - Out Type .

O - Line Data X X X . X

P - Line Alg X X X X .

B - Input Data X X X . X

C - Input Alg X X X X X .

E - Circ Data X X X X . X

F - Circ Alg X X X X X .

H - Alph Data X X X X . X

I - Alph Alg X X X X X X .

K - Out Data X X X . X

L - Out Alg X X X X X .

M - Master X X X X X X .

Design Structure Matrix (DSM)

(A) Sequential Design(B) Information Hiding Design

Page 8: Modular Analysis of  Formal Design Models

04/22/23 8

New Approach Summary

General Object-Oriented (OO), Aspect-Oriented (AO) [SGSC05] Generalized Information Hiding Interface

Represent Software Coupling Structure Constantine, Stevens, Brooks…. Call Graph, Reflexion Model [Murphy 95], Lattix

Make Information Hiding Criterion Precise Design Rules are Invariant to Environment Change

Analyze Software Quantitatively Connections to Existing Methods around DSMs

Page 9: Modular Analysis of  Formal Design Models

04/22/23 9

DSM Limitations

Very hard to build Can’t represent possible choices

Input Condition? Core Size?

Design Impact Analysis? What if x changes from x1 to x2? How many ways?

Ambiguous What is “dependence?”

a b c c d e

A D G J B E H K C F I L M

A - Input Sig .

D - Circ Sig .

G - Alph Sig .

J - Out Sig .

B - In Data . X X

E - Circ Data X . X

H - Alph Data X X .

K - Out Data .

C - Input Impl X X .

F - Circ Impl X X X .

I - Alph Impl X X X X .

L - Out Impl X X X X .

M - Master Impl X X X X .

Page 10: Modular Analysis of  Formal Design Models

04/22/23 10

1. Variables Design Dimensions

2. Values Possible Choices

3. Constraints Relations Among Decisions

Constraint Network

input_ds:{core4,disk,core0,other};envr_input_size:{small,medium,large};input_ds = disk => envr_input_size = large;

X Y Z N A D G J O P B C E F H I K L M

X - Computer .

Y - Corpus X . X

Z - User X .

N - Line Type .

A - In Type .

D - Circ Type .

G - Alph Type .

J - Out Type .

O - Line Data X X X . X

P - Line Alg X X X X .

B - Input Data X X X . X

C - Input Alg X X X X X .

E - Circ Data X X X X . X

F - Circ Alg X X X X X .

H - Alph Data X X X X . X

I - Alph Alg X X X X X X .

K - Out Data X X X . X

L - Out Alg X X X X X .

M - Master X X X X X X .

Page 11: Modular Analysis of  Formal Design Models

04/22/23 11

1. Constraint Network2. Dominance Relation

Design Rules Environment

3. Clustering

Augmented Constraint Network (ACN)

(input_impl, input_ADT)(input_impl, input_format)

X Y Z N A D G J O P B C E F H I K L M

X - Computer .

Y - Corpus X . X

Z - User X .

N - Line Type .

A - In Type .

D - Circ Type .

G - Alph Type .

J - Out Type .

O - Line Data X X X . X

P - Line Alg X X X X .

B - Input Data X X X . X

C - Input Alg X X X X X .

E - Circ Data X X X X . X

F - Circ Alg X X X X X .

H - Alph Data X X X X . X

I - Alph Alg X X X X X X .

K - Out Data X X X . X

L - Out Alg X X X X X .

M - Master X X X X X X .

Environment: {envr_input_format, envr_core,…}Design Rules: {input_ADT, circ_ADT…}

Page 12: Modular Analysis of  Formal Design Models

04/22/23 12

Analyzable Models

2. Dominance Relation

DesignSpace matrix{DesignSpace matrix{client:{dense, sparse};client:{dense, sparse};ds:{list_ds, array_ds, other_ds};ds:{list_ds, array_ds, other_ds};alg:{array_alg, list_alg, other_alg};alg:{array_alg, list_alg, other_alg};ds = array_ds => client = dense;ds = array_ds => client = dense;ds = list_ds => client = sparse;ds = list_ds => client = sparse;alg = array_alg => ds = array_ds;alg = array_alg => ds = array_ds;alg = list_alg => ds = list_ds;alg = list_alg => ds = list_ds;

}}

{(ds, client), (alg, client)}{(ds, client), (alg, client)}

Environment Cluster: {client}Environment Cluster: {client}Design Cluster: {ds, alg}Design Cluster: {ds, alg}

1. Constraint Network

3. Clustering

Analyses Design Change Impacts Precise DSM Analyses

Design Automaton Change Dynamics Design Space Design Evolution

Page 13: Modular Analysis of  Formal Design Models

04/22/23 13

Design Automaton

client = denseds = array_dsalg = array_alg

client = sparseds = list_dsalg = list_alg

client = denseds = array_dsalg = other_alg

client = sparseds = list_dsalg = other_alg

client = denseds = other_dsalg = other_alg

client = sparseds = other_dsalg = other_alg

S1

S2

client = sparse

client = sparsealg = other_alg

client = sparseds = other_ds

1. Non-deterministic; 2. Minimal Perturbation;3. Respect Dominance Relation

ds = list_ds

alg = other_alg

S3 S4

S5

S6

Design Impact Analysis

Page 14: Modular Analysis of  Formal Design Models

04/22/23 14

Design Automaton

client = denseds = array_dsalg = array_alg

client = sparseds = list_dsalg = list_alg

client = denseds = array_dsalg = other_alg

client = sparseds = list_dsalg = other_alg

client = denseds = other_dsalg = other_alg

client = sparseds = other_dsalg = other_alg

S1

S2

client = sparse

client = sparsealg = other_alg

client = sparse

ds = other_ds

Precise Definition of Pair-wise Dependence – DSM Derivation

  1 2 3

1.client .    

2.ds .

3.alg .

xx

xxxx

xx

S3 S4

S5

S6

Page 15: Modular Analysis of  Formal Design Models

04/22/23 15

Our Tool: Simon

Design Impact Analysis

Design Structure Matrices

Net Option Value

Other DSM Analyses: scheduling, cycle detection...

Design Automaton

Cluster SetDominance Relation

Constraint Network

Pair-wise Dependence

Augmented Constraint Network (ACN)

Modeling

Analysis

User Input

Derive

Derive

A C

luster

Page 16: Modular Analysis of  Formal Design Models

04/22/23 16

KWIC Regenerated

Sequential Design Information Hiding Design

Page 17: Modular Analysis of  Formal Design Models

04/22/23 17

S179

S555

S558

S102

S19

C4

C5

C1C2

C3 S18

input_impl

C1 envr_input_format = new 1 1C2 envr_input_size = large 7 2C3 envr_input_size = small 0 0C4 envr_alph_policy = partial 3 2C5 envr_alph_policy = search 3 2

alph_dsalph_imploutput_impl

alph_dsalph_imploutput_impl

input_dsalph_dscirc_dsinput_implcirc_implalph_imploutput_impl

S155

S2476S1284

S75

S1535

C4

C5

C1

C2C3

S1034

input_impl

alph_dsalph_impl

alph_dsalph_impl

linestorage_dslinestorage_impl

(b) KWIC IH DA(a) KWIC SD DA

S865

C2

Design Impact Analysis

(A) Sequential Design (B) Information Hiding Design

Page 18: Modular Analysis of  Formal Design Models

04/22/23 18

Scalability Issue

Constraint Solving

Explicit Solution Enumeration

Intolerable Performance

Page 19: Modular Analysis of  Formal Design Models

04/22/23 19

Model Decomposition

1: linestorage_impl = orig => linestorage_ADT = orig && linestorage_ds = core4;

2: linestorage_ds = core4 => envr_input_size = medium || envr_input_size = small;

3: linestorage_ds = core0 => envr_input_size = small && envr_core_size = large;

4: linestorage_ds = disk => envr_input_size = large;

5: circ_ds = copy => envr_input_size = small || envr_core_size = large;

6: circ_impl = orig => circ_ADT = orig && circ_ds = index && linestorage_ADT = orig;

(1) Construct CNF Graph (2) Cut Edges According to the Dominance Relation of the ACN(3) Create Condensation Graph(4) Compose Sub-ACN

Page 20: Modular Analysis of  Formal Design Models

04/22/23 20

Construct CNF Graph

(¬linestorage impl = orig linestorage ADT = orig) (¬linestorage impl = orig linestorage ds = core4) (¬linestorage ds = core4 envr input size = medium || envr input size = small) (¬linestorage ds = core0 envr input size = small) (¬linestorage ds = core0 envr core size = large) (¬linestorage ds = disk envr input size = large) (¬circ ds = copy envr input size = small envr core size = large) (¬circ impl = orig circ ADT = orig) (¬circ impl = orig circ ds = index) (¬circ impl = orig linestorage ADT = orig)

Page 21: Modular Analysis of  Formal Design Models

04/22/23 21

Construct CNF Graph(¬circ_ds = copy envr_input_size = small envr_core_size = large)

(¬linestorage_ds = core0 envr input size = small)

envr_input_size envr_core_size

circ_dslinestorage_ds

circ_impllinestorage_impl

linestorage_ADT

circ_ADT

(1) Construct CNF Graph (2) Cut Edges According to Dominance Relation

Page 22: Modular Analysis of  Formal Design Models

04/22/23 22

Construct Condensation Graphenvr_input_size

envr_core_size

linestorage_ADT linestorage_ds

linestorage_impl

envr_input_size

envr_core_size

linestorage_ADT

circ_ADT

circ_ds,

circ_impl

envr_input_size

envr_core_size

linestorage_ADT

circ_ADTlinestorage_ds

linestorage_impl circ_ds

circ_impl

Line Storage Function Circular Shift Function

Page 23: Modular Analysis of  Formal Design Models

04/22/23 23

KWIC Decomposed

Information Hiding

(20 ACN Variables)

Sequential Design

(18 ACN Variables)

Page 24: Modular Analysis of  Formal Design Models

04/22/23 24

Result Integration---1. Design Impact Analysis

1: envr_input_size = medium

2: envr_core_size = small

3: linestorage_ADT = orig

4: linestorage_ds = core4

5: linestorage_impl = orig

6: circ_ADT = orig

7: circ_ds = index

8: circ_impl = orig

L0

L2

L3

C0 C1

1:

2:

3:

6:

7:

8:

1:

2:

3:

4:

5:

1: envr_input_size = large

2: envr_core_size = small

3: linestorage_ADT = orig

4: linestorage_ds = disk

5: linestorage_impl = other

6: circ_ADT = orig

7: circ_ds = core4

8: circ_impl = orig

1: envr_input_size = large

2: envr_core_size = small

3: linestorage_ADT = orig

4: linestorage_ds = other

5: linestorage_impl = other

6: circ_ADT = orig

7: circ_ds = core4

8: circ_impl = orig

envr_input_size = large

1:

2:

3:

4:

5:

1:

2:

3:

4:

5:

1:

2:

3:

6:

7:

8:

Design Impact Analysis

envr_input_size = large

envr_input_size = large

Input 1: Original Design

Input 2: A Change

envr_input_size = large

Output

Page 25: Modular Analysis of  Formal Design Models

04/22/23 25

Result Integration--- 2. DSM Generation

Pair-wise Dependence Relation

Page 26: Modular Analysis of  Formal Design Models

04/22/23 26

Generalizability--- WineryLocator

Page 27: Modular Analysis of  Formal Design Models

04/22/23 27

Generalizability--- WineryLocator [Lopes05]

(1) Missing Transitive Dependences (2) Ambiguities(3) Potential Problems in Quantitative Analysis

Page 28: Modular Analysis of  Formal Design Models

04/22/23 28

6 Main Functions

5 “Crosscutting” Functions

No Crosscutting

Generalizability--- HyperCast

Page 29: Modular Analysis of  Formal Design Models

04/22/23 29

(1) Missing Transitive Dependences (2) Potential Problems in Quantitative Analysis

Generalizability--- HyperCast [SGSC05]

Page 30: Modular Analysis of  Formal Design Models

04/22/23 30

In Summary

Evolvability and Modularity Analysis From Formal Models

Reasonable PerformanceConfirm or Reveal Errors in Previous WorkArchitectural Slicing

Page 31: Modular Analysis of  Formal Design Models

04/22/23 31

Related Work

Constraint Network Decomposition Choueiry and Noubir [CN98] Dechter and Peal [DP89] Freuder and Hubbe [FH93]

Bottom-up Clustering Hutchens and Basili [HB95] Schwanke [S91] Mancoridis [MMRC98]

Page 32: Modular Analysis of  Formal Design Models

04/22/23 32

Related Work

Alloy Jackson [J06]

DSM MacCormack, Rusnak, and Baldwin [MRB05]

Lattix—A Commercial Tool Sangal, Jordan, Sinha, and Jackson [SJSJ05]

Traditional Design Impact Analysis Robert Arnold and Shawn Bohner [AB96]

Page 33: Modular Analysis of  Formal Design Models

04/22/23 33

Future Work

Improve Language NotationDirect SAT SolverEmpirical StudyIntegrate Design with:

Code: Combine with recovered design Specification: Specification provides an

environment Value: A Real Story

Page 34: Modular Analysis of  Formal Design Models

04/22/23 34

Questions?