Management of Time Requirements in Component-based Systems Yi Li 1 - - PowerPoint PPT Presentation

management of time requirements in component based systems
SMART_READER_LITE
LIVE PREVIEW

Management of Time Requirements in Component-based Systems Yi Li 1 - - PowerPoint PPT Presentation

Management of Time Requirements in Component-based Systems Yi Li 1 Tian Huat Tan 2 Marsha Chechik 1 1. University of Toronto 2. Singapore University of Technology and Design FM 2014 Singapore May 14, 2014 1 Component-based Software


slide-1
SLIDE 1

Management of Time Requirements in Component-based Systems

Yi Li1 Tian Huat Tan2 Marsha Chechik1

  • 1. University of Toronto
  • 2. Singapore University of Technology and Design

FM 2014 Singapore May 14, 2014

1

slide-2
SLIDE 2

Component-based Software Engineering

2

slide-3
SLIDE 3

Component-based Software Engineering

Business Goals & System Requirements

2

slide-4
SLIDE 4

Component-based Software Engineering

modularity, reusability, separation of concerns

Business Goals & System Requirements

2

slide-5
SLIDE 5

Timing Requirements

3

slide-6
SLIDE 6

Timing Requirements

Vehicle Control Systems

  • Electronic Stability Control (ESC)
  • Anti-lock braking system (ABS)

3

slide-7
SLIDE 7

Timing Requirements

Vehicle Control Systems

  • Electronic Stability Control (ESC)
  • Anti-lock braking system (ABS)

Smart Phones

3

slide-8
SLIDE 8

Timing Requirements

Vehicle Control Systems

  • Electronic Stability Control (ESC)
  • Anti-lock braking system (ABS)

Smart Phones

  • Sensors - motion tracking

3

slide-9
SLIDE 9

Timing Requirements

Vehicle Control Systems

  • Electronic Stability Control (ESC)
  • Anti-lock braking system (ABS)

Smart Phones

  • Sensors - motion tracking

Web Service Compositions

  • Ticket Booking
  • Stock Quotes

3

slide-10
SLIDE 10

Timing Requirements

Vehicle Control Systems

  • Electronic Stability Control (ESC)
  • Anti-lock braking system (ABS)

Smart Phones

  • Sensors - motion tracking

Web Service Compositions

  • Ticket Booking
  • Stock Quotes

3

slide-11
SLIDE 11

Existing Approach: LTR

?

4

slide-12
SLIDE 12

Existing Approach: LTR

?

4

slide-13
SLIDE 13

Existing Approach: LTR

?

4

slide-14
SLIDE 14

Existing Approach: LTR

?

4

slide-15
SLIDE 15

Existing Approach: LTR

?

4

slide-16
SLIDE 16

Existing Approach: LTR

Failure!

?

4

slide-17
SLIDE 17

Existing Approach: LTR

Must finish within 4s!

4

slide-18
SLIDE 18

Previous Work: [ICSE’13]

  • Local Timing Requirements

(LTR) synthesis

  • Web Services - BPEL
  • Monolithic representation

Existing Approach: LTR

Must finish within 4s! tDS tFS tPS

4

slide-19
SLIDE 19

Previous Work: [ICSE’13]

  • Local Timing Requirements

(LTR) synthesis

  • Web Services - BPEL
  • Monolithic representation

Existing Approach: LTR

Must finish within 4s! tDS tFS tPS

LTR:

¬(0≤tDS⋀1≤tFS⋀1≤tPS) ⋀((0≤tDS⋀0≤tFS⋀0≤tPS)⇒tDS≤3) ⋀((0≤tDS⋀0≤tFS≤1⋀0≤tPS)⇒tDS+tFS≤3) ⋀((0≤tDS⋀1≤tFS⋀0≤tPS≤1)⇒tDS+tPS≤2)

4

slide-20
SLIDE 20

