Korat
whitebox, systematic testing tool for linked data structures
Randoop
feedback-directed random testing for classes and libraries
creates new test guided by feedback from previous tests
problem with automated testing
small test case hypothesis
how to generate inputs
Korat algorithm
The total number of candidate vectors/shapes for a at-most 3 node binary tree in Korat?
7 fields, 4 choices each -> 4^7, but we are only interested in 9 of them
The total number of candidate vectors/shapes for an at-most k node binary tree in Korat?
(k+1)^(2k+1)
steps Korat follows
Korat’s strength
- for linked data structures, small, easily specified procedures, unit testing
Korat’s weakness
- only as good as the pre and post conditions
Randoop’s recipe
randomly create new test guided by feedback from previously created tests
Randoop’s input
condition for violating test cases to exist in the output of Randoop
Randoop’s algorithm
Create new sequence:
Classify new sequence: discard/ output as test/ add to components
illegal sequence
- violates some precondition during execution
redundant sequences
use type information to guide test generation is a characteristic of
both Korat and Randoop
each test is fully independent of the past tests is a characteristic of
neither
generate test deterministically is a characteristic of
Korat
suited to test method seq is a characteristic of
Randoop
Avoid generating redundant test is a characteristic of
both Korat and Randoop
if a list function works for lists of length 0 to 3, what conclusion can we draw?
it probably works for all lists
korat’s precondition technique