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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

6 Test Generation Algorithms Based on Preorder Relations 155<br />

•→is the m<strong>in</strong>imal relation verify<strong>in</strong>g:<br />

– (q1, q2) a → (q ′ 1, q ′ a<br />

2) if q1 →1 q ′ a<br />

1 ∧ q2 →2 q ′ 2 ∧ a ∈ L;<br />

– (q1, q2) τ → (q ′ τ<br />

1, q2) if q1 →1 q ′ 1;<br />

– (q1, q2) τ → (q1, q ′ τ<br />

2) if q2 →2 q ′ 2.<br />

AtraceofI�T (S) corresponds to an execution of the tester T (S) concurrently<br />

with an implementation I. One execution of the tester concurrently with<br />

an implementation only exercises one trace of the specification. The tester has<br />

to be rerun until all the traces of the specification have been tested <strong>in</strong> order to<br />

test conformance.<br />

6.2.2 F<strong>in</strong>ite State Mach<strong>in</strong>es<br />

The f<strong>in</strong>ite state mach<strong>in</strong>es model has been already <strong>in</strong>troduced <strong>in</strong> previous chapters.<br />

We briefly recall important def<strong>in</strong>itions <strong>in</strong> this section.<br />

Def<strong>in</strong>ition 6.2.9 (F<strong>in</strong>ite State Mach<strong>in</strong>e) A f<strong>in</strong>ite state mach<strong>in</strong>e (FSM for<br />

short) is a 5-tuple M =(S, X , Y , h, s0) where:<br />

• S is a f<strong>in</strong>ite non-empty set of states;<br />

• s0 ∈ S is the <strong>in</strong>itial state;<br />

• X is a f<strong>in</strong>ite set of <strong>in</strong>puts;<br />

• Y is a f<strong>in</strong>ite set of outputs, and it may <strong>in</strong>clude Θ which represents the null<br />

output;<br />

• h is a behavior function h :(S×X ) →P(S×Y ) \ {∅}.<br />

We recall some notations. Let a ∈ X , b ∈ Y , vi ∈ X×Y and γ ∈ (X×Y ) ∗ :<br />

s a/b<br />

−→ s ′ =def (s ′ , b) ∈ h(s, a)<br />

s ɛ ⇒ s ′ =def s = s ′ (i.e. ɛ is the empty sequence)<br />

s v0...vn<br />

=⇒ s ′ v0<br />

=def ∃ s0,...,sn : s = s0 → s1 ... vn → sn = s ′<br />

s γ ⇒ =def ∃ s ′ : s γ ⇒ s ′<br />

Traces(s) =def {γ | s γ ⇒}<br />

γ<strong>in</strong> =def <strong>in</strong>put sequences obta<strong>in</strong>ed by delet<strong>in</strong>g all outputs <strong>in</strong> γ<br />

Traces <strong>in</strong> (s) =def {γ<strong>in</strong> | s γ ⇒} : <strong>in</strong>put sequences of s<br />

Now we can def<strong>in</strong>e two useful relations for test generation.<br />

Def<strong>in</strong>ition 6.2.10 (Reduction relation) An FSM I (with <strong>in</strong>itial state i0) isa<br />

reduction of an FSM S, (with <strong>in</strong>itial state s0), written I ≤ S, iffi0 is a reduction<br />

of s0. Given two FSM states, i and s, i is a reduction of s, written i ≤ s, iff<br />

Traces <strong>in</strong> (s) ⊆ Traces <strong>in</strong> (i) and for all γ ∈ Traces(i) :γ <strong>in</strong> ∈ Traces <strong>in</strong> (s) ⇒ γ ∈<br />

Traces(s).<br />

That is, if I ≤ S, every <strong>in</strong>put sequence of S is an <strong>in</strong>put sequence of I and a trace<br />

γ of I is also a trace of S if γ <strong>in</strong> is an <strong>in</strong>put sequence of S. Roughly speak<strong>in</strong>g,<br />

an implementation I and a specification S must have the same behavior for the<br />

<strong>in</strong>put sequences of S, but I may have more <strong>in</strong>put sequences than S.<br />

The reduction relation is a preorder and can be used to def<strong>in</strong>e an equivalence:

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

Saved successfully!

Ooh no, something went wrong!