The document discusses MediaGeniX's use of continuous integration to test code changes. It describes their current testing system, challenges with a large codebase and many customers, and how continuous integration helps by automatically testing each code change. Continuous integration allows problems to be detected and fixed early by integrating code changes frequently and testing the integrated code.
21. Con$nuous
integra$on
§
Many
isolated
changes
§
Many
integra,ons
§
Each
is
immediately
tested
§
Detect
and
fix
problems
soon
22. Con$nuous
integra$on
Development
teams
integrate
frequently
§
Avg:
70/day
Tes,ng
system
§
Each
integra,on
is
automa,cally
built
and
tested
Efficiently
detect
and
fix
problems
Significant
reduc,on
of
integra,on
problems
Develop
cohesive
soZware
even
in
a
limited
,me
frame
23. What
do
we
test?
As
much
as
possible
§
Unit
tests
§
Consistency
checks
§
UI
tests
and
Acceptance
tests
in
general
§
Refactoring
tests
Sequen,al
running
of
tests
take
over
12
hours
24. Code
consistency
checks
Check
if
code
guidelines
have
been
followed
Why
?
§
Consistent
code
makes
life
easy
§
Reduce
number
of
bugs
25. Code
consistency
checks
buildMenuBar
TopApplica?on
Applica,on
A
|
menu
|
(menu
:=
Menu
new)
Applica,on
B
addItem:
self
fileMenuItem;
addItem:
self
editMenuItem;
Applica,on
C
addItem:
self
toolsMenuItem.
self
addMenuBarItemsTo:
menu.
menu
addItem:
self
viewMenuItem;
addItem:
self
windowsMenuItem.
^menu
26. Code
consistency
checks
TopApplica?on
Applica,on
A
Applica,on
B
Applica,on
C
test_topApplica,on_buildMenuBar
"Don't
implement
#buildMenuBar.
use
#addMenuBarItemsTo:"
self
assert:
(self
implementorsOf:
#buildMenuBar
inSubclassesOf:
TopApplica,on)
isEmpty.
27. UI
tests
and
Acceptance
tests
Why
?
§
Unit
test
§
Test
a
method
§
Change
the
method,
change
the
test
§
Acceptance
test
§
Emulate
a
user
process
§
More
stable
tests
=>
Never
change
func,onality,
unless
user
asks
for
it
36. Refactoring
tests
Why
?
Basic
Whats’On
Method
X
Y
Call
X
Y
Press
Bu@on
C
Ac?on
A
Whats’On
for
a
customer
Method
X
Ac?on
B
=>
Important
during
upgrades
38. Goals
§
Get
test
results
as
fast
as
possible
§
Alert
ASAP
when
build
is
broken
§
Emulate
actual
users
§
SLA:
Priority
1
bug
=>
deliver
bugfix
within
1
day
39. Challenges
§
Tests
take
over
12
hours
to
run
§
No
out-‐of-‐the-‐box
solu,on
⇒ We
Built
a
distributed
system
ourselves
§
Mul,ple
tests
on
the
same
DB
40. Mul$ple
tests
on
same
DB
§
Problem:
You
assume
a
‘clean
DB’
when
you
start
running
a
test
§
Solu$on:
Take
snapshot
before
test,
restore
snapshot
aZer
test
41.
4 Test Coordinators
4 x16 Test Slaves
Current
Tes,ng
System
Image Creator
Test Master
42. Store
.
Test Master
Tes,ng
a
version
§
Step
by
step:
§
The
version
has
to
be
loaded
§
Create
a
database
§
The
version
has
to
be
tested
§
The
developer
gets
the
results
§
The
test
master
orchestrates
this
whole
process
43. Test Master
Image Creator
To
Load
To
Test
Your
…
version
…
Image
Creator
Your
…
version
…
Your
version
Your
…
version
…
Your
version
§
TM
instructs
IC
to
load
your
version
Store
.
§
Get
customers
code
from
Store
§
AZer
loading
§
Puts
the
new
image
on
a
fileserver
§
IC
no,fies
TM
he’s
done
44.
Test
Coordinator
§
TM
instructs
a
TC
to
start
tes,ng
a
version
Test Master
§
A
TM
is
responsible
for
1
whole
version
To
Load
To
Test
…
Your
version
…
…
4 Test Coordinators
45.
Test
Slave
§
TC
orders
TSs
to
copy
image
Test Master
and
create
a
local
database
§
When
database
ready,
start
tes,ng!
§
Test
Class
per
Test
Class
§
Report
back
to
TC
when
tes,ng
of
1
Class
is
done
and
receive
a
new
class
un,l
finished
1 of the 4 Test Coordinators
16 Test Slaves
46.
47.
Op,miza,ons
Test Master
§
Parallel
vs
sequen,al
Image Creator
§
IC
can
load
4
versions
simultaneously
§
4
TCs
4
Versions
are
tested
simultaneously
§
16
TSs
Tes,ng
1
version
is
much
faster
1 of the 4 Test Coordinators
16 Test Slaves
48. Test Master
To
Load
To
Test
Version
z
Version
(x+1)
y
x
for
customer
C
for
customer
A
B
…
Version
(x+1)
y
Op,miza,ons
for
customer
B
A
Version
(x+1)
…
for
customer
A
…
§
Dialog
‘Would
you
like
to
schedule
the
tests’
§
Only
test
latest
available
version
§
TM
queues
can
be
manipulated
§
Priori,ze
§
Unschedule
51.
Test
Results
§
What?
Timing?
§
Build
failed
<
45minutes
§
AZer
tests
have
successfully
run
§
X
total
tests,
Y
failures,
Z
errors,
T
not
run
§
With
wai,ng
in
a
queue
+/-‐
4hours
§
Without
wai,ng
in
a
queue
<
1hour
§
Saved
on
Store!
59. Goals
§ Get
test
results
as
fast
as
possible
§ Alert
ASAP
when
build
is
broken
§ Emulate
actual
users
§ SLA:
Priority
1
bug
=>
deliver
bugfix
within
1
day
60. Conclusion
Goals
have
been
met!
§ Build
with
report
on
broken
builds
within
45
minutes
§ Test
results
can
come
in
within
1
hour
§ Prio
1
bugs
can
be
fixed
within
a
day
§ ‘Reasonable’
,me
for
results
§ 4
hours
on
average
§ Bonus:
integrated
tools
on
SUnit
61. Conclusion
Future
areas
of
improvement
…
§ Test
every
version
§ Be@er
pin-‐point
where
an
error
started
§ Speed
up
through-‐put
of
unpriori,sed
tests
62. Ques,ons?
63. Q:
Which
customisa,ons
do
customers
want?
A:
See
next
presenta,on
Q:
Why
does
the
product
need
to
change
that
oZen?
A:
Technical
evolu,on,
target
different
markets,
new
regula,ons,
…