testing, ci and cd in the real world
TRANSCRIPT
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]