semantics & verification research group department of computer science university of malta...

34
Semantics & Verificatio n Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian Colombo Gordon Pace University of Malta

Upload: clemence-heath

Post on 25-Dec-2015

219 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Fast-Forward Runtime Monitoring— An Industrial Case Study

Christian ColomboGordon Pace

University of Malta

Page 2: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

2

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Runtime Verification in Industry

• Fear of intrusiveness– Code modification– Slowdown

Page 3: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

3

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Runtime Verification in Industry

• Fear of intrusiveness– Code modification– Slowdown

Page 4: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

4

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Asynchronous Monitoring

Page 5: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

5

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Problem

• It may take too long for the monitor to come/remain up to scratch with the system– During initialisation– During heavy load on system– If monitoring resources are low when

compared to system resources

Page 6: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

6

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Approach

• Pausing the system might not always be desirable

Page 7: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

7

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Approach

• Fast-forwarding the monitor might be a better option

Page 8: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

8

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

ApproachSystem

Monitor

System

Monitor

Page 9: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

9

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

ApproachSystem

Monitor

System

MonitorMonitor

Page 10: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

10

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

ApproachSystem

Monitor

System

Monitor

Page 11: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

11

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Fast-Forwarding

• Ideal– Failure in normal Failure in fast-forward

• Over approximation (high risk)– Failure in normal Failure in fast-forward

• Under approximation (low risk)– Failure in normal Failure in fast-forward

Page 12: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

12

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Specification

ab

a

cb b

a

Page 13: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

13

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Normal Monitor Fast-forward Monitor

a c f e w e r w r e r t t r y b q x

Normal Trace

z b y k w g h g s y n m p

Abstracted Trace

Monitor Configurations Monitor Configurations

Page 14: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

14

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Normal Monitor Fast-forward Monitor

1

2

31

3

a c f e w e r w r e r t t r y b q x z b y k w g h g s y n m p

Page 15: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

15

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Normal Monitor Fast-forward Monitor

1

2

31

3

13

a c f e w e r w r e r t t r y b q x z b y k w g h g s y n m p

z b y k w g h g s y n m p

Page 16: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

16

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Normal Monitor Fast-forward Monitor

1

2

31

3

13

13

2

a c f e w e r w r e r t t r y b q x z b y k w g h g s y n m p

a c f e w e r w r e r t t r y b q x z b y k w g h g s y n m p

Page 17: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

17

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Comparing Monitor Configurations

• To cater for quasi-identical monitor configuration states the notion of equality is defined as:

• B(1) = {w,w’,w’’}• 1 =c 2 iff B(1)=B(2)

1

w

w'

w''

2

w

w'

w''

Page 18: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

18

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Faithful Fast-Forwarding

1

w

w'

w''

1

α(w)

α(w')

α(w'')

Page 19: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

19

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Over Approximation

1

w

w'1

α(w)

α(w')

α(w'')

Page 20: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

20

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Under Approximation

1

w

w'

w''

1

α(w)

α(w')

Page 21: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

21

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Case Study

Page 22: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

22

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Case Study Initialisation

• System has been running for years• Thousands of users are already active

– How many monitors to be instantiated?– What is their monitor state?– What are their variable values?

Page 23: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

23

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

ExampleTrace

U1: DormantU2: LoadU2: PurchaseU1: ThawU1: LoadU1: PurchaseU3: TransferU3: LoadU1: TransferU4: DormantU5: DormantU1: PurchaseU6: TransferU5: ThawU6: Load

Page 24: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

24

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Example – Monitors Trace

U1: DormantU2: LoadU2: PurchaseU1: ThawU1: LoadU1: PurchaseU3: TransferU3: LoadU1: TransferU4: DormantU5: DormantU1: PurchaseU6: TransferU5: ThawU6: Load

Monitors

U1U2U3U4U5U6

Page 25: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

25

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Example – Monitor States Trace

U1: DormantU2: LoadU2: PurchaseU1: ThawU1: LoadU1: PurchaseU3: TransferU3: LoadU1: TransferU4: DormantU5: DormantU1: PurchaseU6: TransferU5: ThawU6: Load

Monitors

U1U2U3U4U5U6

Monitor States

U1: NonDormU2: NonDormU3: NonDormU4: DormU5: ThawedU6: NonDorm

Page 26: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

26

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Example – Timers Trace

4: U1: Dormant 9: U2: Load14: U2: Purchase17: U1: Thaw28: U1: Load34: U1: Purchase45: U3: Transfer49: U3: Load67: U1: Transfer71: U4: Dormant73: U5: Dormant82: U1: Purchase90: U6: Transfer94: U5: Thaw107: U6: Load

Monitors

U1U2U3U4U5U6

Monitor States

U1: NonDormU2: NonDormU3: NonDormU4: DormU5: ThawedU6: NonDorm

Dormancy Timer Reset

U1: 82U2: 14U3: 49U4: n/aU5: n/aU6: 107

Thaw Timer Reset

U1: n/aU2: n/aU3: n/aU4: n/aU5: 94U6: n/a

Page 27: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

27

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Code

Page 28: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

28

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Code

Page 29: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

29

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Code

Page 30: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

30

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Code

Page 31: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

31

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Theory Instantiation

System

Monitor

System

SQL Monitor SQL Monitor

Page 32: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

32

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Results

• Normal monitoring– 15 hours / week’s data

• Fast-forwarded monitoring– 0.6 hours / week’s data

• Fast-forward : Normal 1 : 25

Page 33: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

33

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Applications of Results

• Fast monitor bootstrapping• Burst monitoring• Synchronous/asynchronous monitoring

Page 34: Semantics & Verification Research Group Department of Computer Science University of Malta Fast-Forward Runtime Monitoring — An Industrial Case Study Christian

34

Semantics &Verification

Research Group

Department of Computer ScienceUniversity of Malta

Conclusion

• Fine-tune system-monitor relationship• An affective way of initialising monitors quickly• Applied to an industrial case study with

promising results• No automated way• Not easy to write fast monitors