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.

7 I/O-automata Based Test<strong>in</strong>g 197<br />

To implement this approach, it is necessary to def<strong>in</strong>e concretely what is a<br />

canonical tester, as well as the way of assign<strong>in</strong>g a test verdict with the couple<br />

(tester, implementation).<br />

To ensure homogeneity with the specifications and the implementations, the<br />

canonical testers are modelled with IOSM. The canonical tester depends directly<br />

<strong>in</strong> the one hand on the implementation relation to be tested, and <strong>in</strong> the other<br />

hand on the trace mach<strong>in</strong>e of the specification. The trace mach<strong>in</strong>e of a specification<br />

S is a determ<strong>in</strong>istic IOSM not compris<strong>in</strong>g any <strong>in</strong>ternal action τ and hav<strong>in</strong>g<br />

the same set of traces as the <strong>in</strong>itial IOSM of S.<br />

Def<strong>in</strong>ition 7.35 (Trace Mach<strong>in</strong>e).<br />

Thetracemach<strong>in</strong>eofanIOSMS = 〈Ss, Ls, Ts, s0s〉, notedTM (S), is an IOSM<br />

TM (S) =CC (〈St , Lt, Tt, s0t〉) def<strong>in</strong>ed by:<br />

(1) St is the set of subsets of Ss: astatest ofthetracemach<strong>in</strong>eisthusasetof<br />

states of the specification st = {sis}1≤i≤n<br />

(2) Lt = Ls<br />

(3) s0t = {s | (s0s,ε,s)}<br />

(4) the transitions of the trace mach<strong>in</strong>e are exactly those obta<strong>in</strong>ed <strong>in</strong> the follow-<br />

<strong>in</strong>g way: for all s ∈ St and µ ∈{!, ?}×Ls, givens ′ = {sj | (∃ sis ∈ Ss)(sis, ⇀<br />

µ<br />

, sj )}, ifs ′ = ∅ then (s,µ,s ′ ) ∈ Tt .<br />

The trace mach<strong>in</strong>e generation is similar to the determ<strong>in</strong>ation of an notdeterm<strong>in</strong>istic<br />

automaton as <strong>in</strong>troduced by J. Hopcroft and J. Ullman <strong>in</strong> [HU79].<br />

Thus, from any IOSM, it is possible to calculate a trace mach<strong>in</strong>e, which exactly<br />

represents the traces of the <strong>in</strong>itial IOSM.<br />

Property 7.36. Tr(S) =Tr (TM (S))<br />

The mechanism of verdict assignment is based on an parallel execution of<br />

the canonical tester with the implementation to be tested. The verdict is then<br />

pronounced accord<strong>in</strong>g to the properties of the IOSM which represents this parallel<br />

composition. Indeed, the canonical tester has one particular state, called<br />

fail, which <strong>in</strong>dicates that an error has been detected.<br />

Def<strong>in</strong>ition 7.37 (Verdict of a canonical tester).<br />

The failure of a tester T applied to an implementation I is def<strong>in</strong>ed by: Fail (T , I )<br />

iff (∃ σ ∈ Tr (T ))( ⇀ σ ∈ Tr (I ) ∧ (T ,σ,fail)).<br />

The verdict is Succ(T , I )iff¬(Fail (T , I )) holds.<br />

The verdict assigned by the canonical tester is also def<strong>in</strong>ed as a global (or<br />

total) verdict.<br />

We now present the test theory proposed by M. Phalippou us<strong>in</strong>g a concrete<br />

example. This example is based on the specification of the coffee mach<strong>in</strong>e example.<br />

The specification S <strong>in</strong>troduced <strong>in</strong> figure 7.8 and implementations I1, I2, I3<br />

and I4 <strong>in</strong>troduced <strong>in</strong> figure 7.9 are used to illustrate the various steps to apply<br />

this test<strong>in</strong>g theory.

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

Saved successfully!

Ooh no, something went wrong!