Delta-Oriented Testing for Finite State Machines

Download Report

Transcript Delta-Oriented Testing for Finite State Machines

Delta-Oriented Testing for Finite State Machines
Mahsa Varshosaz, Harsh Beohar
Centre for Research on Embedded Systems (CERES)
Halmstad University
AVOCS 2014
Motivation
Testing a family of software
2
Motivation (cont)
3
Outline
• Model Based Testing
– W-Method
• Delta-oriented W-Method
4
Model Based Testing
LTS
FSM
System
Model
…
Implementation
Test Case
Generation
Test Execution
5
Finite State Machine
Inputs I={a,b}
Outputs O={0,1}
b/0
s0
b/0
a/0
s1
a/1
a/1
s2
b/1
6
Model Assumptions
• Fully specified
s
i/o
∀i∈I
i/o
7
• Deterministic
s
• Minimal
s
i/o’
≢
S’
W-Method
• Basis: FSM test models
• Goal: Establish conformance between
specification and implementation
8
Transition Cover Set (P)
• Goal: Checking existence of output faults
–
P={ƹ ,a,b,a,aa,aaa,aab}
b/0
b
b/0
s0
a/0
s1
a/1
s0
a
s0
a/1
s1
a
b
s2
s0
s2
a
b/1
s0
9
b
s2
Characterizing Set (W)
• Goal: Checking existence of transfer faults
b/0
b/0
s0
a/0
a/1
s1
s2
a/1
b/1
W={a,b}
10
Input /state
s0
s1
s2
a
0
1
1
b
0
0
1
Test Cases
• The set of test cases to be executed
R.P.W
– R : the reset sequence
11
Outline
• Model Based Testing
– W-Method
• Delta-oriented W-Method
12
Delta-Oriented Modeling
Pi
Deltai
P1
13
Delta1
Core
Model
Deltan
Pn
Delta Oriented Testing
Generating
Test Cases
∆(M)1
…
Core Model
(M)
∆(M)i
…
∆(M)n
Generating
DeltaTest
Cases
Mi’
Executing
Test
14
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
FSM Delta (Example)
a,b/0
a/1
s0
b/0
a,b/1
c/1
t3
c/0
s1
s3
c/1 c/0
a,c/0
s2
b,c/1
b/0
b/0
16
a/1
t1
a/0
a,b/1
t2
b,c/1
Delta Application
• Apply(M, ∆(M))= (s0, S’, I’, O’, μ’, λ’)
– S’= S ⋃ S∆
17
I’=I∆
O’=O∆
– μ’(s, a) =
μ∆ (s, a) if (s, a) ∈ Dom(μ∆ )
μ (s, a) if a ∈ I ∧ (s, a) ∉Dom(μ∆ )
s otherwise
– λ’(s, a) =
λ∆(s, a) if (s, a) ∈ Dom(λ∆)
λ (s, a) if a ∈ I ∧ (s, a) ∉Dom(λ∆ )
τ otherwise
Delta Application (Example)
a,b/0
a/1
s0
b/0
a,b/1
b/1
c/1
t3
c/0
s1
s3
c/1 c/0
a,c/0
s2
b,c/1
b/0
b/0
18
a/1
t1
a/0
a,b/1
t2
b,c/1
Test Criteria
• Two criteria for solutions
– Correctness
– Efficiency
• Considering an SPL with n products
∆(M)i
19
Core
Model
(M)
M’i
Correctness
20
Efficiency
21
Work in Progress
• Developing algorithms for computing:
– Characterizing set
– Transition cover set
• Extending the delta definition
• Implementing the delta oriented method
22
Thank you
[email protected]