SlideShare a Scribd company logo
1 of 185
Download to read offline
prepare for…
Mutation Testing
..from jUnit to Mutation-Testing
@SvenRuppert
has been coding java since 1996
Fellow / Head of R&D
reply Group
Germany - Munich
2
@SvenRuppert
has been coding java since 1996
3
@SvenRuppert
has been coding java since 1996
Projects in the field of:
•Automobile-industry
•Energy
•Finance / Leasing
•Space- Satellit-
•Government / UN / World-bank
Where?
•Europe
•Asia - from India up to Malaysia
3
4
Save harbor statement
4
Save harbor statement
The following is intended for information purposes only. I
can not be held responsible for the overuse of effects and
animations in this presentation. If any person in this room
has a medical condition that is triggered by fast moving
objects on the screen and/or explosions, he/she should
probably better leave now…
(I got carried away by the topic.)
5
The Environment @SvenRuppert
Codebase is > 13 years old
5
The Environment @SvenRuppert
Codebase is > 13 years old
no test coverage
5
The Environment @SvenRuppert
Codebase is > 13 years old
no test coverage
no dedicated refactoring budget
5
The Environment @SvenRuppert
Codebase is > 13 years old
no test coverage
no dedicated refactoring budget
decrease complexity
5
The Environment @SvenRuppert
Codebase is > 13 years old
no test coverage
no dedicated refactoring budget
decrease complexity
but… lets start with the basics
6
TDD with jUnit @SvenRuppert
6
TDD with jUnit @SvenRuppert
are you using jUnit?
6
TDD with jUnit @SvenRuppert
are you using jUnit?
assume that the following would make sense.. ;-)
6
TDD with jUnit @SvenRuppert
are you using jUnit?
assume that the following would make sense.. ;-)
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
6
TDD with jUnit @SvenRuppert
are you using jUnit?
assume that the following would make sense.. ;-)
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
6
TDD with jUnit @SvenRuppert
are you using jUnit?
assume that the following would make sense.. ;-)
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
it depends ;-)
7
TDD with jUnit @SvenRuppert
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
it depends ;-)
7
TDD with jUnit @SvenRuppert
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
it depends ;-)
for line 100% coverage
7
TDD with jUnit @SvenRuppert
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
it depends ;-)
for line 100% coverage 2
7
TDD with jUnit @SvenRuppert
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
it depends ;-)
for line 100% coverage 2
but will this be enough?
7
TDD with jUnit @SvenRuppert
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
it depends ;-)
for line 100% coverage 2
but will this be enough? No
8
TDD with jUnit @SvenRuppert
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
for line 100% coverage 2
but will this be enough? No
it depends ;-)
8
TDD with jUnit @SvenRuppert
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
for line 100% coverage 2
but will this be enough? No
how to find out, what will be enough?
it depends ;-)
8
TDD with jUnit @SvenRuppert
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
for line 100% coverage 2
but will this be enough? No
how to find out, what will be enough?
how to find the right tests?
it depends ;-)
9
TDD with jUnit @SvenRuppert
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
9
TDD with jUnit @SvenRuppert
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
@Test

public void testAdd001() throws Exception {

final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);

}
9
TDD with jUnit @SvenRuppert
public class Service {

public int add(int a, int b){

if(a<2){

return (a+b) * -1;

} else {

return a+b;

}

}

}
How many tests
you will need ?
@Test

public void testAdd001() throws Exception {

final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);

}
@Test

public void testAdd002() throws Exception {

final int add = new Service().add(3, 0);

Assertions.assertThat(add).isEqualTo(3);

}
10
Mutation Testing @SvenRuppert
10
Mutation Testing @SvenRuppert
Mutation Testing is a structural testing method
10
Mutation Testing @SvenRuppert
Mutation Testing is a structural testing method
we want to find a way to write "good" tests
10
Mutation Testing @SvenRuppert
Mutation Testing is a structural testing method
we want to find a way to write "good" tests
how to find "good" tests?
10
Mutation Testing @SvenRuppert
Mutation Testing is a structural testing method
we want to find a way to write "good" tests
how to find "good" tests?
let the machine find the targets
10
Mutation Testing @SvenRuppert
Mutation Testing is a structural testing method
we want to find a way to write "good" tests
how to find "good" tests?
let the machine find the targets
let´s mutate it... but how?
11
Mutation Testing - the Idea @SvenRuppert
11
Mutation Testing - the Idea @SvenRuppert
a mutation is a small change in the code
11
Mutation Testing - the Idea @SvenRuppert
a mutation is a small change in the code
.. small enough to be a small defect
11
Mutation Testing - the Idea @SvenRuppert
a mutation is a small change in the code
.. small enough to be a small defect
P will be the program
11
Mutation Testing - the Idea @SvenRuppert
a mutation is a small change in the code
.. small enough to be a small defect
P will be the program
T will be the collection of all tests / Test Suite
12
Mutation Testing - the Idea @SvenRuppert
P will be the program
T will be the collection of all tests / Test Suite
12
Mutation Testing - the Idea @SvenRuppert
P will be the program
T will be the collection of all tests / Test Suite
we will create a sequence of mutations / P1,P2,P3...
12
Mutation Testing - the Idea @SvenRuppert
P will be the program
T will be the collection of all tests / Test Suite
we will create a sequence of mutations / P1,P2,P3...
.. Px will have only one mutation compared to P
12
Mutation Testing - the Idea @SvenRuppert
P will be the program
T will be the collection of all tests / Test Suite
we will create a sequence of mutations / P1,P2,P3...
.. Px will have only one mutation compared to P
running all tests from T against Px
12
Mutation Testing - the Idea @SvenRuppert
P will be the program
T will be the collection of all tests / Test Suite
we will create a sequence of mutations / P1,P2,P3...
.. Px will have only one mutation compared to P
running all tests from T against Px
green: T will kill the mutation
12
Mutation Testing - the Idea @SvenRuppert
P will be the program
T will be the collection of all tests / Test Suite
we will create a sequence of mutations / P1,P2,P3...
.. Px will have only one mutation compared to P
running all tests from T against Px
green: T will kill the mutation
.. at leased one test from T will fail
12
Mutation Testing - the Idea @SvenRuppert
P will be the program
T will be the collection of all tests / Test Suite
we will create a sequence of mutations / P1,P2,P3...
.. Px will have only one mutation compared to P
running all tests from T against Px
green: T will kill the mutation
.. at leased one test from T will fail
red: if all tests are green
13
Mutation Testing - the Idea @SvenRuppert
13
Mutation Testing - the Idea @SvenRuppert
if we kill k out of n mutants
13
Mutation Testing - the Idea @SvenRuppert
if we kill k out of n mutants
-> we are not good enough ;-)
13
Mutation Testing - the Idea @SvenRuppert
if we kill k out of n mutants
-> we are not good enough ;-)
we are perfect enough if we are reaching : k == n
13
Mutation Testing - the Idea @SvenRuppert
if we kill k out of n mutants
-> we are not good enough ;-)
we are perfect enough if we are reaching : k == n
how to create all versions of Px ?
13
Mutation Testing - the Idea @SvenRuppert
if we kill k out of n mutants
-> we are not good enough ;-)
we are perfect enough if we are reaching : k == n
how to create all versions of Px ?
.. the good thing..
13
Mutation Testing - the Idea @SvenRuppert
if we kill k out of n mutants
-> we are not good enough ;-)
we are perfect enough if we are reaching : k == n
how to create all versions of Px ?
.. the good thing..
we could almost generate/
automate everything
14
Mutation Testing @SvenRuppert
practical TDD with Mutation Testing
14
Mutation Testing @SvenRuppert
generating the mutants and
practical TDD with Mutation Testing
14
Mutation Testing @SvenRuppert
generating the mutants and
practical TDD with Mutation Testing
running all junit tests
14
Mutation Testing @SvenRuppert
generating the mutants and
practical TDD with Mutation Testing
running all junit tests
check the reports
14
Mutation Testing @SvenRuppert
generating the mutants and
practical TDD with Mutation Testing
running all junit tests
check the reports
write more / better tests
14
Mutation Testing @SvenRuppert
generating the mutants and
practical TDD with Mutation Testing
running all junit tests
check the reports
write more / better tests
loop until quality target reached
15
Mutation Testing @SvenRuppert
mutants are a good approach / model to estimate
the default rate of defects per 1k lines of the P
15
Mutation Testing @SvenRuppert
mutants are a good approach / model to estimate
the default rate of defects per 1k lines of the P
estimate that:
15
Mutation Testing @SvenRuppert
mutants are a good approach / model to estimate
the default rate of defects per 1k lines of the P
estimate that:
the defects are independent
15
Mutation Testing @SvenRuppert
mutants are a good approach / model to estimate
the default rate of defects per 1k lines of the P
estimate that:
the defects are independent normaly ;-)
16
Mutation Testing @SvenRuppert
16
Mutation Testing @SvenRuppert
no need to know that Mutation Testing will be done,
independend creation of T
16
Mutation Testing @SvenRuppert
no need to know that Mutation Testing will be done,
independend creation of T
for K==n
we need a high number of mutants ( P1, P2, .., Px)
16
Mutation Testing @SvenRuppert
no need to know that Mutation Testing will be done,
independend creation of T
for K==n
we need a high number of mutants ( P1, P2, .., Px)
.. mostly it will lead into exponential numbers of Px
16
Mutation Testing @SvenRuppert
no need to know that Mutation Testing will be done,
independend creation of T
for K==n
we need a high number of mutants ( P1, P2, .., Px)
.. mostly it will lead into exponential numbers of Px
.. how to find YOUR barrier you
have to reach?
16
Mutation Testing @SvenRuppert
no need to know that Mutation Testing will be done,
independend creation of T
for K==n
we need a high number of mutants ( P1, P2, .., Px)
.. mostly it will lead into exponential numbers of Px
.. how to find YOUR barrier you
have to reach?
but.. what is a mutation?
17
Mutation Testing - Kinds of Mutation @SvenRuppert
but.. what is a mutation?
Value Mutation
changing constants,
loop bounds (adding/subtracting values)
18
Mutation Testing - Kinds of Mutation @SvenRuppert
but.. what is a mutation?
Value Mutation
Decision Mutation
for example < will be changed to <=
19
Mutation Testing - Kinds of Mutation @SvenRuppert
but.. what is a mutation?
Value Mutation Decision Mutation
for example swapping/deleting/duplicating
lines of code
Statement Mutation
20
Mutation Testing - Kinds of Mutation @SvenRuppert
but.. what is a mutation?
Value Mutation Decision Mutation
Statement Mutation
20
Mutation Testing - Kinds of Mutation @SvenRuppert
but.. what is a mutation?
Value Mutation Decision Mutation
Statement Mutation
for Java you could think about more
language spec. mutations
20
Mutation Testing - Kinds of Mutation @SvenRuppert
but.. what is a mutation?
Value Mutation Decision Mutation
Statement Mutation
for Java you could think about more
language spec. mutations
.. changing modifiers
20
Mutation Testing - Kinds of Mutation @SvenRuppert
but.. what is a mutation?
Value Mutation Decision Mutation
Statement Mutation
for Java you could think about more
language spec. mutations
.. changing modifiers
.. changing between static / non static
20
Mutation Testing - Kinds of Mutation @SvenRuppert
but.. what is a mutation?
Value Mutation Decision Mutation
Statement Mutation
for Java you could think about more
language spec. mutations
.. changing modifiers
.. changing between static / non static
.. delete member initialization
20
Mutation Testing - Kinds of Mutation @SvenRuppert
but.. what is a mutation?
Value Mutation Decision Mutation
Statement Mutation
for Java you could think about more
language spec. mutations
.. changing modifiers
.. changing between static / non static
.. delete member initialization
.. delete this.
20
Mutation Testing - Kinds of Mutation @SvenRuppert
but.. what is a mutation?
Value Mutation Decision Mutation
Statement Mutation
for Java you could think about more
language spec. mutations
.. changing modifiers
.. changing between static / non static
.. delete member initialization
.. delete this.
.. argument order change
21
Mutation Testing - in short words @SvenRuppert
21
Mutation Testing - in short words @SvenRuppert
mutation testing is an add on to normal jUnit TDD
21
Mutation Testing - in short words @SvenRuppert
mutation testing is an add on to normal jUnit TDD
tools are supporting it well
21
Mutation Testing - in short words @SvenRuppert
mutation testing is an add on to normal jUnit TDD
tools are supporting it well
generating and running all tests are time consuming
21
Mutation Testing - in short words @SvenRuppert
mutation testing is an add on to normal jUnit TDD
tools are supporting it well
generating and running all tests are time consuming
but most important
21
Mutation Testing - in short words @SvenRuppert
mutation testing is an add on to normal jUnit TDD
tools are supporting it well
generating and running all tests are time consuming
but most important
will effect your project structure
22
Mutation Testing - Frameworks @SvenRuppert
22
Mutation Testing - Frameworks @SvenRuppert
muJava
22
Mutation Testing - Frameworks @SvenRuppert
muJava
2003. First released as JMutation (Java Mutation System).