Previous Work: [ICSE’13]

  • Local Timing Requirements

(LTR) synthesis

  • Web Services - BPEL
  • Monolithic representation

Existing Approach: LTR

Must finish within 4s! tDS tFS tPS

LTR:

¬(0≤tDS⋀1≤tFS⋀1≤tPS) ⋀((0≤tDS⋀0≤tFS⋀0≤tPS)⇒tDS≤3) ⋀((0≤tDS⋀0≤tFS≤1⋀0≤tPS)⇒tDS+tFS≤3) ⋀((0≤tDS⋀1≤tFS⋀0≤tPS≤1)⇒tDS+tPS≤2)

4

LTR - monolithic constraint

Pros: + distills complicated composition structures into a single formula + precisely captures all feasible combinations Cons:

  • imposes dependencies across components
  • lacks support for localized debugging/repairing
slide-21
SLIDE 21

Previous Work: [ICSE’13]

  • Local Timing Requirements

(LTR) synthesis

  • Web Services - BPEL
  • Monolithic representation

Existing Approach: LTR

Must finish within 4s! tDS tFS tPS

LTR:

¬(0≤tDS⋀1≤tFS⋀1≤tPS) ⋀((0≤tDS⋀0≤tFS⋀0≤tPS)⇒tDS≤3) ⋀((0≤tDS⋀0≤tFS≤1⋀0≤tPS)⇒tDS+tFS≤3) ⋀((0≤tDS⋀1≤tFS⋀0≤tPS≤1)⇒tDS+tPS≤2)

4

uLTR:

(0≤tDS<1⋀0≤tFS<1) ∨(0≤tDS<1⋀0≤tPS<1)

slide-22
SLIDE 22

LTR vs. uLTR

  • Component-dependent

timing requirement

  • Linear real arithmetic
  • Precise
  • Monolithic

5

uLTR: (0≤tDS<1⋀0≤tFS<1) ∨(0≤tDS<1⋀0≤tPS<1)

  • Component-independent

under-approximated LTR

  • Intervals
  • Under-approximated
  • Localized

LTR:

¬(0≤tDS⋀1≤tFS⋀1≤tPS) ⋀((0≤tDS⋀0≤tFS⋀0≤tPS)⇒tDS≤3) ⋀((0≤tDS⋀0≤tFS≤1⋀0≤tPS)⇒tDS+tFS≤3) ⋀((0≤tDS⋀1≤tFS⋀0≤tPS≤1)⇒tDS+tPS≤2)

slide-23
SLIDE 23

All possible timing configurations, e.g., tDS = 1, tFS = 0.5, tPS = 0.8

LTR vs. uLTR

6

Precision

slide-24
SLIDE 24

All possible timing configurations, e.g., tDS = 1, tFS = 0.5, tPS = 0.8

LTR vs. uLTR

6

LTR

Precision

unsafe safe

slide-25
SLIDE 25

All possible timing configurations, e.g., tDS = 1, tFS = 0.5, tPS = 0.8

LTR vs. uLTR

6

LTR

uLTR

false negatives

Precision

Precision(uLTR) = #configurations satisfied by uLTR

#configurations satisfied by LTR × 100% under- approximation

slide-26
SLIDE 26

All possible timing configurations, e.g., tDS = 1, tFS = 0.5, tPS = 0.8

LTR vs. uLTR

6

LTR

uLTR

Precision

Precision(uLTR) = #configurations satisfied by uLTR

#configurations satisfied by LTR × 100%

slide-27
SLIDE 27

Checklist

What is uLTR?

  • Component-independent under-approximated LTR
  • Soundness: ensure timing safety

How to break up the monolithic constraint?

  • Compute uLTR from LTR
  • Precision: preserve as many choices as possible

How can localized constraints support the management of timing requirements?

  • uLTR for component selection
  • uLTR for runtime adaptation and recovery

7

slide-28
SLIDE 28

Checklist

