delta-oriented testing for finite state machines mahsa varshosaz, harsh beohar avocs 2014 centre for...

23
Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz , Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Upload: craig-letts

Post on 14-Dec-2015

215 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Delta-Oriented Testing for Finite State Machines

Mahsa Varshosaz, Harsh Beohar

AVOCS 2014

Centre for Research on Embedded Systems (CERES)

Halmstad University

Page 2: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Motivation

Testing a family of software

2

Page 3: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Motivation (cont)

3

Page 4: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Outline

• Model Based Testing– W-Method

• Delta-oriented W-Method

4

Page 5: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Model Based Testing

System Model

Implementation

LTSFSM…

Test Case Generation

Test Execution

5

Page 6: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Finite State Machine

Inputs I={a,b}Outputs O={0,1}

s0b/0

b/0

b/1

a/0

a/1

a/1

s2s1

6

Page 7: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Model Assumptions

• Fully specified ∀i∈I

• Deterministic

• Minimal ≢

si/o

si/o

i/o’

sS’

7

Page 8: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

W-Method

• Basis: FSM test models

• Goal: Establish conformance between specification and implementation

8

Page 9: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Transition Cover Set (P)

• Goal: Checking existence of output faults– P={ ,a,b,a,aa,aaa,aabƹ }

s0

s2s1

b/0

b/0

b/1

a/1

a/1

a/0

s0

s0 s1

s0s2

s0 s2

a

b

ab

a

b

9

Page 10: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Characterizing Set (W)

• Goal: Checking existence of transfer faults

W={a,b}

s0

s2s1

b/0

b/0

b/1

a/1

a/1

a/0

Input /state s0 s1 s2

a 0 1 1

b 0 0 1

10

Page 11: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Test Cases

• The set of test cases to be executed R.P.W

– R : the reset sequence

11

Page 12: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Outline

• Model Based Testing– W-Method

• Delta-oriented W-Method

12

Page 13: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Delta-Oriented Modeling

CoreModelDelta

1

Deltai

Deltan

… …

Pi

P1 Pn

13

Page 14: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Delta Oriented Testing

Core Model(M)

∆(M)1 ……

Mi’

∆(M)i∆(M)n

Generating Test Cases

Generating DeltaTest

Cases

Executing Test

14

Page 15: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

FSM Delta

• ∆(M)=(S∆,I∆,O∆, μ∆ ,λ∆ )

– S ∆ non-empty set of states

– I ∆ , O ∆ set of inputs and outputs

– μ ∆ : (S ⋃ S ∆) x I ∆ ⟶ (S ⋃ S ∆)

– λ ∆ : (S ⋃ S ∆) x I ∆ ⟶ O ∆ ⋃ τ15

Page 16: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

FSM Delta (Example)

s0

b/0

a,b/0

b/0

a,b/1

a,c/0s2s1

s3

c/0 c/1 c/0

t1 t2

t3

a/1

a,b/1

c/1

b,c/1

a/1

b,c/1

a/0

b/0

16

Page 17: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Delta Application

• Apply(M, ∆(M))= (s0, S’, I’, O’, μ’, λ’)

– S’= S ⋃ S∆ I’=I∆ O’=O∆ μ∆ (s, a) if (s, a) ∈ Dom(μ∆ )

– μ’(s, a) = μ (s, a) if a ∈ I ∧ (s, a) ∉Dom(μ∆ )

s otherwise

λ∆(s, a) if (s, a) ∈ Dom(λ∆)

– λ’(s, a) = λ (s, a) if a ∈ I ∧ (s, a) ∉Dom(λ∆ )

τ otherwise

17

Page 18: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Delta Application (Example)

s0

b/0

a,b/0

b/0

a,b/1

a,c/0s2s1

s3

c/0 c/1 c/0

t1 t2

t3

a/1

a,b/1

c/1

b,c/1

a/1

b,c/1

a/0

b/0

b/1

18

Page 19: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Test Criteria

• Two criteria for solutions– Correctness– Efficiency

• Considering an SPL with n products

Core Model

(M)

∆(M)i

M’i

19

Page 20: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Correctness

20

Page 21: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Efficiency

21

Page 22: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Work in Progress

• Developing algorithms for computing:– Characterizing set– Transition cover set

• Extending the delta definition

• Implementing the delta oriented method

22

Page 23: Delta-Oriented Testing for Finite State Machines Mahsa Varshosaz, Harsh Beohar AVOCS 2014 Centre for Research on Embedded Systems (CERES) Halmstad University

Thank you

[email protected]