4. Automated Test Generation Flashcards

1
Q

Explain what the following kinds of testing are well suited for:

  • random testing (fuzzing)
  • systematic testing (e.g., Korat)
  • feedback-directed random testing (e.g., Randoop)
A

Random testing (fuzzing) is useful for:

  • security
  • mobile apps
  • concurrency
Systematic testing (e.g., Korat) is useful for:
- linked data structures

Feedback-directed random testing (e.g., Randoop) is useful for unit testing:

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

What is a concise test?

A

A concise test avoids illegal and redundant tests.

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

What is a diverse test?

A

A diverse test gives good coverage.

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

What technique does Korat use to avoid generating inputs that don’t satisfy the pre-condition?

A

Instrument the pre-condition.
- add code to observe its actions
record fields accessed by the pre-condition

Observation: If the pre-condition doesn’t access a field of the test input then the pre-condition doesn’t depend on the field.

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

Give an example of a pre-condition for binary trees.

A
  • Root may be null

If root is not null:

  • no cycles
  • each node (except root) has one parent)
  • root has no parent
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Strengths and weaknesses of Korat?

A
  • Strong when we can enumerate all possibilities (e.g., four nodes, two edges per node)

Good for:

  • linked data structures
  • small, easily specified procedures
  • unit testing

Weaker when enumeration is weak:
- integers, floating-point numbers, strings

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

Explain the recipe Randoop uses for generating tests?

A
  • Build new sequences incrementally, extending past sequences
  • As soon as a sequence is created, execute it
  • Use execution results to guide test generation towards sequences that create new object states
How well did you know this?
1
Not at all
2
3
4
5
Perfectly