Lecture 4-Mutation Testing Flashcards

1
Q

What is mutation testing and what does it do?

A

-It’s a fault-based testing: directed towards typical faults that could occur in a program.
-Modify (MUTATE) some statements in the code, so we have many different versions of the code. EACH VERSION IS A BUG.

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

How do we know if the mutant Is killed or alive ?

A

-Mutant is killed if: different results are found, the test case is good as it detects the change.
-Mutant is alive if: the results are the same. test is NOT effective.

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

What are the two reasons why a mutant remains live?

A
  • It’s equivalent to the original program
    -The test case is inadequate to kill the mutant
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How should mutation testing be used?

A

In conjunction with traditional testing techniques, NOT INSTEAD OF THEM.

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

What are mutation operators used for?

A

For the automated generation of mutants

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

What are 3 examples of mutants?

A

Stillborn mutant: syntactically incorrect, killed by compiler
Trivial mutant: killed by almost any test case
-Equivalent mutant: always produces the same output as the original program

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

What is the competent programmer assumption?

A

A programmer develops a program that is either correct or differs from the correct program by a combination of simple errors.

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

What is the coupling effect assumption?

A

Complex faults are coupled to simple faults in such a way that a test data set that detects all simple faults in a program will detect a high percentage of the complex faults.

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

What is complete coverage in mutation coverage ?

A

It equates to killing ALL non-equivalent mutants

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

What is mutation score?

A

-The amount of coverage
-Ratio of dead mutants over all non-equivalent mutants:
100 * dead mutants/(number of mutants - equivalent mutants)
-A set of test cases is mutation adequate if its mutation score is 100%
-NUMBER OF MUTANTS TENDS TO BE LARGE EVEN FOR SMALL PROGRAMS

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

Strong vs weak mutation

A

Strong:
-A fault must be reachable
-Infect the state
-Propagate to output
Weak:
-A fault must be reachable
-Infect the state
* They require almost the same number of test cases to satisfy them

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

Define strongly killing mutants

A

If: m is mutant, p is program and t is test case:
it is said to strongly kill m if the output of t/p is different from t/m.

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

What is strong mutation coverage (SMC) ?

A

For each mutant m in M, TR contain a test case which strongly kills m.

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

Define weakly killing mutants

A

If : m is mutant , l is source location, p is program and t is test :
t is said to weakly kill m if the STATE of the execution of p/t is different from the STATE of execution of m/t, immediately after some execution of L.

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

What is weak mutation coverage (WMC)?

A

For each mutant m in M, TR contains a test case which weakly kills m.

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