07.01.2013 Views

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

Lecture Notes in Computer Science 3472

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

210 Laura Brandán Briones and Mathias Röhl<br />

Algorithm 11 Equivalence Class Graph<br />

<strong>in</strong>put: ERA determ<strong>in</strong>ized specification Spec<br />

output: A equivalence Class Graph<br />

1 S ′ 2<br />

0 = {s0}<br />

E = ∅ // E the set of transition<br />

3 N = {[S ′ 0, p] | p ∈ Ψdnf (S ′ 4<br />

0) ∧ p �= ∅} // N is the set of nodes<br />

N ′ = N //N’isthesetofnewnodes<br />

5 while N ′ �= ∅ then<br />

6 N ′′′ = ∅<br />

7 foreach [S ′ , p] ∈ N ′<br />

8 foreach a ∈ Σ :<br />

9 S ′′ = {s ′ |∃ s ∈ S ′ : s ϕ,a<br />

−→ s ′ }<br />

10 if S ′′ �= ∅ then<br />

11 N ′′ = {[S ′′ , p ′ ] | p ′ ∈ Ψdnf (S ′′ ) ∧ p ′ 12<br />

�= ∅}<br />

E = E � {([S ′ , p], a, [S ′′ , p ′ ]) | [S ′′ , p ′ ] ∈ N ′′ 13<br />

∧ (p ∧ ϕ) �= ∅}<br />

N ′′′ = N ′′′ � N ′′<br />

14 N ′ = N ′′′ − (N ′′′ � 15<br />

N )<br />

N = N � N ′<br />

Def<strong>in</strong>ition 8.15. Decorated Equivalence Classes<br />

Def<strong>in</strong>e Must([S ′ , p])={A | ∃〈S ′ , ν〉 : 〈S ′ , ν〉∈[S ′ , p] :〈S ′ , ν〉 |= after ɛ must A}<br />

Sort([S ′ , p]) = {a | ∃ 〈S ′ , ν〉 : 〈S ′ , ν〉 ∈[S ′ , p] :〈S ′ , ν〉 a →}<br />

• M ([S ′ , p]) = Must([S ′ , p])<br />

• C ([S ′ , p]) = Sort([S ′ , p])<br />

• R([S ′ , p]) = Σ − Sort([S ′ , p])<br />

where ɛ denote the empty sequence.<br />

If σ is a timed trace that lead to [S ′ , p] andA∈ M ([S ′ , p]) then: after σ<br />

must A, is a test to be passed for that class. Similarly: after σ · a must ∅, isa<br />

test to be passed if a ∈ R([S ′ , p]), and can σ · a if a ∈ C ([S ′ , p]). The number<br />

of generated tests can be reduced by remove tests that are logically passed by<br />

another test, i.e. the must sets can be reduced to M ([S ′ , p]) = m<strong>in</strong>⊆Must([S ′ , p])<br />

(where m<strong>in</strong>⊆(M ) gives the set of m<strong>in</strong>imal elements of M under subset <strong>in</strong>clusion),<br />

and the actions observed dur<strong>in</strong>g the execution of a must test can be removed<br />

from the may tests, i.e. C ([S ′ , p]) = Sort([S ′ �<br />

, p]) − A.<br />

A∈M ([S ′ ,p])<br />

Example. The equivalence classes graph for the automatic Light Switch are<br />

shown <strong>in</strong> Figure 8.5.<br />

The equivalence class graph preserves all timed traces of the specification, and<br />

the required deadlock <strong>in</strong>formation for the Hennessy test [HN83] of the specification<br />

by the M , C and R action sets is stored <strong>in</strong> each node. The non-determ<strong>in</strong>ism<br />

found <strong>in</strong> the orig<strong>in</strong>al specification is therefore ma<strong>in</strong>ta<strong>in</strong>ed, but is represented differently,<br />

<strong>in</strong> a way that is more convenient for test generation: a test is composed

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!