What is uLTR?

  • Component-independent under-approximated LTR
  • Soundness: ensure timing safety

How to break up the monolithic constraint?

  • Compute uLTR from LTR
  • Precision: preserve as many choices as possible

How can localized constraints support the management of timing requirements?

  • uLTR for component selection
  • uLTR for runtime adaptation and recovery

7

slide-29
SLIDE 29

φ:

¬(0≤tDS⋀1≤tFS⋀1≤tPS) ⋀((0≤tDS⋀0≤tFS⋀0≤tPS)⇒tDS≤3) ⋀((0≤tDS⋀0≤tFS≤1⋀0≤tPS)⇒tDS+tFS≤3) ⋀((0≤tDS⋀1≤tFS⋀0≤tPS≤1)⇒tDS+tPS≤2)

Compute uLTR from LTR

3 1 2 1 tDS tF S tP S

8

slide-30
SLIDE 30

φ:

¬(0≤tDS⋀1≤tFS⋀1≤tPS) ⋀((0≤tDS⋀0≤tFS⋀0≤tPS)⇒tDS≤3) ⋀((0≤tDS⋀0≤tFS≤1⋀0≤tPS)⇒tDS+tFS≤3) ⋀((0≤tDS⋀1≤tFS⋀0≤tPS≤1)⇒tDS+tPS≤2)

Compute uLTR from LTR

3 1 2 1 tDS tF S tP S 3 1 2 1 tDS tF S tP S

8

slide-31
SLIDE 31

φ:

¬(0≤tDS⋀1≤tFS⋀1≤tPS) ⋀((0≤tDS⋀0≤tFS⋀0≤tPS)⇒tDS≤3) ⋀((0≤tDS⋀0≤tFS≤1⋀0≤tPS)⇒tDS+tFS≤3) ⋀((0≤tDS⋀1≤tFS⋀0≤tPS≤1)⇒tDS+tPS≤2)

B: (0≤tDS<1⋀0≤tFS<1) ∨(0≤tDS<1⋀0≤tPS<1)

Compute uLTR from LTR

3 1 2 1 tDS tF S tP S

8

3 1 2 1 tDS tF S tP S

slide-32
SLIDE 32

Compute uLTR from LTR

3 1 2 1 tDS tF S tP S

8

slide-33
SLIDE 33

Compute uLTR from LTR

3 1 2 1 tDS tF S tP S 3 1 2 1 tDS tF S tP S

B1= MaxCube(φ)

8

slide-34
SLIDE 34

Compute uLTR from LTR

3 1 2 1 tDS tF S tP S 3 1 2 1 tDS tF S tP S 3 1 2 1 tDS tF S tP S

B1= MaxCube(φ) InfCube(φ,B1)

8

slide-35
SLIDE 35

Compute uLTR from LTR

3 1 2 1 tDS tF S tP S 3 1 2 1 tDS tF S tP S 3 1 2 1 tDS tF S tP S 3 1 2 1 tDS tF S tP S

B1= MaxCube(φ) InfCube(φ,B1) B2= MaxCube(φ)

8

slide-36
SLIDE 36

Compute uLTR from LTR

3 1 2 1 tDS tF S tP S

B1= MaxCube(φ) InfCube(φ,B1) B2= MaxCube(φ) …

3 1 2 1 tDS tF S tP S

8

B=Merge(B1,…,Bi)

slide-37
SLIDE 37

Compute uLTR from LTR

3 1 2 1 tDS tF S tP S

B1= MaxCube(φ) InfCube(φ,B1) B2= MaxCube(φ) …

3 1 2 1 tDS tF S tP S 3 1 2 1 tDS tF S tP S

8

if (h(Bi)<ω) return; B=Merge(B1,…,Bi)

slide-38
SLIDE 38

Compute uLTR from LTR

3 1 2 1 tDS tF S tP S

