Chapter 06: Mutation Testing Flashcards

1
Q

One advantage of coverage criteria

A

can be measured automatically

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

When to stop testing?

A

Cumulative number of failures found so far have a “saturation effect”

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

2 Types of Test critera

A
  1. Coverage based: covers most specification
  2. Fault-based: finds most bugs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Definition: Mutation Testing

A

“fault based testing”

intentionally create small, syntactic changes in the code (called mutants) to simulate common mistakes.

Ex: x = a + b ➝ x = a - b

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

Different types of mutants?

A

Stillborn: syntactically incorrect and killed by compiler

trivial: killed by any test case

equivalent mutant: acts the same behavior as the oirignal program (CANNOT BE KILLED)

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

Killed vs. Alive mutants

A

If the same test cases can detect differences between a mutant and the original code then the mutant is killed.

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

Examples of Method-Level Mutatons?

A
  1. variable replacement
  2. relational operator replacement
  3. off-by-1
  4. replacement by 0
  5. arithmetic operator replacement
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Examples of Class-Level Mutations?

A
  1. Access modifier change
  2. type cast change
  3. super keyword insertion
  4. method calling position change
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How to calculate Mutation score?

A

Score = # of mutants killed / # of NON-equivalent mutants

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