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.

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

be used to extract test cases from specifications given as logic programs, and<br />

why correctness proofs can be useful <strong>in</strong> test case generation.<br />

Symbolic execution is a program verification technique from the 1970s. Differently<br />

from the other verification techniques discussed <strong>in</strong> this chapter, symbolic<br />

execution was <strong>in</strong>itially applied to real code rather than to abstract models. Several<br />

software verification frameworks us<strong>in</strong>g symbolic execution were built <strong>in</strong> the<br />

1970s. However, their success was limited s<strong>in</strong>ce the required mathematical mach<strong>in</strong>ery<br />

was not sufficiently developed. Recently, the pr<strong>in</strong>ciples of symbolic execution<br />

have been reused to cope with the problems of state space explosion while<br />

search<strong>in</strong>g for execution traces <strong>in</strong> a software application’s abstract model. By replac<strong>in</strong>g<br />

actual system <strong>in</strong>puts with symbols, i.e., variables and sets of constra<strong>in</strong>ts<br />

over them, symbolic execution allows cop<strong>in</strong>g with the problem of unbounded<br />

entries – thus reduc<strong>in</strong>g state space explosion. There is however a price to pay<br />

s<strong>in</strong>ce traces found <strong>in</strong> this way are symbolic and need to be <strong>in</strong>stantiated. After<br />

<strong>in</strong>troduc<strong>in</strong>g the basic concepts of symbolic execution as it was <strong>in</strong>vented <strong>in</strong> the<br />

1970s for code verification, we will discuss several modern frameworks for test<br />

case generation that make use of symbolic execution. The examples are chosen<br />

to demonstrate that symbolic execution canbeusedbothwithabstractmodels<br />

and concrete code.<br />

Model check<strong>in</strong>g is a method for verify<strong>in</strong>g f<strong>in</strong>ite-state systems. Given a system<br />

model and a specification written <strong>in</strong> a temporal logic, the model checker automatically<br />

determ<strong>in</strong>es whether the model satisfies the specification. In addition to<br />

be<strong>in</strong>g fully automatic, an important feature of model check<strong>in</strong>g is that <strong>in</strong> pr<strong>in</strong>ciple<br />

a witness resp. counterexample can be supplied when the model succeeds resp.<br />

fails to satisfy the specification. There exist several approaches that establish<br />

connections between model check<strong>in</strong>g and model-based test<strong>in</strong>g. The ma<strong>in</strong> idea<br />

of these approaches is that test case specifications can be written <strong>in</strong> temporal<br />

logics such that the problem of test case generation is reduced to the problem of<br />

f<strong>in</strong>d<strong>in</strong>g a set of witnesses resp. counterexamples to the specification. S<strong>in</strong>ce model<br />

check<strong>in</strong>g <strong>in</strong> the context of test case generation is also covered by other chapters<br />

<strong>in</strong> this book, we will give only a short summary and refer to other chapters.<br />

This chapter is organized as follows: In Sec. 12.2, we present test case generation<br />

by theorem prov<strong>in</strong>g. The use of symbolic execution is then described <strong>in</strong><br />

Sec. 12.3. Afterwards, <strong>in</strong> Sec. 12.4, we cover test case generation by model check<strong>in</strong>g.<br />

F<strong>in</strong>ally, we summarize <strong>in</strong> Sec. 12.5. The responsibilities for the two ma<strong>in</strong><br />

parts of this chapter, namely theorem prov<strong>in</strong>g and symbolic execution, were splitted<br />

<strong>in</strong> the follow<strong>in</strong>g way: Marko Samer was responsible for Sec. 12.2 and Levi<br />

Lúcio was responsible for Sec. 12.3.<br />

12.2 Theorem Prov<strong>in</strong>g<br />

An automated theorem prover attempts to construct a proof for a given <strong>in</strong>put<br />

conjecture. However, s<strong>in</strong>ce for complex problems it is rarely possible to construct

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

Saved successfully!

Ooh no, something went wrong!