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 331<br />

(b? > m?) ∧ (k mod 2 = 1) to the predicate part of the orig<strong>in</strong>al schema, we<br />

obta<strong>in</strong> after some simplifications the complete test case schema:<br />

Modulo (Partition4)<br />

b?, m?, r! :N<br />

b? > m?<br />

(r! < m?) ∨ (m? =0)<br />

∃ k : N • (k mod 2 = 1) ∧ (b? =m? ∗ k + r!)<br />

This test case can be further ref<strong>in</strong>ed by transform<strong>in</strong>g it <strong>in</strong>to disjunctive normal<br />

form as <strong>in</strong> the previous approach, which yields two ref<strong>in</strong>ed test cases:<br />

(b? > m?) ∧ (r! < m?) ∧∃k : N • ((k mod 2 = 1) ∧ (b? =m? ∗ k + r!))<br />

(b? > m?) ∧ (m? =0)∧∃k : N • ((k mod 2 = 1) ∧ (b? =m? ∗ k + r!))<br />

Note that <strong>in</strong> addition to the semantic aspects, the classification-tree method<br />

provides a hierarchical structur<strong>in</strong>g of the test cases, while test cases <strong>in</strong> the pure<br />

disjunctive normal form approach are completely unstructured. An application of<br />

theorem prov<strong>in</strong>g to support this approach was presented by Sadeghipour [Sad98].<br />

In particular, the theorem prover Isabelle [Pau94, NPW02] is used as <strong>in</strong>tegral<br />

part of a tool environment for test case generation based on the classificationtree<br />

method. The theorem prover is applied, e.g., for simplification tasks, for<br />

check<strong>in</strong>g test data consistency, and for test evaluation.<br />

Partition<strong>in</strong>g Heuristics. An approach with the objective of build<strong>in</strong>g a uniform<br />

theoretical foundation and generaliz<strong>in</strong>g the above methods was presented<br />

by Burton et al. [BCM00, Bur00, Bur02]. This approach is based on CADiZ<br />

[TM95, Toy96, Toy98], a Z type checker and theorem prover. S<strong>in</strong>ce the <strong>in</strong>put<br />

language of CADiZ is Z itself, there is no necessity for translat<strong>in</strong>g Z specifications.<br />

The ma<strong>in</strong> difference to the approaches of Helke et al. [HNS97], S<strong>in</strong>gh<br />

et al., and Sadeghipour [SCS97, Sad98] is that various partition<strong>in</strong>g heuristics<br />

are supported <strong>in</strong> the work of Burton et al. [BCM00, Bur00, Bur02]. In particular,<br />

the test case generation of Helke et al. [HNS97] is based on disjunctive<br />

normal form partition<strong>in</strong>g as shown above. This partition<strong>in</strong>g, however, can be<br />

generalized by other partition<strong>in</strong>g heuristics such as heuristics based on boundary<br />

value analysis or type analysis. For <strong>in</strong>stance, the predicate m ≥ 0canbe<br />

partitioned by boundary value analysis <strong>in</strong>to (m =0)∨ (m =1)∨ (m > 1),<br />

and the doma<strong>in</strong> of the variable n ∈ Z can be partitioned by type analysis <strong>in</strong>to<br />

(n < 0) ∨ (n =0)∨ (n > 0).<br />

In addition, the partition<strong>in</strong>g can also be based on fault-based heuristics which<br />

take the experience of faults detected <strong>in</strong> previous builds <strong>in</strong>to account. For <strong>in</strong>stance,<br />

if the specified operation n 2 is assumed to be <strong>in</strong>correctly implemented<br />

as 2 ∗ n, wheren ∈ N, then the partition<strong>in</strong>g would be (n =1)∨ (n > 2) because<br />

n 2 and 2 ∗ n cannot be dist<strong>in</strong>guished by n =0andn =2.<br />

Of course, these partition<strong>in</strong>gs can also be performed by the classification-tree<br />

method of S<strong>in</strong>gh et al. and Sadeghipour [SCS97, Sad98]. However, as we will see

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

Saved successfully!

Ooh no, something went wrong!