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.

4 Conformance Test<strong>in</strong>g<br />

Angelo Gargant<strong>in</strong>i<br />

Dipartimento di Matematica e Informatica<br />

University of Catania<br />

gargant<strong>in</strong>i@dmi.unict.it<br />

4.1 Introduction<br />

In this chapter we tackle the problem of conformance test<strong>in</strong>g between f<strong>in</strong>ite<br />

state mach<strong>in</strong>es. The problem can be briefly described as follows [LY96]. Given<br />

a f<strong>in</strong>ite state mach<strong>in</strong>e MS which acts as specification and for which we know<br />

its transition diagram, and another f<strong>in</strong>ite state mach<strong>in</strong>e MI which is the alleged<br />

implementation and for which we can only observe its behavior, we want<br />

to test whether MI correctly implements or conforms to MS . The problem of<br />

conformance test<strong>in</strong>g is also called fault detection, because we are <strong>in</strong>terested <strong>in</strong><br />

uncover<strong>in</strong>g where MI fails to implement MS ,ormach<strong>in</strong>e verification <strong>in</strong> the<br />

circuits and switch<strong>in</strong>g systems literature.<br />

We assume that the reader is familiar with the def<strong>in</strong>itions given <strong>in</strong> Chapter<br />

21, that we briefly report here. A f<strong>in</strong>ite state Mealy mach<strong>in</strong>e (FSM) is a qu<strong>in</strong>tuple<br />

M = 〈I , O, S,δ,λ〉 where I , O, andS are f<strong>in</strong>ite nonempty sets of <strong>in</strong>put symbols,<br />

output symbols, andstates, respectively, δ : S × I → S is the state transition<br />

function, λ : S × I → O is the output function. When the mach<strong>in</strong>e M is a<br />

current state s <strong>in</strong> S and receives an <strong>in</strong>put a <strong>in</strong> I , it moves to the next state<br />

δ(s, a) produc<strong>in</strong>g the output λ(s, a). An FSM can be represented by a state<br />

transition diagram as shown <strong>in</strong> Figure 4.1. n = |S| denotes the number of states<br />

and p = |I | the number of <strong>in</strong>puts. An <strong>in</strong>put sequence x is a sequence a1, a2,...,ak<br />

of <strong>in</strong>put symbols, that takes the mach<strong>in</strong>e successively to states si+1 = δ(si, ai),<br />

i =1,...,k, with the f<strong>in</strong>al state sk+1 that we denote by δ(s1, x ). The <strong>in</strong>put<br />

sequence x produces the output sequence λ(s1, x ) = b1,...,bk ,wherebk =<br />

λ(si, ai), i = 1,...,k. Given two <strong>in</strong>put sequences x and y, x .y is the <strong>in</strong>put<br />

sequence obta<strong>in</strong>ed by concatenat<strong>in</strong>g x with y.<br />

The detection of faults <strong>in</strong> the implementation MI can be performed by the<br />

follow<strong>in</strong>g experiment. Generate a set of <strong>in</strong>put sequences from the mach<strong>in</strong>e MS .<br />

By apply<strong>in</strong>g each <strong>in</strong>put sequence to MS , generate the expected output sequences.<br />

Each pair of <strong>in</strong>put sequence and expected output sequence is a test and the set<br />

of tests is a test suite (accord<strong>in</strong>g to the def<strong>in</strong>itions given <strong>in</strong> Chapter 20). Apply<br />

each <strong>in</strong>put sequence to MI and observe the output sequence. Compare this actual<br />

output sequence with the expected output sequence and if they differ, then a<br />

fault has been detected. As well known, this procedure of test<strong>in</strong>g, as it has been<br />

presented so far, can only be used to show the presence of bugs, but never to<br />

show their absence 1 . The goal of this chapter is to present some techniques and<br />

1 Dijkstra, of course<br />

M. Broy et al. (Eds.): Model-Based Test<strong>in</strong>g of Reactive Systems, LNCS <strong>3472</strong>, pp. 87-111, 2005.<br />

© Spr<strong>in</strong>ger-Verlag Berl<strong>in</strong> Heidelberg 2005

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

Saved successfully!

Ooh no, something went wrong!