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.

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

We can read this def<strong>in</strong>ition <strong>in</strong> the follow<strong>in</strong>g way. An implementation i is<br />

≤iot-correct with respect to a specification s if for all traces with which we test,<br />

the set of outputs of the implementation after such a trace is a subset of the<br />

set of outputs of the specification after the same trace. In terms of observations<br />

this means that we should not be able to observe different or more behavior<br />

from the implementation than from the specification. A possible output is the<br />

absence of output or quiescence. We use the meta-label δ to denote quiescence.<br />

It is <strong>in</strong>terest<strong>in</strong>g to know that the ≤iot relation is equivalent with the quiescent<br />

preorder (and thus with the must preorder) [Tre96b].<br />

Example. We will illustrate the <strong>in</strong>put output test<strong>in</strong>g relation with the example<br />

of the trace <strong>in</strong>clusion preorder <strong>in</strong> Figure 7.2. The implementation i1 is ≤iotcorrect<br />

with respect to specification s. We see that it does not implement the<br />

coffee output after press<strong>in</strong>g the button twice, so how can it be correct? Let us<br />

take a look at the def<strong>in</strong>ition of ≤iot. The specification prescribes that the set of<br />

outputs after the trace button·button = {coffee,tea}. When we take a look at<br />

i1 we see that the set of outputs after button·button = {tea}. Because {tea} ⊆<br />

{coffee,tea} it is correct behavior. So the <strong>in</strong>tuition beh<strong>in</strong>d non determ<strong>in</strong>istic<br />

output is that we do not care which branch is implemented as long as at least one<br />

is. We can do the same analysis for implementation i2. Here we f<strong>in</strong>d that after<br />

press<strong>in</strong>g the button twice i2 does not give any output; it is quiescent. This means<br />

that out(i2 after button·button) ={δ}. This is not a subset of {coffee,tea} and<br />

there fore i2 �≤iot s. Weseethat≤iot is a stronger implementation relation than<br />

external trace <strong>in</strong>clusion and furthermore one that agrees more with our <strong>in</strong>tuition.<br />

ioconf relation The <strong>in</strong>put-output variant of the conf relation is called ioconf<br />

[Tre96b]. The difference with the <strong>in</strong>put-output test<strong>in</strong>g relation is that it uses<br />

a different set of traces to test with, namely the set of all possible traces of<br />

the specification: traces(s).Thismeansthatwewillnottestbehaviorthatis<br />

not specified. One way to <strong>in</strong>terpret this is as implementation freedom: “Wedo<br />

not know or care what the implementation does after an unspecified trace”.<br />

The advantage of this is that we can test with <strong>in</strong>complete specifications. S<strong>in</strong>ce<br />

traces(s) ⊆ L ∗ ,theioconf relation is weaker than the ≤iot relation.<br />

Def<strong>in</strong>ition 7.16 (ioconf). Let i ∈IOTS(I , U ), s ∈LTS(I , U )<br />

i ioconf s =def ∀σ ∈ traces(s) :out(i after σ) ⊆ out(s after σ).<br />

Example. In Figure 7.6 we illustrate the ioconf relation. i1 is the same implementation<br />

as <strong>in</strong> the examples for external trace <strong>in</strong>clusion and ≤iot. This<br />

implementation is still correct under ioconf. This is easy to see, because<br />

the trace button·button ∈ traces(s); it is a trace of the specification and<br />

out(i1afterbutton·button) ={tea} ⊆out(safterbutton·button) ={coffee,tea}.<br />

Implementation i2 <strong>in</strong>troduces new behavior. When we kick the coffee mach<strong>in</strong>e it<br />

outputs soup. This k<strong>in</strong>d of behavior is nowhere to be found <strong>in</strong> the specification;<br />

the behavior of kick<strong>in</strong>g the mach<strong>in</strong>e is underspecified. This k<strong>in</strong>d of behavior<br />

would be a problem for ≤iot s<strong>in</strong>ce it will test on all possible behavior of the label

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

Saved successfully!

Ooh no, something went wrong!