testing, ci and cd in the real world

44
Testing continous Integration continous Delivery in the real world!

Upload: roc-boronat

Post on 13-Apr-2017

647 views

Category:

Engineering


2 download

TRANSCRIPT

Page 1: Testing, CI and CD in the real world

Testing continous Integration continous Delivery

…in the real world!

Page 2: Testing, CI and CD in the real world

Roc Boronat I develop Android things

– I wanna learn about testing! – Roc 2014

Page 3: Testing, CI and CD in the real world

tests introducing

Page 4: Testing, CI and CD in the real world

unitary tests

integration tests

instrumentation tests

Page 5: Testing, CI and CD in the real world

we started with unitary tests to

develop regular expressions

^[6789]{1}[0-9]{8}$ ^0{2}[0-9]{11,}

Page 6: Testing, CI and CD in the real world

we started with unitary tests to

develop regular expressions

Page 7: Testing, CI and CD in the real world

we started with unitary tests to

develop regular expressions

Page 8: Testing, CI and CD in the real world

we started with unitary tests to

develop regular expressions

Page 9: Testing, CI and CD in the real world

we started with unitary tests to

develop regular expressions

given when then

given when then

Page 10: Testing, CI and CD in the real world

we started with unitary tests to

parse deeplink URL’s

this happens at

Page 11: Testing, CI and CD in the real world

we started with unitary tests to

parse deeplink URL’s

this happens at

Page 12: Testing, CI and CD in the real world

we started with unitary tests to

parse deeplink URL’s

this happens at

Page 13: Testing, CI and CD in the real world

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

Page 14: Testing, CI and CD in the real world

we started with unitary tests to

improve an invoice generator

Page 15: Testing, CI and CD in the real world

we started with unitary tests to

improve an invoice generator

Page 16: Testing, CI and CD in the real world

we started with unitary tests to

refactor legacy code

this happens at

Page 17: Testing, CI and CD in the real world

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

Page 18: Testing, CI and CD in the real world

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

Page 19: Testing, CI and CD in the real world

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

Page 20: Testing, CI and CD in the real world

unitary tests

integration tests

instrumentation tests

Page 21: Testing, CI and CD in the real world

we started with integration test to

develop an API module

this happens at

quit smoking with your phone

Page 22: Testing, CI and CD in the real world

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

Page 23: Testing, CI and CD in the real world

unitary tests

integration tests

instrumentation tests

Page 24: Testing, CI and CD in the real world

we started with instrumentation test to

test an app end to end

this happens at

Page 25: Testing, CI and CD in the real world

we started with instrumentation test to

test an app end to end

this happens at

Page 26: Testing, CI and CD in the real world

we started with instrumentation test to

test an app end to end

this happens at

Page 27: Testing, CI and CD in the real world

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

Page 28: Testing, CI and CD in the real world

extra point: TDD test-driven development

Page 29: Testing, CI and CD in the real world

extra point: TDD test-driven development

Page 30: Testing, CI and CD in the real world

extra point 2: EDD? error-driven development

Someone found a bug?

Write a test that reproduces it before fixing it!

Page 31: Testing, CI and CD in the real world

extra point 2: EDD? error-driven development

this happens at

Page 32: Testing, CI and CD in the real world

continous * introducing

Page 33: Testing, CI and CD in the real world

continous integration

continous delivery

Page 34: Testing, CI and CD in the real world

we started with continous integration to

fail fast

this happens at

quit smoking with your phone

Page 35: Testing, CI and CD in the real world

we started with continous integration to

fail fast

this happens at

quit smoking with your phone

Page 36: Testing, CI and CD in the real world

we started with continous integration to

maintain code quality

this happens at

Page 37: Testing, CI and CD in the real world

we started with continous integration to

maintain code quality

this happens at

Page 38: Testing, CI and CD in the real world

continous integration

continous delivery

Page 39: Testing, CI and CD in the real world

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

Page 40: Testing, CI and CD in the real world

we started with continous delivery to

update stakeholders

the product owners have the last developed feature

in their phones

this happens at

Page 41: Testing, CI and CD in the real world

we started with continous delivery to

launch releases from Terminal

Group of Betatesters Alpha Release

this happens at

Page 42: Testing, CI and CD in the real world
Page 43: Testing, CI and CD in the real world
Page 44: Testing, CI and CD in the real world

Roc Boronat [email protected]