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.

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

a proof fully automatically, <strong>in</strong> most cases – especially <strong>in</strong> <strong>in</strong>dustrial applications –<br />

the user has to guide the proof search procedure. Such user controlled theorem<br />

provers are called semi-automated or <strong>in</strong>teractive. In this context, automated<br />

theorem prov<strong>in</strong>g is the process of construct<strong>in</strong>g a proof by an automated or<br />

semi-automated theorem prover.<br />

The importance of automated theorem prov<strong>in</strong>g arises not only from its mathematical<br />

and philosophical relevance, but also from the fact that many problems<br />

<strong>in</strong> artificial <strong>in</strong>telligence and formal verification can be reduced to theorem prov<strong>in</strong>g.<br />

In <strong>in</strong>dustrial environments, however, theorem prov<strong>in</strong>g is rarely used because<br />

it is very time consum<strong>in</strong>g and requires expert knowledge. Nevertheless, <strong>in</strong> some<br />

areas of high-quality productions [Sch00, Sch01], there is no adequate alternative<br />

to formally prove properties of the system under consideration. Moreover, there<br />

exist several attempts to comb<strong>in</strong>e theorem prov<strong>in</strong>g with model check<strong>in</strong>g <strong>in</strong> order<br />

to compensate the shortcom<strong>in</strong>gs of each other [ORR + 96, CCG + 03]. This can be<br />

seen as further evidence for the importance of automated theorem prov<strong>in</strong>g.<br />

In this section, we survey how automated theorem prov<strong>in</strong>g technology can<br />

be used <strong>in</strong> test case generation. Although theorem prov<strong>in</strong>g is often used <strong>in</strong> comb<strong>in</strong>ation<br />

with other techniques, we focus on approaches where theorem prov<strong>in</strong>g<br />

is the dom<strong>in</strong>at<strong>in</strong>g technique. The typical method <strong>in</strong> this context is based on formal<br />

specifications which model the SUT. Such a model resp. specification is then<br />

partitioned <strong>in</strong>to equivalence classes which are assumed to satisfy a uniformity<br />

hypothesis, i.e., they are assumed to represent the same behavior concern<strong>in</strong>g<br />

the test; <strong>in</strong> particular, test data <strong>in</strong> the same equivalence class are assumed to<br />

cause the same error (or no error <strong>in</strong> the case of success). Each such equivalence<br />

class is then <strong>in</strong>terpreted as one test case. Hence, because of the uniformity hypothesis,<br />

it suffices to extract a small amount of test data from each test case.<br />

Note that the test cases generated by the approaches presented <strong>in</strong> this section are<br />

s<strong>in</strong>gle <strong>in</strong>stances and not sequences of test cases as would be necessary for test<strong>in</strong>g<br />

reactive systems. Extensions for generat<strong>in</strong>g test case sequences are described <strong>in</strong><br />

the referred literature or are topic of future research.<br />

Our aim <strong>in</strong> the follow<strong>in</strong>g is to show how theorem provers can be applied<br />

to construct such test cases from a given specification. There exist three major<br />

approaches <strong>in</strong> the literature to address this issue:<br />

• Use theorem provers to generate test cases from Z specifications<br />

• Translate algebraic specifications <strong>in</strong>to logic programs and use Prolog’s theorem<br />

prov<strong>in</strong>g mechanisms to generate test cases<br />

• Construct formal proofs from which test cases can be extracted<br />

S<strong>in</strong>ce our focus will be on the first item, which is ma<strong>in</strong>ly based on the specification<br />

language Z, we start with a short <strong>in</strong>troduction of some basic concepts<br />

of this language.<br />

12.2.1 The Z Specification Language<br />

Z is a commonly used formal specification language based on set theory and<br />

first-order predicate logic [Spi92, PST96, ISO02]. As every formal specification

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

Saved successfully!

Ooh no, something went wrong!