Testing, CI and CD in the real world

rocboronat 596 views 44 slides Mar 12, 2016
Slide 1
Slide 1 of 44
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44

About This Presentation

No description available for this slideshow.


Slide Content

Testing
continous Integration
continous Delivery
…in the real world!

Roc Boronat
I develop Android things


– I wanna learn about testing! – Roc 2014

tests
introducing

unitary tests

integration tests

instrumentation tests

we started with unitary tests to
develop regular expressions
^[6789]{1}[0-9]{8}$
^0{2}[0-9]{11,}

we started with unitary tests to
develop regular expressions

we started with unitary tests to
develop regular expressions

we started with unitary tests to
develop regular expressions

we started with unitary tests to
develop regular expressions
given
when
then
given
when
then

we started with unitary tests to
parse deeplink URL’s
this happens at

we started with unitary tests to
parse deeplink URL’s
this happens at

we started with unitary tests to
parse deeplink URL’s
this happens at

we started with unitary tests to
improve an invoice generator
Customer can have a insurance… or not
The insurance can have a coverage limit… or not
The insurance can have a franchise deductible… or not
The insurance company can pay the VAT of the amount… or not

we started with unitary tests to
improve an invoice generator

we started with unitary tests to
improve an invoice generator

we started with unitary tests to
refactor legacy code
this happens at

we started with unitary tests to
refactor legacy code
Sandro Mancuso
craftedws.blogspot.com
Testing and Refactoring Legacy Code
youtu.be/_NnElPO5BU0
Legacy Code Rules

•You cannot change production code if not covered by tests
… just automated refactorings (via IDE) are allowed, if needed to write the test
this happens at

we started with unitary tests to
refactor legacy code
Sandro Mancuso
craftedws.blogspot.com
Testing and Refactoring Legacy Code
youtu.be/_NnElPO5BU0
this happens at

last tips about unitary tests
follow the given-when-then style

test one thing at a time

test the domain: is easy and valuable

frustration is the first step towards improvement

know the tools: JUnit + AssertJ + Mockito

unitary tests

integration tests

instrumentation tests

we started with integration test to
develop an API module
this happens at
quit smoking with your phone

tips about integration tests
develop the API module by TDD

check that your customer’s API has not changed

monitor your own API using a CI tool

unitary tests

integration tests

instrumentation tests

we started with instrumentation test to
test an app end to end
this happens at

we started with instrumentation test to
test an app end to end
this happens at

we started with instrumentation test to
test an app end to end
this happens at

tips about instrumentation tests
simple way to do «defensive testing»

fast way to develop «deep screens»

Espresso has been a game changer

They use to fail at CI tools

extra point: TDD
test-driven development

extra point: TDD
test-driven development

extra point 2: EDD?
error-driven development
Someone found a bug?

Write a test that reproduces it before fixing it!

extra point 2: EDD?
error-driven development
this happens at

continous *
introducing

continous integration

continous delivery

we started with continous integration to
fail fast
this happens at
quit smoking with your phone

we started with continous integration to
fail fast
this happens at
quit smoking with your phone

we started with continous integration to
maintain code quality
this happens at

we started with continous integration to
maintain code quality
this happens at

continous integration

continous delivery

we started with continous delivery to
launch releases from SourceTree
Group of Betatesters 0,5% of users
this happens at
quit smoking with your phone

we started with continous delivery to
update stakeholders
the product owners have
the last developed feature
in their phones
this happens at

we started with continous delivery to
launch releases from Terminal
Group of Betatesters Alpha Release
this happens at

Roc Boronat
[email protected]
Tags