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.

15 Case Studies 451<br />

reached, the test is output. If the randomly chosen coverage task cannot reach a<br />

f<strong>in</strong>al state then no test is generated. GOTCHA outputs abstract test cases, each<br />

consists of a sequence of states.<br />

Abstract Test Case Generation with Constra<strong>in</strong>t Logic Programm<strong>in</strong>g In the case<br />

study of model-based test case generation for smart cards described <strong>in</strong> [PPS + 03],<br />

Constra<strong>in</strong>t Logic Programm<strong>in</strong>g (CLP) was used to compute the set of all possible<br />

execution traces of f<strong>in</strong>ite length. First, the test model developed <strong>in</strong> AutoFocus is<br />

translated <strong>in</strong>to a CLP program. Second, the test specification is also translated<br />

<strong>in</strong>to the CLP language and added to the CLP program of the model. F<strong>in</strong>ally,<br />

a logic programm<strong>in</strong>g eng<strong>in</strong>e solves the program us<strong>in</strong>g depth-first search with<br />

backtrack<strong>in</strong>g and computes the set of all possible execution traces of the model<br />

up to a certa<strong>in</strong> length. These traces are the abstract test cases. More details<br />

on the use of CLP for test case generation <strong>in</strong> this case study [PPS + 03] were<br />

presented <strong>in</strong> Sec. 12.3.2. More details on AutoFocus are available <strong>in</strong> Sec. 14.2.4.<br />

Abstract Test Case Generation Us<strong>in</strong>g Genesys In [FKL99], Genesys was used to<br />

generate an architecture validation suite for PowerPC architecture to be used<br />

for test<strong>in</strong>g PowerPC implementations. Genesys is specifically designed for test<strong>in</strong>g<br />

processor architectures.<br />

The <strong>in</strong>puts to Genesys are a test model and a behavioral simulator for the<br />

SUT and a test specification. The test specification allows the <strong>in</strong>corporation of<br />

complex heuristic test<strong>in</strong>g knowledge <strong>in</strong> the form of generation and validation<br />

functions coded <strong>in</strong> C by test eng<strong>in</strong>eers. These functions serve many purposes,<br />

e.g., they enable adjust<strong>in</strong>g the probability distribution of the targeted test space.<br />

As a simple example, the result of zero for an ADD <strong>in</strong>struction is typically of<br />

special importance while its relative probability to occur randomly is practically<br />

<strong>in</strong>existent. A generation and validation function can be implemented to <strong>in</strong>form<br />

the test generator that the result of zero is important, and should thus be generated<br />

with a reasonable probability. More generally, these functions can be used<br />

to give adequate weights to corner cases which otherwise would be occurr<strong>in</strong>g<br />

with negligible probability.<br />

Genesys directly generates executable test cases by comb<strong>in</strong><strong>in</strong>g abstract test<br />

generation and concretization. Genesys outputs a test file, which consists of a<br />

sequence of <strong>in</strong>structions start<strong>in</strong>g from a given <strong>in</strong>itial state, and a section of expected<br />

results describ<strong>in</strong>g the expected values of the various processor resources.<br />

Test case generation is done us<strong>in</strong>g depth-first search with backtrack<strong>in</strong>g and<br />

check<strong>in</strong>g aga<strong>in</strong>st validation functions. First, the test model has the PowerPC<br />

<strong>in</strong>structions modeled as trees at the semantic level of the processor architecture.<br />

An <strong>in</strong>struction tree <strong>in</strong>cludes the <strong>in</strong>struction’s format and a semantic procedure<br />

at the root, operands and sub-operands as <strong>in</strong>ternal nodes and length, address<br />

and data types of each operand as leaves of the <strong>in</strong>termediate node represent<strong>in</strong>g<br />

this operand. Second, generation of an <strong>in</strong>struction <strong>in</strong>stance is done by travers<strong>in</strong>g<br />

the <strong>in</strong>struction tree <strong>in</strong> a depth-first order. Travers<strong>in</strong>g a node <strong>in</strong>volves <strong>in</strong>vok<strong>in</strong>g<br />

all the generation and validation functions associated with it.

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

Saved successfully!

Ooh no, something went wrong!