Automated testing Flashcards

1
Q

Randoop

A

feedback directed
random testing. It is suited for unit testing of Java program fragments like
classes and libraries.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Leveraging types

A

Consider this remove method in Java, for instance. It takes two arguments: a binary
tree and a node to remove from the tree.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Leveraging invariants

A

The repOK function takes as input a BinaryTree object bt, and
returns true if it is a valid binary tree, and false otherwise.
to be a valid binary tree, it should
satisfy one of two different cases:
the root may be null
if the root is not null, then the structure should be a directed tree. That is:
It should have no cycles
Every node except the root should have one parent
And the root should have no parent

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Leveraging pre and post conditions

A

Going even further, the programmer can specify pre and post conditions, denoted in
our example program via requires and ensures annotations, respectively. In this case,
the pre-condition states that the input node n must be contained in the input binary
tree bt. Such a pre-condition could further prune the space of candidate inputs by
avoiding generating inputs where the node n is not contained in the binary tree bt.
Furthermore, the post-condition could be used to check that the remove method
indeed removes the given node from the given binary tree, on each generated test
input. You should by now have a good sense of how far specifications can go in
helping to guide test generation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Randoop’s input

A

Randoop’s input consists of three things:
a set of classes making up the library under test,
a time limit that allows the user to control how many tests Randoop generates, and
a set of contracts, which are properties that the object generated in the final call of a
Randoop-generated test is required to satisfy.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly