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

vectors, then the complete test sequence can be reproduced based on the <strong>in</strong>itial<br />

random seed given to the test sequence generator.<br />

Lutess is aimed at two goals – first it supports a monoformalistic approach,<br />

i.e., the software specification, the test specification and the program itself can be<br />

stated <strong>in</strong> the same programm<strong>in</strong>g language. Second, the same technology should<br />

support verification and test<strong>in</strong>g techniques [dBORZ99].<br />

Lustre<br />

Lustre is a high-level programm<strong>in</strong>g language for reactive systems [HCRP91,<br />

CPHP87] which comb<strong>in</strong>es two ma<strong>in</strong> concepts, namely it is a dataflow oriented<br />

as well as a time-synchronous language.<br />

Lustre is based on the synchrony hypothesis, i. e., a Lustre program is written<br />

with the assumption that every reaction of the program to an external event is<br />

executed <strong>in</strong>stantaneously. In other words, it is assumed that the environment<br />

does not change its state dur<strong>in</strong>g the computation of a reaction. This allows the<br />

use of an idealized notion of time where each <strong>in</strong>ternal event of a program takes<br />

place at a known po<strong>in</strong>t <strong>in</strong> time with respect to the history of external events.<br />

To make this concept usable <strong>in</strong> practice, Lustre is designed such that each<br />

Lustre program can be compiled <strong>in</strong>to a f<strong>in</strong>ite IO-automaton where each state<br />

transition is compiled <strong>in</strong>to a piece code without branches. A transition of this<br />

automaton corresponds to an elementary reaction of the program. Thus, it is<br />

possible to give an accurate upper bound on the maximum reaction time of the<br />

program for a given mach<strong>in</strong>e. This structur<strong>in</strong>g of compiled synchronous programs<br />

was <strong>in</strong>troduced <strong>in</strong> the context of the Esterel language [BC85]. Taken together,<br />

this approach allows to check the synchrony hypothesis.<br />

Many reactive systems are easily and naturally modeled <strong>in</strong> terms of dataflows.<br />

Each dataflow is a mapp<strong>in</strong>g of discrete time to values, i.e., a dataflow X represents<br />

a sequence of values x1, x2,.... In Lustre, reactive systems are composed<br />

of flows of data which are recomb<strong>in</strong>ed and transformed by a set of operators. In<br />

fact each variable <strong>in</strong> Lustre represents a dataflow. So for example, <strong>in</strong> Lustre the<br />

statement X = Y + Z means that each element of the flow X equals the sum<br />

of the correspond<strong>in</strong>g elements of the flows Y and Z , i.e., if Y = y1, y2,... and<br />

Z = z1, z2,... then X = x1, x2,... with xi = yi + zi.<br />

Advantages of the dataflow approach are that it is functional and parallel.<br />

Functional programs are open to automated analysis and transformation because<br />

of the lack of side-effects. Parallel components are naturally expressed <strong>in</strong> Lustre<br />

by <strong>in</strong>dependent dataflows. Synchronization is implicitly described by data<br />

dependencies between the different dataflows.<br />

The follow<strong>in</strong>g piece of code implements a counter as a so called node. 1 A<br />

node recomb<strong>in</strong>es a set of dataflows <strong>in</strong>to a new one. In this case val <strong>in</strong>it is used<br />

as <strong>in</strong>itialization of the new flow which is then <strong>in</strong>cremented by val <strong>in</strong>cr <strong>in</strong> each<br />

cycle.<br />

1 This example has been taken from [HCRP91].

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

Saved successfully!

Ooh no, something went wrong!