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 401<br />

vertices and random selection with<strong>in</strong> the polyhedron. The assignments to the<br />

Boolean and numerical variables obta<strong>in</strong>ed by this procedure are used as <strong>in</strong>put<br />

vector to the SUT.<br />

An Optimization Lurette does not only test l<strong>in</strong>ear test sequences. In each step<br />

of a test sequence generation and execution, Lurette tests several <strong>in</strong>puts with<br />

the SUT. More precisely, it computes the output of the SUT for a whole set<br />

of <strong>in</strong>put vectors and checks whether each of the correspond<strong>in</strong>gly cont<strong>in</strong>ued test<br />

sequences would be correct. This is possible, s<strong>in</strong>ce the SUT is required to provide<br />

one method to produce the next output of the SUT without chang<strong>in</strong>g its state,<br />

and a separate method to advance the state of the SUT. If an error is found, the<br />

test sequence which provoked the error is returned along with a fail verdict and<br />

Lurette term<strong>in</strong>ates. If no error is detected, then the test sequence is cont<strong>in</strong>ued<br />

with one of the tested <strong>in</strong>puts. This is possible, s<strong>in</strong>ce Lurette is requir<strong>in</strong>g the SUT<br />

to be given <strong>in</strong> a way that allows to compute the output of the SUT on a given<br />

<strong>in</strong>put vector without advanc<strong>in</strong>g its <strong>in</strong>ternal state.<br />

SUT Program Format<br />

To test a program with Lurette, this program must be given as a C-file which<br />

implements a synchronous reactive program. In particular, the C-file must implement<br />

a specific <strong>in</strong>terface to be <strong>in</strong>tegrated <strong>in</strong>to the test harness. This <strong>in</strong>terface<br />

must allow to access the follow<strong>in</strong>g elements:<br />

• The names and types of the <strong>in</strong>puts and outputs of the SUT, such that the<br />

test harness can connect to the SUT with the test case generator.<br />

• The <strong>in</strong>itialization procedure <strong>in</strong>itP must br<strong>in</strong>g the SUT P <strong>in</strong>to its <strong>in</strong>itial state.<br />

• The output procedure o = outP(i) has to compute the output of P based<br />

on the current <strong>in</strong>ternal state of P and the <strong>in</strong>put i. NotethatacalltooutP<br />

is not allowed to change the state of P.<br />

• F<strong>in</strong>ally, the procedure nextP(i) hastobr<strong>in</strong>gP <strong>in</strong>to the next state, aga<strong>in</strong> on<br />

the basis of the current <strong>in</strong>ternal state and the <strong>in</strong>put i.<br />

The Lustre compiler which is provided for free by Verimag produces C-files<br />

which are suitable for Lurette. Alternatively, the code generator of the SCADE<br />

environment 4 can be used to obta<strong>in</strong> appropriate <strong>in</strong>put files for Lurette. Other<br />

synchronous languages are probably adaptable to Lurette by wrapp<strong>in</strong>g the generated<br />

code <strong>in</strong>to the above described procedures.<br />

To <strong>in</strong>tegrate an oracle <strong>in</strong>to a test harness, it must be provided <strong>in</strong> the same form<br />

as the SUT P.<br />

4 SCADE is a suite for develop<strong>in</strong>g dependable software, <strong>in</strong>clud<strong>in</strong>g tools to facilitate<br />

specification, code generation, and code validation. It is based on a graphical implementation<br />

of the Lustre language. See http://www.esterel-technologies.com.

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

Saved successfully!

Ooh no, something went wrong!