2004. The name was changed to MuJava (Mutation System for Java).

2005. Software Copyright Registration, ALL RIGHTS RESERVED.

2005. Version 2 released with several fault fixes and modified mutation operators.

2008. Version 3 released with minimal support for Java 1.5 and 1.6.

2013. Version 4 released to support JUnit tests and Java 1.6 language features, including generics,
annotations, enumerations, varargs, enhanced for-each loops, and static imports.

2015. Additional and improved error messages. Bug fixes for OpenJava. Licensing changed to the
Apache license.
22
Mutation Testing - Frameworks @SvenRuppert
muJava
2003. First released as JMutation (Java Mutation System).

2004. The name was changed to MuJava (Mutation System for Java).

2005. Software Copyright Registration, ALL RIGHTS RESERVED.

2005. Version 2 released with several fault fixes and modified mutation operators.

2008. Version 3 released with minimal support for Java 1.5 and 1.6.

2013. Version 4 released to support JUnit tests and Java 1.6 language features, including generics,
annotations, enumerations, varargs, enhanced for-each loops, and static imports.

2015. Additional and improved error messages. Bug fixes for OpenJava. Licensing changed to the
Apache license.
https://cs.gmu.edu/~offutt/mujava/
https://github.com/jeffoffutt/muJava/graphs/contributors
22
Mutation Testing - Frameworks @SvenRuppert
muJava
2003. First released as JMutation (Java Mutation System).

2004. The name was changed to MuJava (Mutation System for Java).

2005. Software Copyright Registration, ALL RIGHTS RESERVED.

2005. Version 2 released with several fault fixes and modified mutation operators.

2008. Version 3 released with minimal support for Java 1.5 and 1.6.

2013. Version 4 released to support JUnit tests and Java 1.6 language features, including generics,
annotations, enumerations, varargs, enhanced for-each loops, and static imports.

2015. Additional and improved error messages. Bug fixes for OpenJava. Licensing changed to the
Apache license.
https://cs.gmu.edu/~offutt/mujava/
https://github.com/jeffoffutt/muJava/graphs/contributors
inactive
23
Mutation Testing - Frameworks @SvenRuppert
23
Mutation Testing - Frameworks @SvenRuppert
2012. started around 2012 with a small codebase.

2014. very active since 2014
23
Mutation Testing - Frameworks @SvenRuppert
2012. started around 2012 with a small codebase.

2014. very active since 2014
http://pitest.org/
23
Mutation Testing - Frameworks @SvenRuppert
2012. started around 2012 with a small codebase.

2014. very active since 2014
http://pitest.org/
active ;-)
24
Mutation Testing - Hello World @SvenRuppert
http://pitest.org/
24
Mutation Testing - Hello World @SvenRuppert
http://pitest.org/
assume the following would make sense ;-)
24
Mutation Testing - Hello World @SvenRuppert
http://pitest.org/
assume the following would make sense ;-)
public class Service {
public int add(int a, int b){
if (a<2) {
return (a+b) * -1;
} else {
return a+b;
}

}

}
25
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) {
return (a+b) * -1;
} else {
return a+b;
}

}

}
25
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) {
return (a+b) * -1;
} else {
return a+b;
}

}

} how many test you will need for..
25
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) {
return (a+b) * -1;
} else {
return a+b;
}

}

} how many test you will need for..
100% Line Coverage… and…
25
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) {
return (a+b) * -1;
} else {
return a+b;
}

}

} how many test you will need for..
100% Line Coverage… and… to be save ?
25
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) {
return (a+b) * -1;
} else {
return a+b;
}

}

} how many test you will need for..
100% Line Coverage… and… to be save ?
2 for Line Coverage
25
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) {
return (a+b) * -1;
} else {
return a+b;
}

}

} how many test you will need for..
100% Line Coverage… and… to be save ?
2 for Line Coverage we will see ;-)
26
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) {
return (a+b) * -1;
} else {
return a+b;
}

}

}
100% Line Coverage… and…
26
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) {
return (a+b) * -1;
} else {
return a+b;
}

}

}
100% Line Coverage… and…
we have one if statement
26
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) {
return (a+b) * -1;
} else {
return a+b;
}

}

}
100% Line Coverage… and…
we have one if statement with an else branch
26
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) {
return (a+b) * -1;
} else {
return a+b;
}

}

}
100% Line Coverage… and…
we have one if statement with an else branch
this will lead to 2 jUnit Tests to get 100 %
27
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) { return (a+b) * -1; } 

