Dynamic Component Substitutability Analysis Edmund Clarke Natasha - - PowerPoint PPT Presentation

dynamic component substitutability analysis
SMART_READER_LITE
LIVE PREVIEW

Dynamic Component Substitutability Analysis Edmund Clarke Natasha - - PowerPoint PPT Presentation

Dynamic Component Substitutability Analysis Edmund Clarke Natasha Sharygina* Nishant Sinha Carnegie Mellon University The University of Lugano Motivation Model checking is a highly time consuming, labor intensive effort For


slide-1
SLIDE 1

Dynamic Component Substitutability Analysis

Edmund Clarke Natasha Sharygina* Nishant Sinha Carnegie Mellon University The University of Lugano

slide-2
SLIDE 2

Motivation

  • Model checking is a highly time consuming, labor

intensive effort

  • For example, a system of 25 components (~20K

LOC) and 100+ properties might take up to a month of verification effort

  • Discourages its widespread use when system

evolves

slide-3
SLIDE 3

Software Evolution

  • Software evolution is inevitable in any real

system:

– Changing requirements – Bug fixes – Product changes (underlying platform, third- party,etc.)

slide-4
SLIDE 4

Substitutability Check

Assembly A

Component C Component C’ P ?

slide-5
SLIDE 5

Motivation

  • Component-based Software

– Software modules shipped by separate developers – Undergo several updates/bug-fixes during their lifecycle

  • Component assembly verification

– Necessary on upgrade of any component – High costs of complete global verification – Instead check for substitutability of new component

slide-6
SLIDE 6

Substitutability Check

  • Incremental in nature
  • Two phases:

– Containment check

  • All local behaviors (services) of the previous

component contained in new one

– Compatibility check

  • Safety with respect to other components in

assembly: all global specifications still hold

slide-7
SLIDE 7

Containment, Compatibility Duality

Component C

Containment Check (local) Compatibility Check (global)

Identical Behaviors New Behaviors Lost Behaviors

Upgraded Component C’

slide-8
SLIDE 8

Substitutability Check

  • Approaches

– Obtain a finite behavioral model of all components by abstraction: Labeled Kripke structures – Containment:

  • Use under- and over- approximations

– Compatibility:

  • Use dynamic assume-guarantee reasoning
slide-9
SLIDE 9

Predicate Abstraction into LKS

  • Labeled Kripke Structures

– <Q,Σ,T,P,L>

  • Composition semantics

– Synchronize on shared actions

  • Represents abstractions

p !q q

β α

γ !p C Component Component LKS Abstraction Predicate Abstraction

slide-10
SLIDE 10

Component Assembly

  • A set of communicating concurrent C programs

– No recursion, procedures inlined

  • Each component abstracted into a Component LKS

– Communication between components is abstracted into interface actions

C1 C2 C3 M1 M2 M3 Component Assembly C Abstraction M

Predicate Abstraction

slide-11
SLIDE 11

Predicate Abstraction into LKS

L1

lock = 0

if (x < y)

lock=1

x x < y

if (x >= y)

lock = 0

x x < y

if (x < y)

x x >= y

lock=1

void OSSemPend(…) { L1: lock = 1; if (x < y) { L2: lock = 0; … } if (x >= y) { … L3: lock = 0; … } else { … } }

L2

τ

if (x >= y)

x x >= y

τ τ

L3

τ

slide-12
SLIDE 12

Containment Check

  • Goal: Check C µ C’

– All behaviors retained after upgrade – Cannot check directly: need approximations

  • Idea: Use both under- and over-

approximations

  • Solution:

– Compute M: C µ M – Compute M’: M’ µ C’ – Check for M µ M’

C

Containment Check

Identical New Lost

C’

slide-13
SLIDE 13

Containment (contd.)

C C’ M M’

  • ver-approx

under-approx µ ?

True

C µ C’

False, CE

CE 2 C ?

False, Refine M

CE 2 C’ ?

True, Refine M’

C * C’, CE provided as feedback

False True

M C C’ M’

slide-14
SLIDE 14

Containment (contd.)

  • Computing over-approximation

– Conventional predicate abstraction

  • Computing under-approximation

– Modified predicate abstraction – Compute Must transitions instead of May

slide-15
SLIDE 15

Compatibility Check

C

Compatibility Check

Identical New Lost

C’

  • Assume-guarantee to verify

assembly properties

  • Automatically generate assumption A

– Cobleigh et. al. at NASA Ames

  • Use learning algorithm for regular languages, L*

M1 || A ² P M2 ² A M1 || M2 ² P

AG - Non Circular

  • Goal: Reuse previous verification results
slide-16
SLIDE 16

L* learner

Learning Regular languages: L*

  • Proposed by D. Angluin, improved by Rivest et al.