B1= MaxCube(φ) InfCube(φ,B1) B2= MaxCube(φ) … Soundness Termination

3 1 2 1 tDS tF S tP S 3 1 2 1 tDS tF S tP S

Precision

8

if (h(Bi)<ω) return; B=Merge(B1,…,Bi)

slide-39
SLIDE 39

SMT Encodings

MaxCube(φ) //return the hypercube in φ with maximum volume InfCube(φ,B) //relax in one direction if possible

9

slide-40
SLIDE 40

SMT Encodings

MaxCube(φ) //return the hypercube in φ with maximum volume InfCube(φ,B) //relax in one direction if possible

// sample arbitrary hyper-rectangle

9

θ , ∀V ars(ϕ) · (( V

vi∈V ars(ϕ)

li ≤ vi ≤ ui) ⇒ ϕ)

slide-41
SLIDE 41

SMT Encodings

MaxCube(φ) //return the hypercube in φ with maximum volume InfCube(φ,B) //relax in one direction if possible

// sample arbitrary hyper-rectangle // sample maximal hyper-cube

9

θ , ∀V ars(ϕ) · (( V

vi∈V ars(ϕ)

li ≤ vi ≤ ui) ⇒ ϕ)

Optimize(θ ∧ ( V

vi∈V ars(ϕ)

(ui − li = h)), h)

slide-42
SLIDE 42

SMT Encodings

MaxCube(φ) //return the hypercube in φ with maximum volume InfCube(φ,B) //relax in one direction if possible

// sample arbitrary hyper-rectangle // sample maximal hyper-cube

9

θ , ∀V ars(ϕ) · (( V

vi∈V ars(ϕ)

li ≤ vi ≤ ui) ⇒ ϕ)

Optimize(θ ∧ ( V

vi∈V ars(ϕ)

(ui − li = h)), h)

Symbolic Optimization [POPL’14]

slide-43
SLIDE 43

SMT Encodings

MaxCube(φ) //return the hypercube in φ with maximum volume InfCube(φ,B) //relax in one direction if possible

// sample arbitrary hyper-rectangle // sample maximal hyper-cube // relax lower bound // relax upper bound

9

θ , ∀V ars(ϕ) · (( V

vi∈V ars(ϕ)

li ≤ vi ≤ ui) ⇒ ϕ) unSAT? (¬(B[li/∞] ⇒ ϕ))

unSAT? (¬(B[ui/∞] ⇒ ϕ))

Optimize(θ ∧ ( V

vi∈V ars(ϕ)

(ui − li = h)), h)

slide-44
SLIDE 44

SMT Encodings

MaxCube(φ) //return the hypercube in φ with maximum volume InfCube(φ,B) //relax in one direction if possible

// sample arbitrary hyper-rectangle // sample maximal hyper-cube // relax lower bound // relax upper bound // heights of sampled hyper-cubes form a non-increasing sequence

9

θ , ∀V ars(ϕ) · (( V

vi∈V ars(ϕ)

li ≤ vi ≤ ui) ⇒ ϕ) unSAT? (¬(B[li/∞] ⇒ ϕ))

unSAT? (¬(B[ui/∞] ⇒ ϕ))

Optimize(θ ∧ ( V

vi∈V ars(ϕ)

(ui − li = h)), h)

slide-45
SLIDE 45

Checklist

What is uLTR?

  • Component-independent under-approximated LTR
  • Soundness: ensure timing safety

How to break up the monolithic constraint?

  • Compute uLTR from LTR
  • Precision: preserve as many choices as possible

How can localized constraints support the management of timing requirements?

  • uLTR for component selection
  • uLTR for runtime adaptation and recovery

10

slide-46
SLIDE 46

Checklist

What is uLTR?

  • Component-independent under-approximated LTR
  • Soundness: ensure timing safety

How to break up the monolithic constraint?

  • Compute uLTR from LTR
  • Precision: preserve as many choices as possible