else { return a+b; }

}

} 100% Line Coverage… and…
27
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) { return (a+b) * -1; } 

else { return a+b; }

}

} 100% Line Coverage… and…
@Test

public void testAdd001() throws Exception {

final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);

}
27
Mutation Testing - Hello World @SvenRuppert
public class Service {
public int add(int a, int b){
if (a<2) { return (a+b) * -1; } 

else { return a+b; }

}

} 100% Line Coverage… and…
@Test

public void testAdd001() throws Exception {

final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);

}
@Test

public void testAdd002() throws Exception {

final int add = new Service().add(3, 0);

Assertions.assertThat(add).isEqualTo(3);

}
28
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);
final int add = new Service().add(3, 0);

Assertions.assertThat(add).isEqualTo(3);
28
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);
final int add = new Service().add(3, 0);

Assertions.assertThat(add).isEqualTo(3);
28
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);
final int add = new Service().add(3, 0);

Assertions.assertThat(add).isEqualTo(3);
29
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);
final int add = new Service().add(3, 0);

Assertions.assertThat(add).isEqualTo(3);
29
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);
final int add = new Service().add(3, 0);

Assertions.assertThat(add).isEqualTo(3);
we got 100% Line Coverage
29
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);
final int add = new Service().add(3, 0);

Assertions.assertThat(add).isEqualTo(3);
we got 100% Line Coverage
How good these tests are?
29
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);
final int add = new Service().add(3, 0);

Assertions.assertThat(add).isEqualTo(3);
we got 100% Line Coverage
How good these tests are?
How to measure if these test are good?
29
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);

Assertions.assertThat(add).isEqualTo(0);
final int add = new Service().add(3, 0);

Assertions.assertThat(add).isEqualTo(3);
we got 100% Line Coverage
How good these tests are?
How to measure if these test are good?
How to find the good tests?
30
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
How to find the good tests?
30
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
How to find the good tests?
let´s generate a the mutation report
30
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
How to find the good tests?
let´s generate a the mutation report
with maven : pitest: mutationCoverage
30
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
How to find the good tests?
let´s generate a the mutation report
with maven : pitest: mutationCoverage
>> Generated 54 mutations
30
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
How to find the good tests?
let´s generate a the mutation report
with maven : pitest: mutationCoverage
>> Generated 54 mutations Killed 3 (6%)
30
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
How to find the good tests?
let´s generate a the mutation report
with maven : pitest: mutationCoverage
>> Generated 54 mutations
org.pitest……mutators.ConditionalsBoundaryMutator
Killed 3 (6%)
30
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
How to find the good tests?
let´s generate a the mutation report
with maven : pitest: mutationCoverage
>> Generated 54 mutations
org.pitest……mutators.ConditionalsBoundaryMutator
org.pitest……mutators.IncrementsMutator
Killed 3 (6%)
30
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
How to find the good tests?
let´s generate a the mutation report
with maven : pitest: mutationCoverage
>> Generated 54 mutations
org.pitest……mutators.ConditionalsBoundaryMutator
org.pitest……mutators.IncrementsMutator
org.pitest……mutators.ReturnValsMutator
Killed 3 (6%)
30
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
How to find the good tests?
let´s generate a the mutation report
with maven : pitest: mutationCoverage
>> Generated 54 mutations
org.pitest……mutators.ConditionalsBoundaryMutator
org.pitest……mutators.IncrementsMutator
org.pitest……mutators.ReturnValsMutator
org.pitest……mutators.MathMutator
Killed 3 (6%)
30
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
How to find the good tests?
let´s generate a the mutation report
with maven : pitest: mutationCoverage
>> Generated 54 mutations
org.pitest……mutators.ConditionalsBoundaryMutator
org.pitest……mutators.IncrementsMutator
org.pitest……mutators.ReturnValsMutator
org.pitest……mutators.MathMutator
org.pitest……mutators.NegateConditionalsMutator
Killed 3 (6%)
31
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations Killed 3 (6%)
31
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations Killed 3 (6%)
31
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations Killed 3 (6%)
32
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations Killed 3
32
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations Killed 3
32
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations Killed 3
Killed 3
33
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations
Killed 3
33
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations
final int add = new Service().add(2, 0);
33
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations
final int add = new Service().add(2, 0);
Killed 4
33
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations
final int add = new Service().add(2, 0);
Killed 4
33
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations
final int add = new Service().add(2, 0);
Killed 4
33
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations
final int add = new Service().add(2, 0);
Killed 4
33
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations
final int add = new Service().add(2, 0);
Killed 4
33
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
>> Generated 54 mutations
final int add = new Service().add(2, 0);
Killed 4
33
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
Killed 4
34
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
Killed 4
34
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
34
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
Killed 5
34
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
Killed 5
34
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
killed 9:1
Killed 5
35
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
killed 9:1
Killed 5
35
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
killed 9:1
final int add = new Service().add(2, 2);
35
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
killed 9:1
final int add = new Service().add(2, 2);
Killed 6
35
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
killed 9:1
final int add = new Service().add(2, 2);
Killed 6
35
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
killed 9:1
final int add = new Service().add(2, 2);
Killed 6
35
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
killed 9:1
final int add = new Service().add(2, 2);
Killed 6
35
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
final int add = new Service().add(2, 2);
killed 11:1
Killed 6
35
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(1, 1);
final int add = new Service().add(2, 2);
killed 11:1
Killed 6
36
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(1, 1);
final int add = new Service().add(2, 2);
Killed 6
36
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(1, 1);
final int add = new Service().add(2, 2);
37
Mutation Testing - Lesson Learned @SvenRuppert
37
Mutation Testing - Lesson Learned @SvenRuppert
mutation tests are often leading to
37
Mutation Testing - Lesson Learned @SvenRuppert
mutation tests are often leading to
…cleaner code compared to jUnit only
37
Mutation Testing - Lesson Learned @SvenRuppert
mutation tests are often leading to
…cleaner code compared to jUnit only
… smaller modules (shorter mutation runtime)
37
Mutation Testing - Lesson Learned @SvenRuppert
mutation tests are often leading to
…cleaner code compared to jUnit only
… smaller modules (shorter mutation runtime)
and something nice…
helps to find useless code
38
Example of useless Code @SvenRuppert
38
Example of useless Code @SvenRuppert
38
Example of useless Code @SvenRuppert
39
Mutation Testing - How to start @SvenRuppert
39
Mutation Testing - How to start @SvenRuppert
you need jUnit - to generate the reference
39
Mutation Testing - How to start @SvenRuppert
you need jUnit - to generate the reference
add the pitest-plugin to the build section
39
Mutation Testing - How to start @SvenRuppert
you need jUnit - to generate the reference
add the pitest-plugin to the build section
configure the plugin
39
Mutation Testing - How to start @SvenRuppert
you need jUnit - to generate the reference
add the pitest-plugin to the build section
configure the plugin
generate the reference -> clean , install
39
Mutation Testing - How to start @SvenRuppert
you need jUnit - to generate the reference
add the pitest-plugin to the build section
configure the plugin
generate the reference -> clean , install
run pitest: mutationCoverage
39
Mutation Testing - How to start @SvenRuppert
you need jUnit - to generate the reference
add the pitest-plugin to the build section
configure the plugin
generate the reference -> clean , install
run pitest: mutationCoverage
report will be under target/pit-reports
40
Mutation Testing - How to start @SvenRuppert
pom.xml - example - build
<plugin>

<groupId>org.pitest</groupId>

<artifactId>pitest-maven</artifactId>

<configuration>

<outputFormats>

<outputFormat>XML</outputFormat>

<outputFormat>HTML</outputFormat>

</outputFormats>

<targetClasses>

<param>org.rapidpm.*</param>

</targetClasses>

<targetTests>

<param>org.rapidpm.*</param>

<param>junit.org.rapidpm.*</param>

</targetTests>

</configuration>

</plugin>
41
Mutation Testing - How to start @SvenRuppert
pom.xml - example - reporting
<reporting>

<plugins>

<plugin>

<groupId>org.pitest</groupId>

<artifactId>pitest-maven</artifactId>

<reportSets>

<reportSet>

<reports>

<report>report</report>

</reports>

</reportSet>

</reportSets>

</plugin>

</plugins>

</reporting>
42
Mutation Testing - practical usage @SvenRuppert
42
Mutation Testing - practical usage @SvenRuppert
Start with some tests
42
Mutation Testing - practical usage @SvenRuppert
Start with some tests
generate the pitest report
42
Mutation Testing - practical usage @SvenRuppert
Start with some tests
generate the pitest report
write more tests to kill mutations
42
Mutation Testing - practical usage @SvenRuppert
Start with some tests
generate the pitest report
write more tests to kill mutations
if you have time, eliminate useless tests
42
Mutation Testing - practical usage @SvenRuppert
Start with some tests
generate the pitest report
write more tests to kill mutations
if you have time, eliminate useless tests
do it one by one
42
Mutation Testing - practical usage @SvenRuppert
Mutation 001
Mutation 002
Mutation 003
Mutation 004 Survived
Survived
Survived
Survived
Start with some tests
generate the pitest report
write more tests to kill mutations
if you have time, eliminate useless tests
do it one by one
42
Mutation Testing - practical usage @SvenRuppert
Mutation 001
Mutation 002
Mutation 003
Mutation 004 Survived
Killed
Survived
Survived
Survived
Killed
Killed
Killed
Start with some tests
generate the pitest report
write more tests to kill mutations
if you have time, eliminate useless tests
do it one by one
Summary
43
@SvenRuppert
If you are interested…
have a look at GITHUB
ProxyBuilder
Dynamic-Dependency-Injection
Java-Microservice
or contact me ;-) @SvenRuppert
Summary
43
@SvenRuppert
If you are interested…
have a look at GITHUB
ProxyBuilder
Dynamic-Dependency-Injection
Java-Microservice
or contact me ;-) @SvenRuppert
Thank You !!!

More Related Content

Similar to From jUnit to Mutationtesting

Predictive Analytics for Everyone! Building CART Models using R - Chantal D....
Predictive Analytics for Everyone!  Building CART Models using R - Chantal D....Predictive Analytics for Everyone!  Building CART Models using R - Chantal D....
Predictive Analytics for Everyone! Building CART Models using R - Chantal D....Chantal Larose
 
Apache Spark 101 [in 50 min]
Apache Spark 101 [in 50 min]Apache Spark 101 [in 50 min]
Apache Spark 101 [in 50 min]Pawel Szulc
 
Causal inference-for-profit | Dan McKinley | DN18
Causal inference-for-profit | Dan McKinley | DN18Causal inference-for-profit | Dan McKinley | DN18
Causal inference-for-profit | Dan McKinley | DN18DataconomyGmbH
 
DN18 | A/B Testing: Lessons Learned | Dan McKinley | Mailchimp
DN18 | A/B Testing: Lessons Learned | Dan McKinley | MailchimpDN18 | A/B Testing: Lessons Learned | Dan McKinley | Mailchimp
DN18 | A/B Testing: Lessons Learned | Dan McKinley | MailchimpDataconomy Media
 
Mutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The BugsMutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The BugsAri Waller
 
Algorithms - Future Decoded 2016
Algorithms - Future Decoded 2016Algorithms - Future Decoded 2016
Algorithms - Future Decoded 2016Frank Krueger
 
Apache spark workshop
Apache spark workshopApache spark workshop
Apache spark workshopPawel Szulc
 
Functional Reactive with Core Java - Workshop - Slides
Functional Reactive with Core Java - Workshop - SlidesFunctional Reactive with Core Java - Workshop - Slides
Functional Reactive with Core Java - Workshop - SlidesSven Ruppert
 
2015 Artificial Intelligence Techniques at Engineering Seminar - Chapter 2 - ...
2015 Artificial Intelligence Techniques at Engineering Seminar - Chapter 2 - ...2015 Artificial Intelligence Techniques at Engineering Seminar - Chapter 2 - ...
2015 Artificial Intelligence Techniques at Engineering Seminar - Chapter 2 - ...Enrique Onieva
 
utPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLutPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLSteven Feuerstein
 
Preparation Data Structures 02 recursion
Preparation Data Structures 02 recursionPreparation Data Structures 02 recursion
Preparation Data Structures 02 recursionAndres Mendez-Vazquez
 
What is "Domain Driven Design" and what can you expect from it?
What is "Domain Driven Design" and what can you expect from it?What is "Domain Driven Design" and what can you expect from it?
What is "Domain Driven Design" and what can you expect from it?Tom Janssens
 
PAC 2020 Santorin - Andreas Grabner
PAC 2020 Santorin - Andreas Grabner PAC 2020 Santorin - Andreas Grabner
PAC 2020 Santorin - Andreas Grabner Neotys
 
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris. Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris. OW2
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATSKiwamu Okabe
 
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet
 
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...NETWAYS
 
Scientific Benchmarking of Parallel Computing Systems
Scientific Benchmarking of Parallel Computing SystemsScientific Benchmarking of Parallel Computing Systems
Scientific Benchmarking of Parallel Computing Systemsinside-BigData.com
 

Similar to From jUnit to Mutationtesting (20)

Predictive Analytics for Everyone! Building CART Models using R - Chantal D....
Predictive Analytics for Everyone!  Building CART Models using R - Chantal D....Predictive Analytics for Everyone!  Building CART Models using R - Chantal D....
Predictive Analytics for Everyone! Building CART Models using R - Chantal D....
 
Apache Spark 101 [in 50 min]
Apache Spark 101 [in 50 min]Apache Spark 101 [in 50 min]
Apache Spark 101 [in 50 min]
 
Causal inference-for-profit | Dan McKinley | DN18
Causal inference-for-profit | Dan McKinley | DN18Causal inference-for-profit | Dan McKinley | DN18
Causal inference-for-profit | Dan McKinley | DN18
 
DN18 | A/B Testing: Lessons Learned | Dan McKinley | Mailchimp
DN18 | A/B Testing: Lessons Learned | Dan McKinley | MailchimpDN18 | A/B Testing: Lessons Learned | Dan McKinley | Mailchimp
DN18 | A/B Testing: Lessons Learned | Dan McKinley | Mailchimp
 
Mutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The BugsMutation Testing: Start Hunting The Bugs
Mutation Testing: Start Hunting The Bugs
 
Algorithms - Future Decoded 2016
Algorithms - Future Decoded 2016Algorithms - Future Decoded 2016
Algorithms - Future Decoded 2016
 
Apache spark workshop
Apache spark workshopApache spark workshop
Apache spark workshop
 
Functional Reactive with Core Java - Workshop - Slides
Functional Reactive with Core Java - Workshop - SlidesFunctional Reactive with Core Java - Workshop - Slides
Functional Reactive with Core Java - Workshop - Slides
 
Issta13 workshop on debugging
Issta13 workshop on debuggingIssta13 workshop on debugging
Issta13 workshop on debugging
 
2015 Artificial Intelligence Techniques at Engineering Seminar - Chapter 2 - ...
2015 Artificial Intelligence Techniques at Engineering Seminar - Chapter 2 - ...2015 Artificial Intelligence Techniques at Engineering Seminar - Chapter 2 - ...
2015 Artificial Intelligence Techniques at Engineering Seminar - Chapter 2 - ...
 
utPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQLutPLSQL: Unit Testing for Oracle PL/SQL
utPLSQL: Unit Testing for Oracle PL/SQL
 
Preparation Data Structures 02 recursion
Preparation Data Structures 02 recursionPreparation Data Structures 02 recursion
Preparation Data Structures 02 recursion
 
What is "Domain Driven Design" and what can you expect from it?
What is "Domain Driven Design" and what can you expect from it?What is "Domain Driven Design" and what can you expect from it?
What is "Domain Driven Design" and what can you expect from it?
 
PAC 2020 Santorin - Andreas Grabner
PAC 2020 Santorin - Andreas Grabner PAC 2020 Santorin - Andreas Grabner
PAC 2020 Santorin - Andreas Grabner
 
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris. Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
Sat4j: from the lab to desktop computers. OW2con'15, November 17, Paris.
 
Arduino programming of ML-style in ATS
Arduino programming of ML-style in ATSArduino programming of ML-style in ATS
Arduino programming of ML-style in ATS
 
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
Puppet Camp Düsseldorf 2014: Continuously Deliver Your Puppet Code with Jenki...
 
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...
Puppet Camp Duesseldorf 2014: Toni Schmidbauer - Continuously deliver your pu...
 
Scientific Benchmarking of Parallel Computing Systems
Scientific Benchmarking of Parallel Computing SystemsScientific Benchmarking of Parallel Computing Systems
Scientific Benchmarking of Parallel Computing Systems
 
rlhf.pdf
rlhf.pdfrlhf.pdf
rlhf.pdf
 

More from Sven Ruppert

JUnit5 Custom TestEngines intro - version 2020-06
JUnit5 Custom TestEngines intro - version 2020-06JUnit5 Custom TestEngines intro - version 2020-06
JUnit5 Custom TestEngines intro - version 2020-06Sven Ruppert
 
Hidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-PersistenceHidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-PersistenceSven Ruppert
 
Vaadin Flow - How to start - a short intro for Java Devs
Vaadin Flow - How to start - a short intro for Java DevsVaadin Flow - How to start - a short intro for Java Devs
Vaadin Flow - How to start - a short intro for Java DevsSven Ruppert
 
Functional Reactive With Core Java - Voxxed Melbourne
Functional Reactive With Core Java - Voxxed MelbourneFunctional Reactive With Core Java - Voxxed Melbourne
Functional Reactive With Core Java - Voxxed MelbourneSven Ruppert
 
Functional reactive-talk 20170301-001
Functional reactive-talk 20170301-001Functional reactive-talk 20170301-001
Functional reactive-talk 20170301-001Sven Ruppert
 
Warum ich so auf das c von cdi stehe
Warum ich so auf das c von cdi steheWarum ich so auf das c von cdi stehe
Warum ich so auf das c von cdi steheSven Ruppert
 
Proxy deep-dive java-one_20151027_001
Proxy deep-dive java-one_20151027_001Proxy deep-dive java-one_20151027_001
Proxy deep-dive java-one_20151027_001Sven Ruppert
 
Java8 ready for the future
Java8 ready for the futureJava8 ready for the future
Java8 ready for the futureSven Ruppert
 
JavaFX8 TestFX - CDI
JavaFX8   TestFX - CDIJavaFX8   TestFX - CDI
JavaFX8 TestFX - CDISven Ruppert
 
Java FX8 JumpStart - JUG ch - zürich
Java FX8   JumpStart - JUG ch - zürichJava FX8   JumpStart - JUG ch - zürich
Java FX8 JumpStart - JUG ch - zürichSven Ruppert
 
Proxy Deep Dive JUG Saxony Day 2015-10-02
Proxy Deep Dive JUG Saxony Day 2015-10-02Proxy Deep Dive JUG Saxony Day 2015-10-02
Proxy Deep Dive JUG Saxony Day 2015-10-02Sven Ruppert
 
Proxy Deep Dive Voxxed Belgrad 2015
Proxy Deep Dive Voxxed Belgrad 2015Proxy Deep Dive Voxxed Belgrad 2015
Proxy Deep Dive Voxxed Belgrad 2015Sven Ruppert
 

More from Sven Ruppert (12)

JUnit5 Custom TestEngines intro - version 2020-06
JUnit5 Custom TestEngines intro - version 2020-06JUnit5 Custom TestEngines intro - version 2020-06
JUnit5 Custom TestEngines intro - version 2020-06
 
Hidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-PersistenceHidden pearls for High-Performance-Persistence
Hidden pearls for High-Performance-Persistence
 
Vaadin Flow - How to start - a short intro for Java Devs
Vaadin Flow - How to start - a short intro for Java DevsVaadin Flow - How to start - a short intro for Java Devs
Vaadin Flow - How to start - a short intro for Java Devs
 
Functional Reactive With Core Java - Voxxed Melbourne
Functional Reactive With Core Java - Voxxed MelbourneFunctional Reactive With Core Java - Voxxed Melbourne
Functional Reactive With Core Java - Voxxed Melbourne
 
Functional reactive-talk 20170301-001
Functional reactive-talk 20170301-001Functional reactive-talk 20170301-001
Functional reactive-talk 20170301-001
 
Warum ich so auf das c von cdi stehe
Warum ich so auf das c von cdi steheWarum ich so auf das c von cdi stehe
Warum ich so auf das c von cdi stehe
 
Proxy deep-dive java-one_20151027_001
Proxy deep-dive java-one_20151027_001Proxy deep-dive java-one_20151027_001
Proxy deep-dive java-one_20151027_001
 
Java8 ready for the future
Java8 ready for the futureJava8 ready for the future
Java8 ready for the future
 
JavaFX8 TestFX - CDI
JavaFX8   TestFX - CDIJavaFX8   TestFX - CDI
JavaFX8 TestFX - CDI
 
Java FX8 JumpStart - JUG ch - zürich
Java FX8   JumpStart - JUG ch - zürichJava FX8   JumpStart - JUG ch - zürich
Java FX8 JumpStart - JUG ch - zürich
 
Proxy Deep Dive JUG Saxony Day 2015-10-02
Proxy Deep Dive JUG Saxony Day 2015-10-02Proxy Deep Dive JUG Saxony Day 2015-10-02
Proxy Deep Dive JUG Saxony Day 2015-10-02
 
Proxy Deep Dive Voxxed Belgrad 2015
Proxy Deep Dive Voxxed Belgrad 2015Proxy Deep Dive Voxxed Belgrad 2015
Proxy Deep Dive Voxxed Belgrad 2015
 

Recently uploaded

chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样umasea
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...gurkirankumar98700
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 

Recently uploaded (20)

chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
办理学位证(UQ文凭证书)昆士兰大学毕业证成绩单原版一模一样
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...Call Girls In Mukherjee Nagar 📱  9999965857  🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
Call Girls In Mukherjee Nagar 📱 9999965857 🤩 Delhi 🫦 HOT AND SEXY VVIP 🍎 SE...
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
(Genuine) Escort Service Lucknow | Starting ₹,5K To @25k with A/C 🧑🏽‍❤️‍🧑🏻 89...
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 