– Learning regular sets from queries and counterexamples, Information and Computation, 75(2), 1987.

  • Polynomial in the number of states and length of max

counterexample

Minimally adequate Teacher

IsMember( trace ρ ) IsCandidate( DFA D )

a b a b

Unknown Regular Language

±Counterexample/ Yes

Modelchecker

Yes/No

Minimum DFA

slide-17
SLIDE 17

Learning for Verification

  • Model checker as a Teacher

– Possesses information about concrete components – Model checks and returns true/counterexample

  • Learner builds a model sufficient to verify properties
  • Relies on both learner and teacher being efficient
  • Finding wide applications

– Adaptive Model Checking: Groce et al. – Automated Assume-Guarantee Reasoning: Cobleigh et al. – Synthesize Interface Specifications for Java Programs: Alur et al. – Regular Model Checking: Vardhan et al., Habermehl et al.

slide-18
SLIDE 18

Compatibility Check

R1: M1 || A ² P R2: M2 ² A

true

L* Assumption Generation

A

CE

CE Analysis

Actual CE M1 || M2 2 P

  • CE for A

+CE for A Teacher

M1 || M2 ² P true

slide-19
SLIDE 19

Handling Multiple Components

  • AG-NC is recursive

– (Cobleigh et al.)

R1: M1 || A ² P R2: M2 ² A M1 || M2 ² P

M1 k A1 ² P M2 k A2 ² A1 M3 ² A2 M2 k M3 ² A1 M1 k M2 k M3 ² P

  • Each Ai computed by a

separate L* instantiation

slide-20
SLIDE 20

Compatibility of Upgrades

  • Suppose assumptions are available from the old assembly
  • Dynamic AG: Reuse previous verification results

C

Identical New Lost

C’

  • Can we reuse previous assumptions directly?
  • NO: upgrades may change the unknown U to be learned
  • Requires Dynamic L*

M1 k A1 ² P M2 ² A1 M1 k M2 ² P M’1 k A’1 ² P M2 ² A’1 M’1 k M2 ² P

Upgrade Reuse?

slide-21
SLIDE 21

Dynamic L*

  • Learn DFA A corresponding to U
  • Unknown language U changes to U’
  • Goal: Continue learning from previous model A
  • Central Idea: Re-validate A to A’ which agrees

with U’

slide-22
SLIDE 22

Dynamic L*

  • L* maintains a table data-structure to store samples
  • Definition: Valid Tables

– All table entries agree with U

  • Theorem

– L* terminates with any valid observation table, OT

  • When U changes to U’,

– Suppose the last candidate w.r.t. U is A – Re-validate OT of A w.r.t. U’ – Obtain A’ from OT’ – Continue learning from A’

slide-23
SLIDE 23

Dynamic AG

M1 k A1 ² P M2 ² A1 M1 k M2 ² P M’1 k A’1 ² P M2 ² A’1 M’1 k M2 ² P

Re-Validate! and Reuse Upgrade

slide-24
SLIDE 24

Implementation

  • Comfort framework – explicit model checker
  • Industrial benchmark

– ABB Inter-process Communication (IPC) software – 4 main components – CriticalSection, IPCQueue, ReadMQ, WriteMQ

  • Evaluated on single and simultaneous upgrades

– WriteMQ and IPCQueue components

  • Properties

– P1: Write after obtaining CS lock – P2: Correct protocol to write to IPCQueue

slide-25
SLIDE 25

Experimental Results

Upgrade# (Property) #Mem Queries Torig (msec) Tug (msec)

Ipc1 (P1)

279 2260 13

Ipc1 (P2)

308 1694 14

Ipc2 (P1)

358 3286 17

Ipc2 (P2)

232 805 10

Ipc3 (P1)

363 3624 17

Ipc3 (P2)

258 1649 14

Ipc4 (P1)

355 1102 24

slide-26
SLIDE 26

ComFoRT Schema

Verification Yes System OK Abstraction Model Counterexample Valid? System Abstraction Guidance Yes No Counterexample Abstraction Refinement Improved Abstraction Guidance No Spurious Counterexample

Dynamic Assume-Guarantee Reasoning

slide-27
SLIDE 27

Conclusion

  • Automated Substitutability Checking

– Containment and Compatibility – Reuses previous verification results – Handles multiple upgrades – Built upon CEGAR framework

  • Implementation

– ComFoRT framework – Promising results on an industrial example

slide-28
SLIDE 28

Future Directions

  • Symbolic analysis, i.e., using SATABS
  • Assume-Guarantee for Liveness
  • Other AG Rules, e.g., Circular
  • Combining static analysis with dynamic

testing for facilitate abstraction and learning

slide-29
SLIDE 29

Ph.D. position is open

  • New EU project on verification of

evolving networked software

– Collaboration with IBM, ABB, VTT, Uni Milano and Oxford