synthesizing partial component-level behavior models

27
Synthesizing Partial Component-Level Behavior Models Ivo Krka

Upload: frye

Post on 22-Feb-2016

54 views

Category:

Documents


0 download

DESCRIPTION

Synthesizing Partial Component-Level Behavior Models. Ivo Krka. Outline. Motivation and Background The Synthesis Algorithm Discovery of Discrepancies Conclusions. Motivation. Early in a software system’s life cycle Uncertainty Incomplete (partial) information - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Synthesizing Partial Component-Level Behavior Models

Synthesizing Partial Component-Level Behavior

Models

Ivo Krka

Page 2: Synthesizing Partial Component-Level Behavior Models

Outline

1. Motivation and Background

2. The Synthesis Algorithm

3. Discovery of Discrepancies

4. Conclusions

Page 3: Synthesizing Partial Component-Level Behavior Models

Motivation

• Early in a software system’s life cycle• Uncertainty• Incomplete (partial) information

• Utilized behavior specifications• Intuitive and straightforward• Focused and partial• System-level

• Our work leverages• Properties (OCL constraints)• Scenarios (UML sequence diagrams)

Page 4: Synthesizing Partial Component-Level Behavior Models

Web Cache Scenario

Client Cache Server

requestCache

requestServer

responseServer

responseCache

requestCache

responseCache

Page 5: Synthesizing Partial Component-Level Behavior Models

Web Cache Constraints

cached: true if the data is cached and false otherwise

pending: true if there is a pending client request for data, and false otherwise

System domain variables

Page 6: Synthesizing Partial Component-Level Behavior Models

Synthesis of Behavioral Models

• Behavioral models proven useful• Validation, analysis, etc.

• Complete component-level models• E.g., Whittle [1], Mäkinen [2], Damas [3]• Overlook the partiality of specs (Uchitel [4])

Page 7: Synthesizing Partial Component-Level Behavior Models

Abstracting the Problem

Page 8: Synthesizing Partial Component-Level Behavior Models

Modal Transition Systems (MTS)

• Two types of transitions• Required and maybe (marked with ?)

S1 S2 S3a b?

MTS M

Page 9: Synthesizing Partial Component-Level Behavior Models

The Proposed Algorithm

• Partial-behavior models• Behavior required by scenarios• Behavior prohibited by constraints• Behavior neither required nor prohibited

• Component-level models• Better scaling with system size• Discovery of specification discrepancies

Page 10: Synthesizing Partial Component-Level Behavior Models

Algorithm Overview

OCL, SDs

Component

Constraint Generatio

n

Initial MTS Generatio

n

Sequence Diagram

Annotation

Final MTS Generatio

n

Comp. MTSs

1 2

3 4

Page 11: Synthesizing Partial Component-Level Behavior Models

Phase 1: Component Constraint Generation Initial MTS

Generation

Sequence Diagram

AnnotationFinal MTS

Generation

Component

Constraint

Generation

pending: significant variable from Client’s perspective

cached: does not directly affect Client’s behavior

Client component• Not all variables affect

each component

• Reduction in state space size

Page 12: Synthesizing Partial Component-Level Behavior Models

Phase 2: Initial MTS Generation

Sequence Diagram

AnnotationFinal MTS

Generation

Component Constraint Generation

Initial MTS

Generation

S1 (F,F)

S2 (F,T)

S3 (T,F)

respServ?

MTS Cache (p,c)

reqCache?

respServ?

S4 (T,T)

reqCache?

reqServ?

respCache?

respServ?

respServ?

• Initial MTS captures all legal behavior

Page 13: Synthesizing Partial Component-Level Behavior Models

Phase 3: Sequence Diagram Annotation Initial MTS

Generation

Final MTS Generation

Component Constraint Generation

Sequence Diagram

Annotation

CachereqCache

reqServ

respServ

respCache

reqCache

respCache

annotations: <pending,cached>

<F,?>

<T,F>

<T,F><T,?>

<?,T>

<?,?>

<T,T>

<F,T>

<F,?>

<T,?>

<T,T>

<F,T>

Page 14: Synthesizing Partial Component-Level Behavior Models

Phase 3: Sequence Diagram Annotation Initial MTS

Generation

Final MTS Generation

Component Constraint Generation

Sequence Diagram

Annotation

CachereqCache

reqServ

respServ

respCache

reqCache

respCache

annotations: <pending,cached>

<F,?>

<T,F>

<T,F>

<T,?>

<?,T>

<?,?>

<T,T>

<F,T>

<F,?>

<T,?>

<T,T>

<F,T>

Page 15: Synthesizing Partial Component-Level Behavior Models

Phase 3: Sequence Diagram Annotation Initial MTS

Generation

Final MTS Generation

Component Constraint Generation

Sequence Diagram

Annotation

CachereqCache

reqServ

respServ

respCache

reqCache

respCache

annotations: <pending,cached>

<F,?>

<T,F>

<T,F>

<T,F>

<?,T>

<?,?>

<T,T>

<F,T>

<F,?>

