How a migration to MicroServices could change the team, architecture and coding culture.
What you could you do and how you could transform a "Jurassic Park" into a lightweight environment.
In this talk we will explore the strategy, techniques, pattern and tools I used to
transform a team and the architecture that was grown over 15yrs.
This will be a mix of pattern, tools and techniques that was able to migrate
old systems, used inside insurance and banks.
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.)
10. 5
@SvenRuppertAt the time I started - 3 yrs ago
Codebase is > 13 years old
no test coverage
Code Lords
11. 5
@SvenRuppertAt the time I started - 3 yrs ago
Codebase is > 13 years old
no test coverage
Code Lords
nearly 15% are retired soon
12. 5
@SvenRuppertAt the time I started - 3 yrs ago
Codebase is > 13 years old
no test coverage
Code Lords
nearly 15% are retired soon
over 50% are since 15 yrs in the company
13. 5
@SvenRuppertAt the time I started - 3 yrs ago
Codebase is > 13 years old
no test coverage
Code Lords
nearly 15% are retired soon
over 50% are since 15 yrs in the company
hiring only students
14. 5
@SvenRuppertAt the time I started - 3 yrs ago
Codebase is > 13 years old
no test coverage
Code Lords
nearly 15% are retired soon
over 50% are since 15 yrs in the company
the developers learned Java at this project
hiring only students
15. 5
@SvenRuppertAt the time I started - 3 yrs ago
Codebase is > 13 years old
no test coverage
Code Lords
nearly 15% are retired soon
over 50% are since 15 yrs in the company
the developers learned Java at this project
hiring only students
the first feeling was like ……
23. 12
@SvenRuppertThe way of working
20% Time have time to play or try
start learning how to practice it ?
Closed Source versus Open Source
work from everywhere at your time
we started step by step
32. 14
@SvenRuppertwork from everywhere
change your environment
use Messenger like Slack avoid mails
remote meetings with zoom
remote Pair-Programming
work async.
work at your time that is the best for you
38. 15
@SvenRuppertwork from everywhere
work at your time that is the best for you
my „normal“ day…
working05AM to 07AM
breakfast with the family07AM to 09AM
working09AM to 12AM
39. 15
@SvenRuppertwork from everywhere
work at your time that is the best for you
my „normal“ day…
working05AM to 07AM
breakfast with the family07AM to 09AM
working09AM to 12AM
playing with my son12AM to 07PM
40. 15
@SvenRuppertwork from everywhere
work at your time that is the best for you
my „normal“ day…
working05AM to 07AM
breakfast with the family07AM to 09AM
working09AM to 12AM
playing with my son12AM to 07PM
playing with my wife07PM to 09PM
41. 15
@SvenRuppertwork from everywhere
work at your time that is the best for you
my „normal“ day…
working05AM to 07AM
breakfast with the family07AM to 09AM
working09AM to 12AM
playing with my son12AM to 07PM
playing with my wife07PM to 09PM
working09PM to 11PM
42. 15
@SvenRuppertwork from everywhere
work at your time that is the best for you
my „normal“ day…
working05AM to 07AM
breakfast with the family07AM to 09AM
working09AM to 12AM
playing with my son12AM to 07PM
playing with my wife07PM to 09PM
working09PM to 11PM
and yes… I need only 6h sleep ;-)
44. 16
@SvenRuppertwork from everywhere
work at your time that is the best for you
my „normal“ day…
working05AM to 07AM
working09AM to 12AM
working09PM to 11PM
working with Asia
45. 16
@SvenRuppertwork from everywhere
work at your time that is the best for you
my „normal“ day…
working05AM to 07AM
working09AM to 12AM
working09PM to 11PM
working with Asia
working with Europe
46. 16
@SvenRuppertwork from everywhere
work at your time that is the best for you
my „normal“ day…
working05AM to 07AM
working09AM to 12AM
working09PM to 11PM
working with Asia
working with Europe
working with US
62. 19
@SvenRuppertClosed- versus Open Source
Analyzing the existing Code
in our case : a lot of infrastructure…
..with this we are not earning money
63. 19
@SvenRuppertClosed- versus Open Source
Analyzing the existing Code
in our case : a lot of infrastructure…
..with this we are not earning money
we divided the
64. 19
@SvenRuppertClosed- versus Open Source
Analyzing the existing Code
in our case : a lot of infrastructure…
..with this we are not earning money
we divided the
code base
65. 19
@SvenRuppertClosed- versus Open Source
Analyzing the existing Code
in our case : a lot of infrastructure…
..with this we are not earning money
we divided the
code base
dev. environment
69. 20
@SvenRuppertClosed- versus Open Source
we divided the
code base dev. environment
could write articles about it
discuss at conferences
70. 20
@SvenRuppertClosed- versus Open Source
we divided the
code base dev. environment
could write articles about it
discuss at conferences
71. 20
@SvenRuppertClosed- versus Open Source
we divided the
code base dev. environment
could write articles about it
discuss at conferences
will lead to better documentation
72. 20
@SvenRuppertClosed- versus Open Source
we divided the
code base dev. environment
could write articles about it
discuss at conferences
will lead to better documentation
73. 20
@SvenRuppertClosed- versus Open Source
we divided the
code base dev. environment
could write articles about it
discuss at conferences
will lead to better documentation
out of company rules
74. 20
@SvenRuppertClosed- versus Open Source
we divided the
code base dev. environment
could write articles about it
discuss at conferences
will lead to better documentation
out of company rules
free choice of tools
75. 20
@SvenRuppertClosed- versus Open Source
we divided the
code base dev. environment
could write articles about it
discuss at conferences
will lead to better documentation
out of company rules
free choice of tools
76. 20
@SvenRuppertClosed- versus Open Source
we divided the
code base dev. environment
could write articles about it
discuss at conferences
will lead to better documentation
out of company rules
free choice of tools
higher motivation
81. 21
@SvenRuppertThe way of working
Start Learning again
for example:
functionalfocus on a new paradigm
82. 21
@SvenRuppertThe way of working
Start Learning again
for example:
functionalfocus on a new paradigm reactive
83. 21
@SvenRuppertThe way of working
Start Learning again
for example:
functional
add a new Language
focus on a new paradigm reactive
84. 21
@SvenRuppertThe way of working
Start Learning again
for example:
functional
add a new Language
focus on a new paradigm
but not everyone want to learn
reactive
85. 21
@SvenRuppertThe way of working
Start Learning again
for example:
functional
add a new Language
focus on a new paradigm
but not everyone want to learn
or better…. some are learning faster
reactive
86. 21
@SvenRuppertThe way of working
Start Learning again
for example:
functional
add a new Language
focus on a new paradigm
but not everyone want to learn
or better…. some are learning faster
reactive
this sometimes leads to …..
reactions….
100. 26
@SvenRuppertThe way of working
Start Learning again
this sometimes leads to ….. reactions….
if you don´t want
to loose them
101. 26
@SvenRuppertThe way of working
Start Learning again
this sometimes leads to ….. reactions….
you have to deal with this
if you don´t want
to loose them
102. 26
@SvenRuppertThe way of working
Start Learning again
this sometimes leads to ….. reactions….
you have to deal with this
if you don´t want
to loose them
make them
happy again
103. 26
@SvenRuppertThe way of working
Start Learning again
this sometimes leads to ….. reactions….
you have to deal with this
if you don´t want
to loose them
make them
happy again
104. 26
@SvenRuppertThe way of working
Start Learning again
this sometimes leads to ….. reactions….
you have to deal with this
if you don´t want
to loose them
make them
happy again
How we solved
this?
108. 27
@SvenRuppertThe way of working
we are a product company
with a lot of LTS contracts
we created three streams
109. 27
@SvenRuppertThe way of working
we are a product company
with a lot of LTS contracts
we created three streams
Consultants - play and throw away
110. 27
@SvenRuppertThe way of working
we are a product company
with a lot of LTS contracts
we created three streams
Consultants - play and throw away
Core Developers - collect and clean
111. 27
@SvenRuppertThe way of working
we are a product company
with a lot of LTS contracts
we created three streams
Consultants - play and throw away
Core Developers - collect and clean
LTS Developers - keep alive
112. 27
@SvenRuppertThe way of working
we are a product company
with a lot of LTS contracts
we created three streams
Consultants - play and throw away
Core Developers - collect and clean
LTS Developers - keep alive
Why ?
113. 28
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive Why ?
114. 28
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive Why ?
some want to learn and experiment
115. 28
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive Why ?
some want to learn and experiment
some need more stabil environments
116. 28
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive Why ?
some want to learn and experiment
some need more stabil environments
some did not want to change something
117. 29
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
Why ?
some want to learn and experiment
some need more stabil environments
some did not want to change something
118. 29
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
Why ?
some want to learn and experiment
some need more stabil environments
some did not want to change something
amount of hours paid by the customer
119. 29
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
Why ?
some want to learn and experiment
some need more stabil environments
some did not want to change something
amount of hours paid by the customer
rated on hours the systems are stabil
120. 29
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
Why ?
some want to learn and experiment
some need more stabil environments
some did not want to change something
amount of hours paid by the customer
rated on hours the systems are stabil
fixed income - bonus based on Change Request
121. 30
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
122. 30
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
123. 30
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
124. 30
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
customer driven
125. 30
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
customer driven
126. 30
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
SCRUM
customer driven
127. 30
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
SCRUM
customer driven
128. 30
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
SCRUM
customer driven
roadmap driven
129. 30
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
SCRUM
customer driven
roadmap driven
130. 30
@SvenRuppertThe way of working
Consultants - play and throw away
Core Developer - collect and clean
LTS Developer - keep alive
SCRUM
Kanban
customer driven
roadmap driven
131. 31
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Core - Developers Core - Developers
Consultants
132. 31
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Core - Developers Core - Developers
Consultants
133. 31
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Core - Developers Core - Developers
Fire
Consultants
134. 31
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Core - Developers Core - Developers
Fire
Consultants
135. 31
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Core - Developers Core - Developers
Fire
Consultants
136. 31
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Core - Developers Core - Developers
Fire
Consultants
139. 32
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Consultants Consultants Consultants
LTS - Developers LTS - Developers
140. 32
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Consultants Consultants Consultants
LTS - Developers LTS - Developers
141. 32
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Consultants Consultants Consultants
LTS - Developers LTS - Developers
time based planning
142. 32
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Core - Developers
Consultants Consultants Consultants
LTS - Developers LTS - Developers
Core - Developers Core - Developers
time based planning
143. 32
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Core - Developers
Consultants Consultants Consultants
LTS - Developers LTS - Developers
Core - Developers Core - Developers
time based planning
144. 32
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Core - Developers
Consultants Consultants Consultants
LTS - Developers LTS - Developers
Core - Developers Core - Developers
time based planning
version based
145. 32
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Core - Developers
Consultants Consultants Consultants
LTS - Developers LTS - Developers
Core - Developers Core - Developers
time based planning fixed size time slots
version based
146. 32
@SvenRuppertThe way of working
SCRUM
Kanban
Consultants
LTS - Developers
Core - Developers
Consultants Consultants Consultants
LTS - Developers LTS - Developers
Core - Developers Core - Developers
time based planning fixed size time slots
version based dynamic size time slots
185. 37
@SvenRuppertTechnical Transformation
what is the right technology for your team?
what is the right order?
reduce complexity
scale
the team could work with
a lot more….
start with new modules ?
186. 37
@SvenRuppertTechnical Transformation
what is the right technology for your team?
what is the right order?
reduce complexity
scale
the team could work with
a lot more….
start with new modules ?
start with the oldest one ?
187. 37
@SvenRuppertTechnical Transformation
what is the right technology for your team?
what is the right order?
reduce complexity
scale
the team could work with
a lot more….
start with new modules ?
start with the oldest one ?
most komplex one?
188. 37
@SvenRuppertTechnical Transformation
what is the right technology for your team?
what is the right order?
reduce complexity
scale
the team could work with
a lot more….
start with new modules ?
start with the oldest one ?
most komplex one?
… or ….
203. 40
@SvenRuppertQM / QS - TDD
Do you have bugs in your code ?
since years
you are
working hard
on this….
no
204. 40
@SvenRuppertQM / QS - TDD
Do you have bugs in your code ?
since years
you are
working hard
on this….
no
205. 41
@SvenRuppertQM / QS - TDD
Codebase is > 13 years old
remember….
how to start?
what is the right point to start?
how to increase the quality of the tests?
206. 41
@SvenRuppertQM / QS - TDD
Codebase is > 13 years old
no test coverage
remember….
how to start?
what is the right point to start?
how to increase the quality of the tests?
207. 41
@SvenRuppertQM / QS - TDD
Codebase is > 13 years old
no test coverage
how to decrease complexity?
remember….
how to start?
what is the right point to start?
how to increase the quality of the tests?
210. 42
TDD with jUnit @SvenRuppert
are you using jUnit?
assume that the following would make sense.. ;-)
211. 42
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;
}
}
}
212. 42
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 ?
213. 42
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 ;-)
214. 43
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 ;-)
215. 43
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
216. 43
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
217. 43
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?
218. 43
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? maybe ;-)
219. 44
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? maybe ;-)
it depends ;-)
220. 44
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? maybe ;-)
how to find out, what will be enough?
it depends ;-)
221. 44
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? maybe ;-)
how to find out, what will be enough?
how to find the right tests?
it depends ;-)
222. 45
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 ?
223. 45
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);
}
224. 45
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);
}
229. 46
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
230. 46
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?
232. 47
Mutation Testing - the Idea @SvenRuppert
a mutation is a small change in the code
233. 47
Mutation Testing - the Idea @SvenRuppert
a mutation is a small change in the code
.. small enough to be a small defect
234. 47
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
235. 47
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
236. 48
Mutation Testing - the Idea @SvenRuppert
P will be the program
T will be the collection of all tests / Test Suite
237. 48
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...
238. 48
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
239. 48
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
240. 48
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
241. 48
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
242. 48
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
245. 49
Mutation Testing - the Idea @SvenRuppert
if we kill k out of n mutants
-> we are not good enough ;-)
246. 49
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
247. 49
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 ?
248. 49
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..
249. 49
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
255. 50
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
256. 51
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;
}
}
}
257. 51
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..
258. 51
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…
259. 51
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 ?
260. 51
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
261. 51
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 ;-)
262. 52
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…
263. 52
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
264. 52
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
265. 52
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 %
266. 53
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…
267. 53
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);
}
268. 53
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);
}
269. 54
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);
270. 54
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);
271. 54
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);
272. 55
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
273. 55
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
274. 55
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
275. 56
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
276. 56
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
277. 56
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
278. Killed 3
57
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
final int add = new Service().add(3, 0);
>> Generated 54 mutations
279. Killed 3
57
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);
280. 57
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);
281. Killed 4
57
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);
282. Killed 4
57
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);
283. Killed 4
57
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);
284. Killed 4
57
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);
285. Killed 4
57
Mutation Testing - Hello World @SvenRuppert
final int add = new Service().add(0, 0);
>> Generated 54 mutations
final int add = new Service().add(2, 0);
286. Killed 4
57
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
287. Killed 4
58
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
288. Killed 4
58
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
289. 58
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
290. Killed 5
58
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(2, 0);
final int add = new Service().add(1, 1);
291. Killed 5
58
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
292. Killed 5
59
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
293. Killed 5
59
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);
294. 59
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);
295. Killed 6
59
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);
296. Killed 6
59
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);
297. Killed 6
59
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);
298. Killed 6
59
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
299. Killed 6
59
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
300. Killed 6
60
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(1, 1);
final int add = new Service().add(2, 2);
301. Killed 6
60
Mutation Testing - Hello World @SvenRuppert
>> Generated 54 mutations
final int add = new Service().add(1, 1);
final int add = new Service().add(2, 2);
303. 61
Mutation Testing - in short words @SvenRuppert
mutation testing is an add on to normal jUnit TDD
304. 61
Mutation Testing - in short words @SvenRuppert
mutation testing is an add on to normal jUnit TDD
tools are supporting it well
305. 61
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
306. 61
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
307. 61
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
320. Summary
68
@SvenRuppert
If you are interested…
have a look at GITHUB
ProxyBuilder
Dynamic-Dependency-Injection
Java-Microservice
or contact me ;-) @SvenRuppert
321. Summary
68
@SvenRuppert
If you are interested…
have a look at GITHUB
ProxyBuilder
Dynamic-Dependency-Injection
Java-Microservice
or contact me ;-) @SvenRuppert
Thank You !!!