More Related Content Similar to Let's make this test suite run faster Similar to Let's make this test suite run faster (20) More from David Gageot (6) Let's make this test suite run faster4. “ I firmly believe it can make your
product beBer. Faster to test leads
to faster to write, deploy and use ”
Anonymous bearded freelance developper
16. “ I firmly believe it can make your
product beBer. Faster to test leads
to faster to write, deploy and use ”
Anonymous bearded freelance developper
17. How can we accelerate the tests?
The Cheater
The Lazy
The Brave
22. Use all the cores with Maven3
mvn -‐T1 clean install : 5:05s
mvn -‐T4 clean install : 3:10s
Beware of
tests with side
effects
24. Use all the cores with JUnit/TestNG
Beware of
tests with side
effects
30. Work in a sandbox
The
database
is
slow
In-‐memory
database
H2
behaves
much
like
MySql
As simple as
changing an
xml file
31. It’s Not only SQL
The
network
is
slow
If
going
for
NoSQL,
choose
a
server
that
can
run
in-‐process
eg.
Voldemort
35. Of course all of these are easier to setup
at the beginning of a project
40. AcKon #1 -‐ Break the longer integraKon test
Into
one
faster
integra:on
test
and
a
lot
of
small
unit
tests
41. AcKon #2 -‐ Mock the slowest layers
eg.
with
Spring
and
Mockito
spies
Mocks are
not just for
unit tests
42. AcKon #3 -‐ Don’t test through the browser
Selenium
is
oPen
overkill
«But
my
applica:on
is
complex!»
«My
users
want
complex
features,
My
users
want
Ajax»
«I
need
to
test
browser
compa:bility!»
46. AcKon #4 -‐ SomeKmes be old school
write
(easier
to
test)
server-‐side
code
48. One more thing™
Ac:on
#0
-‐
Simplify
and
op:mize
your
code
Tests
will
run
faster
Keep that one
secret...