How can localized constraints support the management of timing requirements?

  • uLTR for component selection
  • uLTR for runtime adaptation and recovery

10

slide-47
SLIDE 47

uLTR for component selection

11

slide-48
SLIDE 48

uLTR for component selection

publish

11

slide-49
SLIDE 49

uLTR for component selection

publish

LTR:(tFS<1⋀tDS≤3⋀tDS+tFS≤3)∨ …

11

slide-50
SLIDE 50

uLTR for component selection

publish

LTR:(tFS<1⋀tDS≤3⋀tDS+tFS≤3)∨ …

11

slide-51
SLIDE 51

uLTR for component selection

publish request r e t r i e v e

11

Carminati et al., 2005 Rajendran et al., 2010 Al-Masri & Mahmoud, 2007

slide-52
SLIDE 52

uLTR for component selection

publish request r e t r i e v e

tFS<1s finds the “best” match given localized constraints

11

slide-53
SLIDE 53

uLTR for component selection

publish request r e t r i e v e

tFS<1s finds the “best” match given localized constraints

11

slide-54
SLIDE 54
  • Real-world Web Service data: QWS dataset
  • Case studies: online booking service, …
  • Evaluate the percentage of false-negatives (precision)

w.r.t. size of the uLTR model

uLTR for component selection

100 200 Size of uLTR model (|BS|) 10 20 30 40 50 60 70 80 90 100 Precision of uLTR model (%) QWS, Te = 10.8s Rand, Te ≈ 201.4s 1 4 7 10 Size of uLTR model (|BS|) 60 65 70 75 80 85 90 95 100 Precision of uLTR model (%) QWS, Te = 0.9s Rand, Te ≈ 10.8s 1 4 7 10 Size of uLTR model (|BS|) 60 65 70 75 80 85 90 95 100 Precision of uLTR model (%) QWS, Te = 2.7s Rand, Te ≈ 242.2s

12

slide-55
SLIDE 55
  • Real-world Web Service data: QWS dataset
  • Case studies: online booking service, …
  • Evaluate the percentage of false-negatives (precision)

w.r.t. size of the uLTR model

uLTR for component selection

100 200 Size of uLTR model (|BS|) 10 20 30 40 50 60 70 80 90 100 Precision of uLTR model (%) QWS, Te = 10.8s Rand, Te ≈ 201.4s 1 4 7 10 Size of uLTR model (|BS|) 60 65 70 75 80 85 90 95 100 Precision of uLTR model (%) QWS, Te = 0.9s Rand, Te ≈ 10.8s 1 4 7 10 Size of uLTR model (|BS|) 60 65 70 75 80 85 90 95 100 Precision of uLTR model (%) QWS, Te = 2.7s Rand, Te ≈ 242.2s

12

Strong dependency in the original LTR: t1+t2+3t3-2t4<4

slide-56
SLIDE 56

uLTR for runtime adaptation and recovery

Must finish within 4s!

Monitor

13

slide-57
SLIDE 57

uLTR for runtime adaptation and recovery

Must finish within 4s! response time

Monitor

13

slide-58
SLIDE 58

uLTR for runtime adaptation and recovery

Must finish within 4s! response time

Monitor

13

slide-59
SLIDE 59

uLTR for runtime adaptation and recovery

Must finish within 4s! response time repairing plan

Monitor

13

slide-60
SLIDE 60

uLTR for runtime adaptation and recovery

Must finish within 4s! response time repairing plan

Monitor

13

slide-61
SLIDE 61

¬(0≤tDS⋀1≤tFS⋀1≤tPS) ⋀((0≤tDS⋀0≤tFS⋀0≤tPS)⇒tDS≤3) ⋀((0≤tDS⋀0≤tFS≤1⋀0≤tPS)⇒tDS+tFS≤3) ⋀((0≤tDS⋀1≤tFS⋀0≤tPS≤1)⇒tDS+tPS≤2)

