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 Engineering 2
Business Goals & System Requirements Component-based Software Engineering 2
Business Goals & System Requirements Component-based Software Engineering modularity, reusability, separation of concerns 2
Timing Requirements 3
Timing Requirements Vehicle Control Systems • Electronic Stability Control (ESC) • Anti-lock braking system (ABS) 3
Timing Requirements Vehicle Control Systems • Electronic Stability Control (ESC) • Anti-lock braking system (ABS) Smart Phones 3
Timing Requirements Vehicle Control Systems • Electronic Stability Control (ESC) • Anti-lock braking system (ABS) Smart Phones • Sensors - motion tracking 3
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
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
Existing Approach: LTR ? 4
Existing Approach: LTR ? 4
Existing Approach: LTR ? 4
Existing Approach: LTR ? 4
Existing Approach: LTR ? 4
Existing Approach: LTR ? Failure! 4
Existing Approach: LTR Must finish within 4s! 4
Existing Approach: LTR Previous Work: [ICSE’13] Must finish within 4s! • Local Timing Requirements (LTR) synthesis • Web Services - BPEL t DS t FS t PS • Monolithic representation 4
Existing Approach: LTR Previous Work: [ICSE’13] Must finish within 4s! • Local Timing Requirements (LTR) synthesis • Web Services - BPEL t DS t FS t PS • Monolithic representation LTR: ¬(0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 1 ≤ t PS ) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ⋀ 0 ≤ t PS ) ⇒ t DS ≤ 3) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ≤ 1 ⋀ 0 ≤ t PS ) ⇒ t DS +t FS ≤ 3) ⋀ ((0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 0 ≤ t PS ≤ 1) ⇒ t DS +t PS ≤ 2) 4
Existing Approach: LTR Previous Work: [ICSE’13] LTR - monolithic constraint Must finish within 4s! Pros: • Local Timing Requirements + distills complicated composition structures into a (LTR) synthesis single formula + precisely captures all feasible combinations • Web Services - BPEL Cons: t DS t FS t PS - imposes dependencies across components • Monolithic representation - lacks support for localized debugging/repairing LTR: ¬(0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 1 ≤ t PS ) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ⋀ 0 ≤ t PS ) ⇒ t DS ≤ 3) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ≤ 1 ⋀ 0 ≤ t PS ) ⇒ t DS +t FS ≤ 3) ⋀ ((0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 0 ≤ t PS ≤ 1) ⇒ t DS +t PS ≤ 2) 4
Existing Approach: LTR Previous Work: [ICSE’13] Must finish within 4s! • Local Timing Requirements (LTR) synthesis • Web Services - BPEL t DS t FS t PS • Monolithic representation LTR: ¬(0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 1 ≤ t PS ) uLTR: (0 ≤ t DS <1 ⋀ 0 ≤ t FS <1) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ⋀ 0 ≤ t PS ) ⇒ t DS ≤ 3) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ≤ 1 ⋀ 0 ≤ t PS ) ⇒ t DS +t FS ≤ 3) ∨ (0 ≤ t DS <1 ⋀ 0 ≤ t PS <1) ⋀ ((0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 0 ≤ t PS ≤ 1) ⇒ t DS +t PS ≤ 2) 4
LTR vs. uLTR LTR: uLTR: ¬(0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 1 ≤ t PS ) (0 ≤ t DS <1 ⋀ 0 ≤ t FS <1) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ⋀ 0 ≤ t PS ) ⇒ t DS ≤ 3) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ≤ 1 ⋀ 0 ≤ t PS ) ⇒ t DS +t FS ≤ 3) ∨ (0 ≤ t DS <1 ⋀ 0 ≤ t PS <1) ⋀ ((0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 0 ≤ t PS ≤ 1) ⇒ t DS +t PS ≤ 2) • Component-dependent • Component-independent timing requirement under-approximated LTR • Linear real arithmetic • Intervals • Precise • Under-approximated • Monolithic • Localized 5
LTR vs. uLTR All possible timing configurations, e.g., t DS = 1, t FS = 0.5, t PS = 0.8 Precision 6
LTR vs. uLTR unsafe LTR safe All possible timing configurations, e.g., t DS = 1, t FS = 0.5, t PS = 0.8 Precision 6
LTR vs. uLTR LTR All possible timing configurations, under- false uLTR approximation negatives e.g., t DS = 1, t FS = 0.5, t PS = 0.8 Precision Precision(uLTR) = #configurations satisfied by uLTR #configurations satisfied by LTR × 100% 6
LTR vs. uLTR LTR All possible timing configurations, uLTR e.g., t DS = 1, t FS = 0.5, t PS = 0.8 Precision Precision(uLTR) = #configurations satisfied by uLTR #configurations satisfied by LTR × 100% 6
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
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
Compute uLTR from LTR φ : ¬(0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 1 ≤ t PS ) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ⋀ 0 ≤ t PS ) ⇒ t DS ≤ 3) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ≤ 1 ⋀ 0 ≤ t PS ) ⇒ t DS +t FS ≤ 3) t P S ⋀ ((0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 0 ≤ t PS ≤ 1) ⇒ t DS +t PS ≤ 2) 1 1 0 t F S 2 3 t DS 8
Compute uLTR from LTR φ : ¬(0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 1 ≤ t PS ) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ⋀ 0 ≤ t PS ) ⇒ t DS ≤ 3) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ≤ 1 ⋀ 0 ≤ t PS ) ⇒ t DS +t FS ≤ 3) t P S t P S ⋀ ((0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 0 ≤ t PS ≤ 1) ⇒ t DS +t PS ≤ 2) 1 1 1 1 0 0 t F S t F S 2 2 3 3 t DS t DS 8
Compute uLTR from LTR φ : B: ¬(0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 1 ≤ t PS ) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ⋀ 0 ≤ t PS ) ⇒ t DS ≤ 3) (0 ≤ t DS <1 ⋀ 0 ≤ t FS <1) ⋀ ((0 ≤ t DS ⋀ 0 ≤ t FS ≤ 1 ⋀ 0 ≤ t PS ) ⇒ t DS +t FS ≤ 3) t P S t P S ∨ (0 ≤ t DS <1 ⋀ 0 ≤ t PS <1) ⋀ ((0 ≤ t DS ⋀ 1 ≤ t FS ⋀ 0 ≤ t PS ≤ 1) ⇒ t DS +t PS ≤ 2) 1 1 1 1 0 0 t F S t F S 2 2 3 3 t DS t DS 8
Compute uLTR from LTR t P S 1 1 0 t F S 2 3 t DS 8
Compute uLTR from LTR B 1 = MaxCube( φ ) t P S t P S 1 1 1 1 0 0 t F S t F S 2 2 3 3 t DS t DS 8
Compute uLTR from LTR B 1 = MaxCube( φ ) t P S t P S t P S InfCube( φ ,B 1 ) 1 1 1 1 1 1 0 0 0 t F S t F S t F S 2 2 2 3 3 3 t DS t DS t DS 8
Compute uLTR from LTR B 1 = MaxCube( φ ) t P S t P S t P S t P S InfCube( φ ,B 1 ) B 2 = MaxCube( φ ) 1 1 1 1 1 1 1 1 0 0 0 0 t F S t F S t F S t F S 2 2 2 2 3 3 3 3 t DS t DS t DS t DS 8
Compute uLTR from LTR B 1 = MaxCube( φ ) t P S t P S InfCube( φ ,B 1 ) B 2 = MaxCube( φ ) … 1 1 B=Merge(B 1 ,…,B i ) 1 1 0 0 t F S t F S 2 2 3 3 t DS t DS 8
Compute uLTR from LTR B 1 = MaxCube( φ ) t P S t P S t P S InfCube( φ ,B 1 ) B 2 = MaxCube( φ ) … 1 1 1 B=Merge(B 1 ,…,B i ) 1 1 1 0 0 0 if (h(B i )< ω ) t F S t F S t F S 2 2 2 3 3 3 return; t DS t DS t DS 8
Compute uLTR from LTR Soundness B 1 = MaxCube( φ ) t P S t P S t P S InfCube( φ ,B 1 ) Termination B 2 = MaxCube( φ ) Precision … 1 1 1 B=Merge(B 1 ,…,B i ) 1 1 1 0 0 0 if (h(B i )< ω ) t F S t F S t F S 2 2 2 3 3 3 return; t DS t DS t DS 8
SMT Encodings MaxCube( φ ) //return the hypercube in φ with maximum volume InfCube( φ ,B) //relax in one direction if possible 9
SMT Encodings MaxCube( φ ) //return the hypercube in φ with maximum volume // sample arbitrary hyper-rectangle θ , ∀ V ars ( ϕ ) · (( V l i ≤ v i ≤ u i ) ⇒ ϕ ) v i ∈ V ars ( ϕ ) InfCube( φ ,B) //relax in one direction if possible 9
SMT Encodings MaxCube( φ ) //return the hypercube in φ with maximum volume // sample arbitrary hyper-rectangle θ , ∀ V ars ( ϕ ) · (( V l i ≤ v i ≤ u i ) ⇒ ϕ ) v i ∈ V ars ( ϕ ) // sample maximal hyper-cube Optimize ( θ ∧ ( V ( u i − l i = h )) , h ) v i ∈ V ars ( ϕ ) InfCube( φ ,B) //relax in one direction if possible 9
SMT Encodings MaxCube( φ ) //return the hypercube in φ with maximum volume // sample arbitrary hyper-rectangle Symbolic Optimization θ , ∀ V ars ( ϕ ) · (( V l i ≤ v i ≤ u i ) ⇒ ϕ ) v i ∈ V ars ( ϕ ) [POPL’14] // sample maximal hyper-cube Optimize ( θ ∧ ( V ( u i − l i = h )) , h ) v i ∈ V ars ( ϕ ) InfCube( φ ,B) //relax in one direction if possible 9
Recommend
More recommend