From jUnit to Mutationtesting

  • 1. prepare for… Mutation Testing ..from jUnit to Mutation-Testing
  • 2. @SvenRuppert has been coding java since 1996 Fellow / Head of R&D reply Group Germany - Munich 2
  • 3. @SvenRuppert has been coding java since 1996 3
  • 4. @SvenRuppert has been coding java since 1996 Projects in the field of: •Automobile-industry •Energy •Finance / Leasing •Space- Satellit- •Government / UN / World-bank Where? •Europe •Asia - from India up to Malaysia 3
  • 6. 4 Save harbor statement The following is intended for information purposes only. I can not be held responsible for the overuse of effects and animations in this presentation. If any person in this room has a medical condition that is triggered by fast moving objects on the screen and/or explosions, he/she should probably better leave now… (I got carried away by the topic.)
  • 8. 5 The Environment @SvenRuppert Codebase is > 13 years old no test coverage
  • 9. 5 The Environment @SvenRuppert Codebase is > 13 years old no test coverage no dedicated refactoring budget
  • 10. 5 The Environment @SvenRuppert Codebase is > 13 years old no test coverage no dedicated refactoring budget decrease complexity
  • 11. 5 The Environment @SvenRuppert Codebase is > 13 years old no test coverage no dedicated refactoring budget decrease complexity but… lets start with the basics
  • 12. 6 TDD with jUnit @SvenRuppert
  • 13. 6 TDD with jUnit @SvenRuppert are you using jUnit?
  • 14. 6 TDD with jUnit @SvenRuppert are you using jUnit? assume that the following would make sense.. ;-)
  • 15. 6 TDD with jUnit @SvenRuppert are you using jUnit? assume that the following would make sense.. ;-) public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 }
  • 16. 6 TDD with jUnit @SvenRuppert are you using jUnit? assume that the following would make sense.. ;-) public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ?
  • 17. 6 TDD with jUnit @SvenRuppert are you using jUnit? assume that the following would make sense.. ;-) public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ? it depends ;-)
  • 18. 7 TDD with jUnit @SvenRuppert public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ? it depends ;-)
  • 19. 7 TDD with jUnit @SvenRuppert public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ? it depends ;-) for line 100% coverage
  • 20. 7 TDD with jUnit @SvenRuppert public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ? it depends ;-) for line 100% coverage 2
  • 21. 7 TDD with jUnit @SvenRuppert public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ? it depends ;-) for line 100% coverage 2 but will this be enough?
  • 22. 7 TDD with jUnit @SvenRuppert public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ? it depends ;-) for line 100% coverage 2 but will this be enough? No
  • 23. 8 TDD with jUnit @SvenRuppert public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ? for line 100% coverage 2 but will this be enough? No it depends ;-)
  • 24. 8 TDD with jUnit @SvenRuppert public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ? for line 100% coverage 2 but will this be enough? No how to find out, what will be enough? it depends ;-)
  • 25. 8 TDD with jUnit @SvenRuppert public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ? for line 100% coverage 2 but will this be enough? No how to find out, what will be enough? how to find the right tests? it depends ;-)
  • 26. 9 TDD with jUnit @SvenRuppert public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ?
  • 27. 9 TDD with jUnit @SvenRuppert public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ? @Test
 public void testAdd001() throws Exception {
 final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0);
 }
  • 28. 9 TDD with jUnit @SvenRuppert public class Service {
 public int add(int a, int b){
 if(a<2){
 return (a+b) * -1;
 } else {
 return a+b;
 }
 }
 } How many tests you will need ? @Test
 public void testAdd001() throws Exception {
 final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0);
 } @Test
 public void testAdd002() throws Exception {
 final int add = new Service().add(3, 0);
 Assertions.assertThat(add).isEqualTo(3);
 }
  • 30. 10 Mutation Testing @SvenRuppert Mutation Testing is a structural testing method
  • 31. 10 Mutation Testing @SvenRuppert Mutation Testing is a structural testing method we want to find a way to write "good" tests
  • 32. 10 Mutation Testing @SvenRuppert Mutation Testing is a structural testing method we want to find a way to write "good" tests how to find "good" tests?
  • 33. 10 Mutation Testing @SvenRuppert Mutation Testing is a structural testing method we want to find a way to write "good" tests how to find "good" tests? let the machine find the targets
  • 34. 10 Mutation Testing @SvenRuppert Mutation Testing is a structural testing method we want to find a way to write "good" tests how to find "good" tests? let the machine find the targets let´s mutate it... but how?
  • 35. 11 Mutation Testing - the Idea @SvenRuppert
  • 36. 11 Mutation Testing - the Idea @SvenRuppert a mutation is a small change in the code
  • 37. 11 Mutation Testing - the Idea @SvenRuppert a mutation is a small change in the code .. small enough to be a small defect
  • 38. 11 Mutation Testing - the Idea @SvenRuppert a mutation is a small change in the code .. small enough to be a small defect P will be the program
  • 39. 11 Mutation Testing - the Idea @SvenRuppert a mutation is a small change in the code .. small enough to be a small defect P will be the program T will be the collection of all tests / Test Suite
  • 40. 12 Mutation Testing - the Idea @SvenRuppert P will be the program T will be the collection of all tests / Test Suite
  • 41. 12 Mutation Testing - the Idea @SvenRuppert P will be the program T will be the collection of all tests / Test Suite we will create a sequence of mutations / P1,P2,P3...
  • 42. 12 Mutation Testing - the Idea @SvenRuppert P will be the program T will be the collection of all tests / Test Suite we will create a sequence of mutations / P1,P2,P3... .. Px will have only one mutation compared to P
  • 43. 12 Mutation Testing - the Idea @SvenRuppert P will be the program T will be the collection of all tests / Test Suite we will create a sequence of mutations / P1,P2,P3... .. Px will have only one mutation compared to P running all tests from T against Px
  • 44. 12 Mutation Testing - the Idea @SvenRuppert P will be the program T will be the collection of all tests / Test Suite we will create a sequence of mutations / P1,P2,P3... .. Px will have only one mutation compared to P running all tests from T against Px green: T will kill the mutation
  • 45. 12 Mutation Testing - the Idea @SvenRuppert P will be the program T will be the collection of all tests / Test Suite we will create a sequence of mutations / P1,P2,P3... .. Px will have only one mutation compared to P running all tests from T against Px green: T will kill the mutation .. at leased one test from T will fail
  • 46. 12 Mutation Testing - the Idea @SvenRuppert P will be the program T will be the collection of all tests / Test Suite we will create a sequence of mutations / P1,P2,P3... .. Px will have only one mutation compared to P running all tests from T against Px green: T will kill the mutation .. at leased one test from T will fail red: if all tests are green
  • 47. 13 Mutation Testing - the Idea @SvenRuppert
  • 48. 13 Mutation Testing - the Idea @SvenRuppert if we kill k out of n mutants
  • 49. 13 Mutation Testing - the Idea @SvenRuppert if we kill k out of n mutants -> we are not good enough ;-)
  • 50. 13 Mutation Testing - the Idea @SvenRuppert if we kill k out of n mutants -> we are not good enough ;-) we are perfect enough if we are reaching : k == n
  • 51. 13 Mutation Testing - the Idea @SvenRuppert if we kill k out of n mutants -> we are not good enough ;-) we are perfect enough if we are reaching : k == n how to create all versions of Px ?
  • 52. 13 Mutation Testing - the Idea @SvenRuppert if we kill k out of n mutants -> we are not good enough ;-) we are perfect enough if we are reaching : k == n how to create all versions of Px ? .. the good thing..
  • 53. 13 Mutation Testing - the Idea @SvenRuppert if we kill k out of n mutants -> we are not good enough ;-) we are perfect enough if we are reaching : k == n how to create all versions of Px ? .. the good thing.. we could almost generate/ automate everything
  • 54. 14 Mutation Testing @SvenRuppert practical TDD with Mutation Testing
  • 55. 14 Mutation Testing @SvenRuppert generating the mutants and practical TDD with Mutation Testing
  • 56. 14 Mutation Testing @SvenRuppert generating the mutants and practical TDD with Mutation Testing running all junit tests
  • 57. 14 Mutation Testing @SvenRuppert generating the mutants and practical TDD with Mutation Testing running all junit tests check the reports
  • 58. 14 Mutation Testing @SvenRuppert generating the mutants and practical TDD with Mutation Testing running all junit tests check the reports write more / better tests
  • 59. 14 Mutation Testing @SvenRuppert generating the mutants and practical TDD with Mutation Testing running all junit tests check the reports write more / better tests loop until quality target reached
  • 60. 15 Mutation Testing @SvenRuppert mutants are a good approach / model to estimate the default rate of defects per 1k lines of the P
  • 61. 15 Mutation Testing @SvenRuppert mutants are a good approach / model to estimate the default rate of defects per 1k lines of the P estimate that:
  • 62. 15 Mutation Testing @SvenRuppert mutants are a good approach / model to estimate the default rate of defects per 1k lines of the P estimate that: the defects are independent
  • 63. 15 Mutation Testing @SvenRuppert mutants are a good approach / model to estimate the default rate of defects per 1k lines of the P estimate that: the defects are independent normaly ;-)
  • 65. 16 Mutation Testing @SvenRuppert no need to know that Mutation Testing will be done, independend creation of T
  • 66. 16 Mutation Testing @SvenRuppert no need to know that Mutation Testing will be done, independend creation of T for K==n we need a high number of mutants ( P1, P2, .., Px)
  • 67. 16 Mutation Testing @SvenRuppert no need to know that Mutation Testing will be done, independend creation of T for K==n we need a high number of mutants ( P1, P2, .., Px) .. mostly it will lead into exponential numbers of Px
  • 68. 16 Mutation Testing @SvenRuppert no need to know that Mutation Testing will be done, independend creation of T for K==n we need a high number of mutants ( P1, P2, .., Px) .. mostly it will lead into exponential numbers of Px .. how to find YOUR barrier you have to reach?
  • 69. 16 Mutation Testing @SvenRuppert no need to know that Mutation Testing will be done, independend creation of T for K==n we need a high number of mutants ( P1, P2, .., Px) .. mostly it will lead into exponential numbers of Px .. how to find YOUR barrier you have to reach? but.. what is a mutation?
  • 70. 17 Mutation Testing - Kinds of Mutation @SvenRuppert but.. what is a mutation? Value Mutation changing constants, loop bounds (adding/subtracting values)
  • 71. 18 Mutation Testing - Kinds of Mutation @SvenRuppert but.. what is a mutation? Value Mutation Decision Mutation for example < will be changed to <=
  • 72. 19 Mutation Testing - Kinds of Mutation @SvenRuppert but.. what is a mutation? Value Mutation Decision Mutation for example swapping/deleting/duplicating lines of code Statement Mutation
  • 73. 20 Mutation Testing - Kinds of Mutation @SvenRuppert but.. what is a mutation? Value Mutation Decision Mutation Statement Mutation
  • 74. 20 Mutation Testing - Kinds of Mutation @SvenRuppert but.. what is a mutation? Value Mutation Decision Mutation Statement Mutation for Java you could think about more language spec. mutations
  • 75. 20 Mutation Testing - Kinds of Mutation @SvenRuppert but.. what is a mutation? Value Mutation Decision Mutation Statement Mutation for Java you could think about more language spec. mutations .. changing modifiers
  • 76. 20 Mutation Testing - Kinds of Mutation @SvenRuppert but.. what is a mutation? Value Mutation Decision Mutation Statement Mutation for Java you could think about more language spec. mutations .. changing modifiers .. changing between static / non static
  • 77. 20 Mutation Testing - Kinds of Mutation @SvenRuppert but.. what is a mutation? Value Mutation Decision Mutation Statement Mutation for Java you could think about more language spec. mutations .. changing modifiers .. changing between static / non static .. delete member initialization
  • 78. 20 Mutation Testing - Kinds of Mutation @SvenRuppert but.. what is a mutation? Value Mutation Decision Mutation Statement Mutation for Java you could think about more language spec. mutations .. changing modifiers .. changing between static / non static .. delete member initialization .. delete this.
  • 79. 20 Mutation Testing - Kinds of Mutation @SvenRuppert but.. what is a mutation? Value Mutation Decision Mutation Statement Mutation for Java you could think about more language spec. mutations .. changing modifiers .. changing between static / non static .. delete member initialization .. delete this. .. argument order change
  • 80. 21 Mutation Testing - in short words @SvenRuppert
  • 81. 21 Mutation Testing - in short words @SvenRuppert mutation testing is an add on to normal jUnit TDD
  • 82. 21 Mutation Testing - in short words @SvenRuppert mutation testing is an add on to normal jUnit TDD tools are supporting it well
  • 83. 21 Mutation Testing - in short words @SvenRuppert mutation testing is an add on to normal jUnit TDD tools are supporting it well generating and running all tests are time consuming
  • 84. 21 Mutation Testing - in short words @SvenRuppert mutation testing is an add on to normal jUnit TDD tools are supporting it well generating and running all tests are time consuming but most important
  • 85. 21 Mutation Testing - in short words @SvenRuppert mutation testing is an add on to normal jUnit TDD tools are supporting it well generating and running all tests are time consuming but most important will effect your project structure
  • 86. 22 Mutation Testing - Frameworks @SvenRuppert
  • 87. 22 Mutation Testing - Frameworks @SvenRuppert muJava
  • 88. 22 Mutation Testing - Frameworks @SvenRuppert muJava 2003. First released as JMutation (Java Mutation System).
 2004. The name was changed to MuJava (Mutation System for Java).
 2005. Software Copyright Registration, ALL RIGHTS RESERVED.
 2005. Version 2 released with several fault fixes and modified mutation operators.
 2008. Version 3 released with minimal support for Java 1.5 and 1.6.
 2013. Version 4 released to support JUnit tests and Java 1.6 language features, including generics, annotations, enumerations, varargs, enhanced for-each loops, and static imports.
 2015. Additional and improved error messages. Bug fixes for OpenJava. Licensing changed to the Apache license.
  • 89. 22 Mutation Testing - Frameworks @SvenRuppert muJava 2003. First released as JMutation (Java Mutation System).
 2004. The name was changed to MuJava (Mutation System for Java).
 2005. Software Copyright Registration, ALL RIGHTS RESERVED.
 2005. Version 2 released with several fault fixes and modified mutation operators.
 2008. Version 3 released with minimal support for Java 1.5 and 1.6.
 2013. Version 4 released to support JUnit tests and Java 1.6 language features, including generics, annotations, enumerations, varargs, enhanced for-each loops, and static imports.
 2015. Additional and improved error messages. Bug fixes for OpenJava. Licensing changed to the Apache license. https://cs.gmu.edu/~offutt/mujava/ https://github.com/jeffoffutt/muJava/graphs/contributors
  • 90. 22 Mutation Testing - Frameworks @SvenRuppert muJava 2003. First released as JMutation (Java Mutation System).
 2004. The name was changed to MuJava (Mutation System for Java).
 2005. Software Copyright Registration, ALL RIGHTS RESERVED.
 2005. Version 2 released with several fault fixes and modified mutation operators.
 2008. Version 3 released with minimal support for Java 1.5 and 1.6.
 2013. Version 4 released to support JUnit tests and Java 1.6 language features, including generics, annotations, enumerations, varargs, enhanced for-each loops, and static imports.
 2015. Additional and improved error messages. Bug fixes for OpenJava. Licensing changed to the Apache license. https://cs.gmu.edu/~offutt/mujava/ https://github.com/jeffoffutt/muJava/graphs/contributors inactive
  • 91. 23 Mutation Testing - Frameworks @SvenRuppert
  • 92. 23 Mutation Testing - Frameworks @SvenRuppert 2012. started around 2012 with a small codebase.
 2014. very active since 2014
  • 93. 23 Mutation Testing - Frameworks @SvenRuppert 2012. started around 2012 with a small codebase.
 2014. very active since 2014 http://pitest.org/
  • 94. 23 Mutation Testing - Frameworks @SvenRuppert 2012. started around 2012 with a small codebase.
 2014. very active since 2014 http://pitest.org/ active ;-)
  • 95. 24 Mutation Testing - Hello World @SvenRuppert http://pitest.org/
  • 96. 24 Mutation Testing - Hello World @SvenRuppert http://pitest.org/ assume the following would make sense ;-)
  • 97. 24 Mutation Testing - Hello World @SvenRuppert http://pitest.org/ assume the following would make sense ;-) public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } else { return a+b; }
 }
 }
  • 98. 25 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } else { return a+b; }
 }
 }
  • 99. 25 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } else { return a+b; }
 }
 } how many test you will need for..
  • 100. 25 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } else { return a+b; }
 }
 } how many test you will need for.. 100% Line Coverage… and…
  • 101. 25 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } else { return a+b; }
 }
 } how many test you will need for.. 100% Line Coverage… and… to be save ?
  • 102. 25 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } else { return a+b; }
 }
 } how many test you will need for.. 100% Line Coverage… and… to be save ? 2 for Line Coverage
  • 103. 25 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } else { return a+b; }
 }
 } how many test you will need for.. 100% Line Coverage… and… to be save ? 2 for Line Coverage we will see ;-)
  • 104. 26 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } else { return a+b; }
 }
 } 100% Line Coverage… and…
  • 105. 26 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } else { return a+b; }
 }
 } 100% Line Coverage… and… we have one if statement
  • 106. 26 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } else { return a+b; }
 }
 } 100% Line Coverage… and… we have one if statement with an else branch
  • 107. 26 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } else { return a+b; }
 }
 } 100% Line Coverage… and… we have one if statement with an else branch this will lead to 2 jUnit Tests to get 100 %
  • 108. 27 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } 
 else { return a+b; }
 }
 } 100% Line Coverage… and…
  • 109. 27 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } 
 else { return a+b; }
 }
 } 100% Line Coverage… and… @Test
 public void testAdd001() throws Exception {
 final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0);
 }
  • 110. 27 Mutation Testing - Hello World @SvenRuppert public class Service { public int add(int a, int b){ if (a<2) { return (a+b) * -1; } 
 else { return a+b; }
 }
 } 100% Line Coverage… and… @Test
 public void testAdd001() throws Exception {
 final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0);
 } @Test
 public void testAdd002() throws Exception {
 final int add = new Service().add(3, 0);
 Assertions.assertThat(add).isEqualTo(3);
 }
  • 111. 28 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0); final int add = new Service().add(3, 0);
 Assertions.assertThat(add).isEqualTo(3);
  • 112. 28 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0); final int add = new Service().add(3, 0);
 Assertions.assertThat(add).isEqualTo(3);
  • 113. 28 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0); final int add = new Service().add(3, 0);
 Assertions.assertThat(add).isEqualTo(3);
  • 114. 29 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0); final int add = new Service().add(3, 0);
 Assertions.assertThat(add).isEqualTo(3);
  • 115. 29 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0); final int add = new Service().add(3, 0);
 Assertions.assertThat(add).isEqualTo(3); we got 100% Line Coverage
  • 116. 29 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0); final int add = new Service().add(3, 0);
 Assertions.assertThat(add).isEqualTo(3); we got 100% Line Coverage How good these tests are?
  • 117. 29 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0); final int add = new Service().add(3, 0);
 Assertions.assertThat(add).isEqualTo(3); we got 100% Line Coverage How good these tests are? How to measure if these test are good?
  • 118. 29 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0);
 Assertions.assertThat(add).isEqualTo(0); final int add = new Service().add(3, 0);
 Assertions.assertThat(add).isEqualTo(3); we got 100% Line Coverage How good these tests are? How to measure if these test are good? How to find the good tests?
  • 119. 30 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); How to find the good tests?
  • 120. 30 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); How to find the good tests? let´s generate a the mutation report
  • 121. 30 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); How to find the good tests? let´s generate a the mutation report with maven : pitest: mutationCoverage
  • 122. 30 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); How to find the good tests? let´s generate a the mutation report with maven : pitest: mutationCoverage >> Generated 54 mutations
  • 123. 30 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); How to find the good tests? let´s generate a the mutation report with maven : pitest: mutationCoverage >> Generated 54 mutations Killed 3 (6%)
  • 124. 30 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); How to find the good tests? let´s generate a the mutation report with maven : pitest: mutationCoverage >> Generated 54 mutations org.pitest……mutators.ConditionalsBoundaryMutator Killed 3 (6%)
  • 125. 30 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); How to find the good tests? let´s generate a the mutation report with maven : pitest: mutationCoverage >> Generated 54 mutations org.pitest……mutators.ConditionalsBoundaryMutator org.pitest……mutators.IncrementsMutator Killed 3 (6%)
  • 126. 30 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); How to find the good tests? let´s generate a the mutation report with maven : pitest: mutationCoverage >> Generated 54 mutations org.pitest……mutators.ConditionalsBoundaryMutator org.pitest……mutators.IncrementsMutator org.pitest……mutators.ReturnValsMutator Killed 3 (6%)
  • 127. 30 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); How to find the good tests? let´s generate a the mutation report with maven : pitest: mutationCoverage >> Generated 54 mutations org.pitest……mutators.ConditionalsBoundaryMutator org.pitest……mutators.IncrementsMutator org.pitest……mutators.ReturnValsMutator org.pitest……mutators.MathMutator Killed 3 (6%)
  • 128. 30 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); How to find the good tests? let´s generate a the mutation report with maven : pitest: mutationCoverage >> Generated 54 mutations org.pitest……mutators.ConditionalsBoundaryMutator org.pitest……mutators.IncrementsMutator org.pitest……mutators.ReturnValsMutator org.pitest……mutators.MathMutator org.pitest……mutators.NegateConditionalsMutator Killed 3 (6%)
  • 129. 31 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations Killed 3 (6%)
  • 130. 31 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations Killed 3 (6%)
  • 131. 31 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations Killed 3 (6%)
  • 132. 32 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations Killed 3
  • 133. 32 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations Killed 3
  • 134. 32 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations Killed 3
  • 135. Killed 3 33 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations
  • 136. Killed 3 33 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations final int add = new Service().add(2, 0);
  • 137. 33 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations final int add = new Service().add(2, 0);
  • 138. Killed 4 33 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations final int add = new Service().add(2, 0);
  • 139. Killed 4 33 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations final int add = new Service().add(2, 0);
  • 140. Killed 4 33 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations final int add = new Service().add(2, 0);
  • 141. Killed 4 33 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); final int add = new Service().add(3, 0); >> Generated 54 mutations final int add = new Service().add(2, 0);
  • 142. Killed 4 33 Mutation Testing - Hello World @SvenRuppert final int add = new Service().add(0, 0); >> Generated 54 mutations final int add = new Service().add(2, 0);
  • 143. Killed 4 33 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0);
  • 144. Killed 4 34 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0);
  • 145. Killed 4 34 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0); final int add = new Service().add(1, 1);
  • 146. 34 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0); final int add = new Service().add(1, 1);
  • 147. Killed 5 34 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0); final int add = new Service().add(1, 1);
  • 148. Killed 5 34 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0); final int add = new Service().add(1, 1); killed 9:1
  • 149. Killed 5 35 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0); final int add = new Service().add(1, 1); killed 9:1
  • 150. Killed 5 35 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0); final int add = new Service().add(1, 1); killed 9:1 final int add = new Service().add(2, 2);
  • 151. 35 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0); final int add = new Service().add(1, 1); killed 9:1 final int add = new Service().add(2, 2);
  • 152. Killed 6 35 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0); final int add = new Service().add(1, 1); killed 9:1 final int add = new Service().add(2, 2);
  • 153. Killed 6 35 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0); final int add = new Service().add(1, 1); killed 9:1 final int add = new Service().add(2, 2);
  • 154. Killed 6 35 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0); final int add = new Service().add(1, 1); killed 9:1 final int add = new Service().add(2, 2);
  • 155. Killed 6 35 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(2, 0); final int add = new Service().add(1, 1); final int add = new Service().add(2, 2); killed 11:1
  • 156. Killed 6 35 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(1, 1); final int add = new Service().add(2, 2); killed 11:1
  • 157. Killed 6 36 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(1, 1); final int add = new Service().add(2, 2);
  • 158. Killed 6 36 Mutation Testing - Hello World @SvenRuppert >> Generated 54 mutations final int add = new Service().add(1, 1); final int add = new Service().add(2, 2);
  • 159. 37 Mutation Testing - Lesson Learned @SvenRuppert
  • 160. 37 Mutation Testing - Lesson Learned @SvenRuppert mutation tests are often leading to
  • 161. 37 Mutation Testing - Lesson Learned @SvenRuppert mutation tests are often leading to …cleaner code compared to jUnit only
  • 162. 37 Mutation Testing - Lesson Learned @SvenRuppert mutation tests are often leading to …cleaner code compared to jUnit only … smaller modules (shorter mutation runtime)
  • 163. 37 Mutation Testing - Lesson Learned @SvenRuppert mutation tests are often leading to …cleaner code compared to jUnit only … smaller modules (shorter mutation runtime) and something nice… helps to find useless code
  • 164. 38 Example of useless Code @SvenRuppert
  • 165. 38 Example of useless Code @SvenRuppert
  • 166. 38 Example of useless Code @SvenRuppert
  • 167. 39 Mutation Testing - How to start @SvenRuppert
  • 168. 39 Mutation Testing - How to start @SvenRuppert you need jUnit - to generate the reference
  • 169. 39 Mutation Testing - How to start @SvenRuppert you need jUnit - to generate the reference add the pitest-plugin to the build section
  • 170. 39 Mutation Testing - How to start @SvenRuppert you need jUnit - to generate the reference add the pitest-plugin to the build section configure the plugin
  • 171. 39 Mutation Testing - How to start @SvenRuppert you need jUnit - to generate the reference add the pitest-plugin to the build section configure the plugin generate the reference -> clean , install
  • 172. 39 Mutation Testing - How to start @SvenRuppert you need jUnit - to generate the reference add the pitest-plugin to the build section configure the plugin generate the reference -> clean , install run pitest: mutationCoverage
  • 173. 39 Mutation Testing - How to start @SvenRuppert you need jUnit - to generate the reference add the pitest-plugin to the build section configure the plugin generate the reference -> clean , install run pitest: mutationCoverage report will be under target/pit-reports
  • 174. 40 Mutation Testing - How to start @SvenRuppert pom.xml - example - build <plugin>
 <groupId>org.pitest</groupId>
 <artifactId>pitest-maven</artifactId>
 <configuration>
 <outputFormats>
 <outputFormat>XML</outputFormat>
 <outputFormat>HTML</outputFormat>
 </outputFormats>
 <targetClasses>
 <param>org.rapidpm.*</param>
 </targetClasses>
 <targetTests>
 <param>org.rapidpm.*</param>
 <param>junit.org.rapidpm.*</param>
 </targetTests>
 </configuration>
 </plugin>
  • 175. 41 Mutation Testing - How to start @SvenRuppert pom.xml - example - reporting <reporting>
 <plugins>
 <plugin>
 <groupId>org.pitest</groupId>
 <artifactId>pitest-maven</artifactId>
 <reportSets>
 <reportSet>
 <reports>
 <report>report</report>
 </reports>
 </reportSet>
 </reportSets>
 </plugin>
 </plugins>
 </reporting>
  • 176. 42 Mutation Testing - practical usage @SvenRuppert
  • 177. 42 Mutation Testing - practical usage @SvenRuppert Start with some tests
  • 178. 42 Mutation Testing - practical usage @SvenRuppert Start with some tests generate the pitest report
  • 179. 42 Mutation Testing - practical usage @SvenRuppert Start with some tests generate the pitest report write more tests to kill mutations
  • 180. 42 Mutation Testing - practical usage @SvenRuppert Start with some tests generate the pitest report write more tests to kill mutations if you have time, eliminate useless tests
  • 181. 42 Mutation Testing - practical usage @SvenRuppert Start with some tests generate the pitest report write more tests to kill mutations if you have time, eliminate useless tests do it one by one
  • 182. 42 Mutation Testing - practical usage @SvenRuppert Mutation 001 Mutation 002 Mutation 003 Mutation 004 Survived Survived Survived Survived Start with some tests generate the pitest report write more tests to kill mutations if you have time, eliminate useless tests do it one by one
  • 183. 42 Mutation Testing - practical usage @SvenRuppert Mutation 001 Mutation 002 Mutation 003 Mutation 004 Survived Killed Survived Survived Survived Killed Killed Killed Start with some tests generate the pitest report write more tests to kill mutations if you have time, eliminate useless tests do it one by one
  • 184. Summary 43 @SvenRuppert If you are interested… have a look at GITHUB ProxyBuilder Dynamic-Dependency-Injection Java-Microservice or contact me ;-) @SvenRuppert
  • 185. Summary 43 @SvenRuppert If you are interested… have a look at GITHUB ProxyBuilder Dynamic-Dependency-Injection Java-Microservice or contact me ;-) @SvenRuppert Thank You !!!