uLTR for runtime adaptation and recovery

Must finish within 4s! response time repairing plan

Monitor

13

slide-62
SLIDE 62

¬(0≤tDS⋀1≤tFS⋀1≤tPS) ⋀((0≤tDS⋀0≤tFS⋀0≤tPS)⇒tDS≤3) ⋀((0≤tDS⋀0≤tFS≤1⋀0≤tPS)⇒tDS+tFS≤3) ⋀((0≤tDS⋀1≤tFS⋀0≤tPS≤1)⇒tDS+tPS≤2)

uLTR for runtime adaptation and recovery

Must finish within 4s!

?

response time repairing plan

Monitor

Have to replace both DS and FS.

13

slide-63
SLIDE 63

uLTR for runtime adaptation and recovery

Must finish within 4s! tDS<1 tFS<∞ tPS<1 response time repairing plan

Monitor

13

slide-64
SLIDE 64

uLTR for runtime adaptation and recovery

Must finish within 4s! tDS<1 tFS<∞ tPS<1 response time repairing plan

Monitor

Replacing DS is enough!

13

slide-65
SLIDE 65

uLTR for runtime adaptation and recovery

Must finish within 4s! tDS<1 tFS<∞ tPS<1 response time repairing plan

Monitor

Replacing DS is enough! The “meaning” of LTR: safe if one of tFS and tPS is less than 1.

13

slide-66
SLIDE 66

uLTR for runtime adaptation and recovery

Experiments:

  • Use real service response time
  • Simulate violations by adding uniform random delays to

components

  • Compare the length of recovery plans generated by

LTR and uLTR

  • In ~90% cases, uLTR discovers shorter repairs

14

slide-67
SLIDE 67

Limitations & Future Work

Limited evaluation

  • Need to look at other domains

Proof of concept, not the silver bullet

  • Generalize the sampling algorithm: allow arbitrary

hyper-rectangles

Scalability issues:

  • Quantifier elimination
  • Balance between precision and performance

15

slide-68
SLIDE 68

Checklist

What is uLTR?

  • Component-independent under-approximated LTR
  • Soundness: ensure timing safety

How to break up the monolithic constraint?

  • Compute uLTR from LTR
  • Precision: preserve as many choices as possible

How can localized constraints support the management of timing requirements?

  • uLTR for component selection
  • uLTR for runtime adaptation and recovery

16

slide-69
SLIDE 69

Checklist

What is uLTR?

  • Component-independent under-approximated LTR
  • Soundness: ensure timing safety

How to break up the monolithic constraint?

  • Compute uLTR from LTR
  • Precision: preserve as many choices as possible

How can localized constraints support the management of timing requirements?

  • uLTR for component selection
  • uLTR for runtime adaptation and recovery

16

slide-70
SLIDE 70

Questions?

Thank you!

17

slide-71
SLIDE 71

References

Li, Y., Albarghouthi, A., Gurfinkel, A., Kincaid, Z., Chechik, M.: Symbolic Optimization with SMT Solvers. In: Proc. of POPL 2014 (2014) Tan, T.H., André, E., Sun, J., Liu, Y., Dong, J.S., Chen, M.: Dynamic Synthesis of Local Time Requirement for Service Composition. In: Proc.

  • f ICSE 2013, pp. 542–551 (2013)

Al-Masri,E.,Mahmoud,Q.H.:QoS-based Discovery and Ranking of Web Services.In:Proc. of ICCCN 2007, pp. 529–534. IEEE (2007) Wang, S., Rho, S., Mai, Z., Bettati, R., Zhao, W.: Real-time Component- based Systems. In: Proc. of RTETAS 2005, pp. 428–437 (2005) Carminati, B., Ferrari, E., Hung, P.C.: Exploring Privacy Issues in Web Services Discovery Agencies. IEEE Security & Privacy 3(5), 14–21 (2005)

18