Mutation Testing Flashcards

1
Q

What is fault seeding? What does it achieve?

A

Inserting representative or typical faults into your program. This allows you to measure how many bugs your test suite kills

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

In mutation testing, how do you measure effectiveness?

A

killed/ # seeded

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

What are 3 issues with fault seeding?

A

Finding representative faults
Putting in enough faults for the test to be meaningful
Forgetting to remove the faults afterwards

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

What is a mutant?

A

A valid program that behaves differently than the original

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

When does test t kill a mutant m?

A

If t produces a different outcome on m than the original program

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

What are 4 classes of unhelpful mutants?

A

Still born (not compilable)
Trivial (killed by most test cases)
Equivalent (indistinguishable from original program)
Redundant (indistinguishable from other mutants)

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

A mutant should contain only one _______ from the original program

A

change

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

What kind of mutation mimics statement coverage? How about input classes?

A

Bomb()s

failOnZero(x)s

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

Because of equivalent mutants, what is the update mutation score formula? What is this formula with duplicates taken into account?

A

killed/ (# mutants - # equivalent)

killed - #killed dupes) / (# mutants - # equivalent - # dupes

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

Why are equivalent mutants equivalent?

A
  • Mutation must be reachable
  • Does the mutation create a different program state? (infection)
  • Is the program state difference visible? (Propagation)

Equivalents mutants don’t have propagation, but they could infect the program or they might not be reachable

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

Finding ________ mutants is one of the most expensive aspects of this type of testing

A

equivalent

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

What are mutation operators? Why might they be language dependent?

A

Changes that are applied to produce mutants

Languages may or may not have co-routines, list comprehensions, hierarchies, etc

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

REVIEW EDGE COVERAGE SECTION

A

REVIEW EDGE COVERAGE SECTION

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

What is scalar variable replacement? Give an example

A

Replacing each variable use with another compatible variable. An example would be replacing a long with a short

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

What are some interprocedural mutation operators?

A

Changing parameter values
Changing call target
Changing dependencies

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

What are two reasons mutants are representative of all bugs?

A

Competent Programmer Hypothesis: Programmers tend to write code that is almost correct -> most of the time simple mutations reflect real bugs
Coupling Effect: tests that cover so many behaviors should detect both simple and complex errors

17
Q

What are higher order mutants? What is a major issue with them?

A

Mutants with multiple mutations operators. An issue is that we cannot isolate which change caused the bug

18
Q

What are 2 problems with mutation coverage?

A

Scale

Detecting Equivalence

19
Q

How can we deal with the scale problem in mutation coverage?

A
  • Coverage filters (use statement coverage to prune mutants not in tests)
  • Short circuiting tests
  • Simultaneous testing (parallelism)
  • Sampling
20
Q

What is the difference between a strongly killed mutant and a weakly killed mutant? What type of coverage do these conditions lead to?

A

Strongly Killed: The output of the test is different
Weakly killed: The internal state of the test is different due to the mutant. These tests don’t need propagation.

Strong Mutation Coverage and Weak Mutation Coverage

21
Q

Weak mutation coverage _______ many mutants, but is not very informative

A

prunes

22
Q

Why is mutation testing one of the strongest criteria?

A

Mimics different testing strategies (input partitioning, graph coverage)

23
Q

Although mutation testing has a massive number of criteria, why might it still not have the most tests?

A

The criteria is not exponential

24
Q

Shrinking the number of tests while preserving coverage _______ defect finding power

A

decreases

25
Q

Why is coverage important even if it cannot measure defect finding capability?

A

It tells you which portions of the program haven’t been tested

26
Q

Mutation testing correlates _____ with defect finding power, but it can be expensive

A

strongly