Can a Model Checker Generate Tests for Non-Deterministic Systems? - - PowerPoint PPT Presentation

can a model checker generate tests for non deterministic
SMART_READER_LITE
LIVE PREVIEW

Can a Model Checker Generate Tests for Non-Deterministic Systems? - - PowerPoint PPT Presentation

Can a Model Checker Generate Tests for Non-Deterministic Systems? Sergiy Boroday, Alexandre Petrenko CRIM, Montreal, Canada Roland Groz INPG, France MBT 2007 Outline Motivation Weak and Strong Tests Test Generation Model


slide-1
SLIDE 1

Can a Model Checker Generate Tests for Non-Deterministic Systems?

Sergiy Boroday, Alexandre Petrenko

CRIM, Montreal, Canada

Roland Groz

INPG, France MBT 2007

slide-2
SLIDE 2

2

Outline

  • Motivation
  • Weak and Strong Tests
  • Test Generation

– Model Checking

  • Deterministic FSM
  • Weak Tests Non-deterministic FSM

– Module Checking

Strong Tests for Non-deterministic FSM

  • Conclusion
slide-3
SLIDE 3

3

  • The system under test

– Concurrency/races – Timed – Background activities – Various configurations

  • The model

– Options or alternatives – Imprecise specification – Abstraction (simplification)

Sources of ND

sin(x)=f(x)

slide-4
SLIDE 4

4

State Based Formalisms

Module 1/1 0/0 Mealy FSM (transducer) 1/1 0/0 Kripke Structure v1,v2

slide-5
SLIDE 5

5

ND Example

  • Mealy FSM
  • Module

1/1 0/0 0/0 1/0 0/1 1/1 0/0 1/0 0/1

slide-6
SLIDE 6

6

Black Box Testing

  • Black box means that the full state of the

system is not observable, in particular, some variables (actions) are

– Unessential, or – Hidden from tester

  • instrumentation is usually limited
  • code is obfuscated
  • White box is a special case when state is

completely observable

slide-7
SLIDE 7

7

Mutation Based Testing

  • Faults are modeled by mutant modules
  • Mutation operators

– Transitions redirected, added, removed, permuted… – Variables/labels changed, permuted… – Many are defined for SDL, EFSM…

  • Here we allow any mutation preserving input and
  • utput variables
  • A test should expose an unexpected behavior of

a mutant w.r.t. a specification

  • Mutant explosion could be handled by merging

mutants (into a “meta-mutant”) and abstraction

slide-8
SLIDE 8

8

Strong and Weak Tests

Strong test (separating sequence)

– (Finite) input sequence, such that sets of specification and mutant output sequences are disjoint – Mutant is killed by a single shot, fault is detected

Weak test

– (Finite) input sequence, such that at least one

  • utput sequence of the

mutant is not allowed by specification – May detect fault – with machine gun – completeness/Milner weather assumption – May exist, even when strong test does not

slide-9
SLIDE 9

9

Strong and Weak Tests: Examples

For modules S and M input 1 is a weak test 11 is a strong test

Module S Module M

1/1 0/0 w 1 w2 w3 1/0 0/0 w1 2 1 /1 w

Input sequence 00 10 1 M 11 1 S 11 1

slide-10
SLIDE 10

10

Weak Tests and Fairness

  • Fairness: if for each state occurring

infinitely often in the path each outgoing transition is taken infinitely often

  • Reset input is required to repeat a test
  • Intuitively, a finite weak test, repeated

infinitely often (with resets), is an infinite strong test under fairness assumption

slide-11
SLIDE 11

11

Is MBT Fair?

  • Strong test for conservative abstract

systems (models) is also strong for concrete systems

  • Not so for weak tests, as fairness is not

guaranteed (do not expect fairness from a conservative abstraction)

slide-12
SLIDE 12

12

Building Test by Model Checking

Output

Mutant Property: mutant obeys spec?

Model Checker

property holds property does not hold Input Counter-example Test Mutant conforms to Spec

Spec

slide-13
SLIDE 13

13

Deterministic Spec and Mutant

Strong and weak tests coincide Test could be built from counterexample to S || M' |= AG out = out'

Module S 1/ 1 0/0 Module S || M' 1/10 0/00 1 /11 1/0 0/ 1 /1 Module M

slide-14
SLIDE 14

14

Tests for Deterministic Spec and Non-Deterministic Mutant

Weak test could be built from counterexample to S || M' |= AG out = out' Weak tests are not necessarily strong

Module S

1/ 1 0/0

Module S || M'

1/10 0/00 1 /11 1/0 0/ 1 /1

Module M

slide-15
SLIDE 15

15

Non-Deterministic Spec and Mutant

Test could not be built from counterexample to S || M' |= AG out = out' Due to lack of output synchronization

Module S || M' 1/10 0/00 1 /11 1/0 0/ 1 /1 1/10 1 /11 Module S = Module M

slide-16
SLIDE 16

16

Weak Tests for Non-Deterministic Spec and Mutant

Build an observer from the spec by renaming

  • utputs into inputs, determinizing, and

completing with sink states Weak test could be built from counterexample to M || Obs(S) |= AG sink But not each weak test is strong Apparently, model checkers are not fit to derive strong tests

slide-17
SLIDE 17

17

Example

Counterexample to Obs(S) || M |= AG sink (fragment of Obs(S) || M )

w 3

S

1/1 0/0 w1 2 1/0 w

M

w 4 0/0 1 w 2 0 /1 1/1 w

Observer S (fragment)

11/0/ 00/0/ 1 0/0/ 01/1/ 10/1/ w 5 01/1/1 w5 w4

0 is a weak test, but not strong

slide-18
SLIDE 18

18

  • Module is Kripke structure + partition of variables
  • nto input, output, and internal
  • Module composition

(internal variables are hidden)

  • Model checking problem: satisfaction of a

formula in a module (underlying Kripke structure)

  • Module checking problem: reactive satisfaction

satisfaction of a formula in each deadlock free

composition of the module with any other module (called environment)

Module Checking

x y z y w z

slide-19
SLIDE 19

19

Strong Tests for Non-Deterministic Specification and Mutant

There is no strong test iff HideOut(S || M') satisfies reactively EG out = out' i.e., for all non-blocking Env Env || HideOut(S || M') |= EG out = out’ HideOut operation converts all the output variables into internal

slide-20
SLIDE 20

20

Example

Counterexample to EG out = out' (fragment of Env || HideOut(S || M ) 11 is a strong test Counterexample Environment Env

w 3

S M

w 4 0/0 1 w 2 0 /1 1/1 1/1 0/0 w 1 2 1/0 w w

HideOut (S || M )

1/11/ 0/00/ 1 /01/ 0/01/ w 1 1/11/ 1 /01/ w 2 w 3 w 2 w 2

slide-21
SLIDE 21

21

Conclusion

  • “Can a Model Checker Generate Tests for Non-

Deterministic Systems?”

  • Yes, for weak tests
  • But with certain transformations that may

explode size

  • Yes, with a module checker
  • Do you know one?
slide-22
SLIDE 22

22

Thank you