<T,?>

<T,T>

<F,T>

Page 16: Synthesizing Partial Component-Level Behavior Models

Phase 3: Sequence Diagram Annotation Initial MTS

Generation

Final MTS Generation

Component Constraint Generation

Sequence Diagram

Annotation

CachereqCache

reqServ

respServ

respCache

reqCache

respCache

annotations: <pending,cached>

<F,F>

<T,F>

<T,F><T,F>

<T,T>

<T,F>

<T,T>

<F,T>

<F,T>

<T,T>

<T,T>

<F,T>

Page 17: Synthesizing Partial Component-Level Behavior Models

Phase 3: Sequence Diagram Annotation Initial MTS

Generation

Final MTS Generation

Component Constraint Generation

Sequence Diagram

Annotation

CachereqCache

reqServ

respServ

respCache

reqCache

respCache

<F,F>

<T,F>

<T,F><T,F>

<T,T>

<T,F>

<T,T>

<F,T>

<F,T>

<T,T>

<T,T>

<F,T>

• We know the traversed execution states

Page 18: Synthesizing Partial Component-Level Behavior Models

Phase 4: Final MTS Generation Initial MTS Generation

Component Constraint Generation

Sequence Diagram

Annotation

Final MTS Generatio

n

S1 (F,F)

S2 (F,T)

S3 (T,F)

respServ?

MTS Cache

reqCache?

respServ?

S4 (T,T)

reqCache?

reqServ?

respCache?

respServ?

respServ?

reqCache<F,F>

<T,F>

Current invocation

Page 19: Synthesizing Partial Component-Level Behavior Models

Phase 4: Final MTS Generation Initial MTS Generation

Component Constraint Generation

Sequence Diagram

Annotation

Final MTS Generatio

n

S1 (F,F)

S2 (F,T)

S3 (T,F)

respServ?

MTS Cache

reqCache

respServ?

S4 (T,T)

reqCache?

reqServ?

respCache?

respServ?

respServ?

reqServ<T,F>

<T,F>

Current invocation

Page 20: Synthesizing Partial Component-Level Behavior Models

reqCacherespCache

Phase 4: Final MTS Generation Initial MTS Generation

Component Constraint Generation

Sequence Diagram

Annotation

Final MTS Generatio

n

S1 (F,F)

S2 (F,T)

S3 (T,F)

respServ?

MTS CacherespServ?

S4 (T,T)

reqCache

reqServ?

respServ

respServ?

S3’ (T,F)

reqServ S4’ (T,T)

S2’ (F,T)

respServ?

respServ?

respCache

Page 21: Synthesizing Partial Component-Level Behavior Models

Phase 4: Final MTS Generation Initial MTS Generation

Component Constraint Generation

Sequence Diagram

Annotation

Final MTS Generatio

n

respCachereqCache

S1 (F,F)

S2 (F,T)

S3 (T,F)

respServ?

MTS CacherespServ?

S4 (T,T)

reqCache

reqServ?

respServ

respServ?

S3’ (T,F)

reqServS4’

(T,T)

S2’ (F,T)

respServ?

respServ?

respCache

• All legal behavior

• Required behavior

Page 22: Synthesizing Partial Component-Level Behavior Models

Implementation

• Prototype MTSGen tool• Warns about discrepancies• Results can be visualized in MTSA

• Performance evaluation• The algorithm is exponential in the worst case• Used specifications

• 50 components• 300 distinct operations• 200 domain variables• 200 scenarios

• Average running time 36 seconds• Models of approx. 60 states

Page 23: Synthesizing Partial Component-Level Behavior Models

Scenario Cannot Execute As Specified

Client Cache Server Admin

requestCache

responseCache

requestCache

requestServer

dataUpdate

responseServer

responseCache

<T,F><T,T>dataChanged

Page 24: Synthesizing Partial Component-Level Behavior Models

System and Component Views Differ

Client Cache Server Admin

requestCache

removePermission

responseCache

requestCache

requestServer

responseServer

responseCache

System viewpoint:

permission = false

Cache viewpoint:

permission = true

Page 25: Synthesizing Partial Component-Level Behavior Models

Conclusions

• Novel synthesis algorithm• Inputs: constraints and scenarios• Outputs: component-level MTSs• Discovery of specification discrepancies• Prototype implementation

• Future work• Support for requirements elicitation• Support in OTS component selection

Page 26: Synthesizing Partial Component-Level Behavior Models

References

1. Whittle and Schumann, ICSE 2000.

2. Mäkinen and Systä, ICSE 2001.

3. Damas et al., FSE 2006.

4. Uchitel et al., ESEC/FSE 2003.

Page 27: Synthesizing Partial Component-Level Behavior Models

• Authors• Ivo Krka ([email protected])• Yuriy Brun ([email protected])• George Edwards ([email protected])• Nenad Medvidovic ([email protected])

• Tool download• http://www-scf.usc.edu/~krka/MTSGen.zip

Initial MTS Generation

Component Constraint Generation

Sequence Diagram

AnnotationFinal MTS

Generation