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.

14 Tools for Test Case Generation 397<br />

constra<strong>in</strong>ts to guide the test sequence generation. The environment description<br />

computes a predicate which <strong>in</strong>dicates whether the test sequence is relevant or<br />

not. The test sequence generator <strong>in</strong>verts this predicate, i.e., it computes the set<br />

of <strong>in</strong>puts for the SUT which satisfy the environment description. In every step,<br />

the oracle is provided with the last <strong>in</strong>put/output pair of the SUT to compute a<br />

pass or fail verdict for the sequence tested so far.<br />

Random Test<strong>in</strong>g The behavior of the environment is restricted by a set of<br />

constra<strong>in</strong>ts which must be satisfied unconditionally by the whole test sequence.<br />

For example, an environment description for a telephone-system will allow a<br />

test sequence such as oni, diali , offi, oni, diali , offi ...,whereoni is the event of<br />

pick<strong>in</strong>g up the phone i, diali is the event of dial<strong>in</strong>g a number, and offi is the<br />

event of hang<strong>in</strong>g up. A sequence start<strong>in</strong>g with oni, oni,... would not be allowed<br />

by the environment description, s<strong>in</strong>ce it is physically impossible to pick up the<br />

same phone twice.<br />

Random test<strong>in</strong>g is the most basic mode of operation, where Lutess generates<br />

test sequences which respect the environment constra<strong>in</strong>ts based on a uniform<br />

distribution.<br />

Operational Profile-Based Test<strong>in</strong>g Although random test sequences are<br />

possible <strong>in</strong>teractions between the SUT and the environment, the aris<strong>in</strong>g test sequences<br />

lack realism, i.e., most sequences which occur <strong>in</strong> the target environment<br />

are not generated s<strong>in</strong>ce they unlikely happen at random. To obta<strong>in</strong> more realistic<br />

test sequences, Lutess allows to add operational profiles to the environment<br />

description. An operational profile CP(e) = 〈(p1, c1),...,(pn, cn)〉 associates<br />

conditional probabilities (pi , ci) with an <strong>in</strong>put e. If the condition ci evaluates to<br />

true, then the <strong>in</strong>put e of the SUT will be set to true with probability pi <strong>in</strong> the<br />

next step. Therefore, operational profiles do not rule out unexpected cases, but<br />

they are emphasiz<strong>in</strong>g more common sequences of events.<br />

Property-Guided Test<strong>in</strong>g Next, Lutess provides property guided test<strong>in</strong>g. In<br />

this case, Lutess will try to generate test sequences which test safety properties.<br />

For example, if a property of the form a ⇒ b should be an <strong>in</strong>variance, then<br />

Lutess will set a to true if such a sett<strong>in</strong>g is consistent with the basic environment<br />

constra<strong>in</strong>ts. However, Lutess is only able to provide this feature for expressions<br />

that do not <strong>in</strong>volve references <strong>in</strong>to the past. For example pre(a) ⇒ b cannot<br />

be used for property guided test<strong>in</strong>g, s<strong>in</strong>ce pre(a) is refers to the value of the<br />

expression a <strong>in</strong> the last step.<br />

Pattern-Based Test<strong>in</strong>g F<strong>in</strong>ally, Lutess provides pattern-based test<strong>in</strong>g. A pattern<br />

BP =[true]cond0[<strong>in</strong>ter1]cond1 ...[<strong>in</strong>tern]condn is a sequence of conditions<br />

cond0,...,<br />

condn with associated <strong>in</strong>terval conditions <strong>in</strong>ter1,...,<strong>in</strong>tern. Lutess probabilistically<br />

generates test sequences which match the pattern, i.e., if the environment

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

Saved successfully!

Ooh no, something went wrong!