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.

14 Tools for Test Case Generation 415<br />

has never been applied to case studies; its ma<strong>in</strong> function is educational, to illustrate<br />

the Canonical Tester theory and the Co-Op method [Wez90, Wez95]<br />

to derive canonical testers. The underly<strong>in</strong>g theory is discussed <strong>in</strong> Section 6.4.2<br />

(page 166).<br />

Test Generation Process<br />

(Most of the follow<strong>in</strong>g is quoted/paraphrased from [Wez95].)<br />

Cooper implements the implementation relation conf of [Bri89]. In this notion<br />

a process B1 conforms to B2 if and only if B1 conta<strong>in</strong>s no unexpected<br />

deadlocks with respect to traces of B2. So,ifB1 performs a trace that can also<br />

be done by B2, and at a certa<strong>in</strong> po<strong>in</strong>t B1 deadlocks, then also B2 should be<br />

able to perform the same trace and deadlock at the same po<strong>in</strong>t. This notion of<br />

conformance allows B1 to perform traces that are not <strong>in</strong> B2. But when we place<br />

B1 <strong>in</strong> an environment that expects B2, it will not deadlock unexpectedly with<br />

the environment.<br />

A canonical tester is then a process that can test whether an implementation<br />

conforms to a specification with respect to the conf relation. To test whether a<br />

process P conforms to B we place a canonical tester T (B) <strong>in</strong> parallel with P.<br />

The tester synchronizes with P, as expla<strong>in</strong>ed below.<br />

In the <strong>in</strong>itial version of the Co-Op method on which Cooper is based, we only<br />

have basic actions (events) without values. There is no partition<strong>in</strong>g <strong>in</strong> <strong>in</strong>put and<br />

output actions, and <strong>in</strong>teraction between tester and implementation is by synchroniz<strong>in</strong>g<br />

on observable actions. This means that an action can only “happen”<br />

if both the tester and the implementation can “do” it. If only one of them (tester<br />

and implementation) is will<strong>in</strong>g (or able) to do an action, and the other one can<br />

not do the action, then it can not happen. If at a given moment the tester or<br />

the implementation has no actions that it can do, or if the <strong>in</strong>tersection of the<br />

sets of actions that they can do is empty (which means that there are no actions<br />

that they can do together), then they deadlock. There is the notion of an<br />

unobservable, <strong>in</strong>ternal (τ) action. And, from there, there is the notion of stable<br />

and unstable states. Stable states are those from which the implementation will<br />

only move after an <strong>in</strong>teraction with its environment. Unstable states are states<br />

from which the implementation can move by itself, by perform<strong>in</strong>g some <strong>in</strong>ternal<br />

action.<br />

If the tester tries to test an action x that is performed from an unstable<br />

state, it is possible that the implementation has moved to a different state and<br />

no longer wants to do x .So,x can be seen as an action that is (for the given<br />

state) optional <strong>in</strong> the implementation (the implementation may want to do it,<br />

but it also possible that the implementation no longer can do it because it moved<br />

to a different state where the action is not possible). However, <strong>in</strong> general, after<br />

the implementation has moved (by do<strong>in</strong>g an <strong>in</strong>ternal action) “through” zero or<br />

more unstable states, it will end up <strong>in</strong> a stable state from which it cannot move<br />

by itself (there are no <strong>in</strong>ternal actions possible). For such a stable state, the<br />

tester must be will<strong>in</strong>g to do at least one of actions that the implementation<br />

wants to do from there. Otherwise the tester might deadlock with a correct

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

Saved successfully!

Ooh no, something went wrong!