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.

352 Levi Lúcio and Marko Samer<br />

F<strong>in</strong>ally, the test cases are obta<strong>in</strong>ed by runn<strong>in</strong>g the Java PathF<strong>in</strong>der model<br />

checker over the <strong>in</strong>strumented code. For each of the criteria specified <strong>in</strong> logic<br />

formulas, witnesses or counter-examples traces are generated. As <strong>in</strong> the previous<br />

approaches, the path conditions for these traces may then be used the build the<br />

actual <strong>in</strong>put values to test the concrete system.<br />

12.4 Model Check<strong>in</strong>g<br />

In the next few paragraphs we will describe the application of model check<strong>in</strong>g<br />

for test case generation. Given that the topic is explored <strong>in</strong> depth <strong>in</strong> Chap. 19<br />

of the present volume, we limit ourselves to giv<strong>in</strong>g a short overview of the subject.<br />

Several approaches exist that establish connections between model check<strong>in</strong>g<br />

and model-based test<strong>in</strong>g (see [CSE96, EFM97, GH99, GRR03, HLSU02,<br />

HCL + 03, RH01a, RH01b]). In all these approaches the problem of test case generation<br />

is reduced to f<strong>in</strong>d<strong>in</strong>g witnesses or counterexamples to a set of temporal<br />

logic formulas. These temporal logic formulas express control flow oriented test<br />

coverage criteria (see [GH99, GRR03, RH01a, RH01b]) or data flow oriented<br />

test coverage criteria (see [HLSU02, HCL + 03]). The capability of model checkers<br />

to f<strong>in</strong>d witnesses and counterexamples to the logic formulas allows then test<br />

case generation to be fully automatic. The obta<strong>in</strong>ed execution traces are obta<strong>in</strong>ed<br />

from a simplified model of the application and can be used to test a real<br />

implementation either for correct traces or for error situations.<br />

In [CSE96, EFM97], the authors propose similar approaches that use test<br />

purposes <strong>in</strong>stead of test coverage criteria. Differently from test coverage criteria<br />

which capture structural entities of a model, test purposes express behavioral<br />

properties of a model. Examples are properties of certa<strong>in</strong> states or a sequence of<br />

states to be traversed.<br />

The authors of [ABM98, AB99] apply model check<strong>in</strong>g to test case generation<br />

for mutation analysis-based test coverage criteria. By apply<strong>in</strong>g mutation operators<br />

to either a system model or a property, mutants are produced. A test suite<br />

is then generated to cover the <strong>in</strong>consistent behaviors exhibited by the mutants.<br />

The capability of model checkers to construct counterexamples is used to f<strong>in</strong>d<br />

such <strong>in</strong>consistent behaviors.<br />

Model check<strong>in</strong>g-based test case generation provides several relevant features<br />

<strong>in</strong> comparison to other test case generation techniques. First, all details on test<br />

case generation are hidden <strong>in</strong>side the model checkers. This allows the test eng<strong>in</strong>eer<br />

to focus on only high-level specifications of test purposes or coverage criteria<br />

written <strong>in</strong> temporal logic. On the other hand, test case generation is language <strong>in</strong>dependent<br />

<strong>in</strong> the sense that the temporal logic formulas can be applied to various<br />

specification and programm<strong>in</strong>g languages without hav<strong>in</strong>g to build a dedicated<br />

tool for each language. F<strong>in</strong>ally, test case generation can be performed on large<br />

and complex models s<strong>in</strong>ce model check<strong>in</strong>g is a relatively mature technology.

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

Saved successfully!

Ooh no, something went wrong!