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.

12 Technology of Test-Case Generation 347<br />

– Calculate the identification traces and the postamble after the “critical<br />

<strong>in</strong>vocation”: The identification trace consists of one or more operations<br />

to be executed <strong>in</strong> order to observe the behavior of the system after the<br />

critical step. The postamble trace is a sequence of operations that resets<br />

the state mach<strong>in</strong>e to the <strong>in</strong>itial state from where new test cases can be<br />

aga<strong>in</strong> searched for.<br />

It is then possible to concatenate the preamble trace with the critical <strong>in</strong>vocation<br />

traces with the identification traces. The rema<strong>in</strong><strong>in</strong>g symbolic parts<br />

of the traces are f<strong>in</strong>ally fully <strong>in</strong>stantiated <strong>in</strong> order to generate real test case<br />

scripts that can be applied to a concrete implementation of the application.<br />

While try<strong>in</strong>g to discrim<strong>in</strong>ate the verification techniques used <strong>in</strong> this framework<br />

we can identify clearly the usage of symbolic execution, but also of theorem<br />

prov<strong>in</strong>g s<strong>in</strong>ce a logic programm<strong>in</strong>g language (i.e. a theorem prover )isusedto<br />

calculate the boundary states.<br />

The second example on model-based test case generation we will discuss is<br />

presented by Pretschner et al. <strong>in</strong> [PPS + 03]. This approach also relies on a CLP<br />

tool to symbolically execute the abstract specification of the system. The application’s<br />

state space is then searched for symbolic traces that can be <strong>in</strong>stantiated<br />

to form <strong>in</strong>terest<strong>in</strong>g test cases.<br />

The specification model used <strong>in</strong> this case <strong>in</strong> the one used by the AUTOFO-<br />

CUS CASE tool - <strong>in</strong>spired from UML-RT (UML for Real-Time systems), especially<br />

directed towards the development of embedded systems. In this paradigm<br />

the system’s structure is def<strong>in</strong>ed as a network of components. Each of the bottom<br />

level component’s behavior is described by a state mach<strong>in</strong>e. Composition of the<br />

bottom level state mach<strong>in</strong>es generates higher level state mach<strong>in</strong>es and so on until<br />

the full system’s state mach<strong>in</strong>e is reached. As <strong>in</strong> the previous example, states<br />

are def<strong>in</strong>ed by state variables and the transitions are possible via commands (or<br />

operations) that are issued to the system.<br />

Before describ<strong>in</strong>g how the test cases are generated, it is useful to mention that<br />

the authors of the approach consider different k<strong>in</strong>ds of coverage of the execution<br />

state space. In [PPS + 03] they describe three different coverage classes:<br />

• Functional coverage: this sort of coverage implies generat<strong>in</strong>g test cases that<br />

exercise precise execution scenarios given <strong>in</strong> the specification. Both positive<br />

as well as negative test cases are <strong>in</strong>terest<strong>in</strong>g to validate the system;<br />

• Structural coverage: structural criteria implies for example issu<strong>in</strong>g sequences<br />

of commands that selectively test critical components of the system. Another<br />

example is the coverage of states that may be considered dangerous or unsafe;<br />

• Stochastic coverage: us<strong>in</strong>g this approach random traces are generated through<br />

the execution state space of the application. Despite the search not be<strong>in</strong>g<br />

directed, this sort of coverage may still produce relevant test cases.

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

Saved successfully!

Ooh no, something went wrong!