Arquitecturas de microservicios se han adoptado cada vez más por la industria y es, cada día más, una realidad en LATAM.
La capacidad de implementar componentes desacoplados alrededor de un contexto de negócio bien definido, mantener y paralelizar sus desarrollos en varios equipos autónomos son sólo algunos de los beneficios responsables de esta adopción.
Sin embargo, este tipo de arquitectura presenta desafíos a estrategias de pruebas convencionales, principalmente debido a los diferentes puntos de integración existentes.
En esta charla vamos a discutir diferentes estrategias de pruebas para hacer frente a estos desafíos, siempre tratando de contextualizar con nuestras peculiaridades en LATAM
24. 17
TEST AUTOMATION
CLOSER TO
THE USER
CLOSER TO
THE DEVELOPER
$$$
SLOWER / FEWER
$
FASTER / MORE
USER
JOURNEY
UI
INTEGRATION
UNIT
Connection of UI tests to a persona like flow through the system
Testing on the level of the users - incl. browser, network, databases, external systems, …
Tests of multiple integrated method
Tests of single methods without dependencies
27. ANATOMY OF A MICROSERVICE
20http://martinfowler.com/articles/microservice-testing/
28. UNIT TESTING MICROSERVICES
21
Domain - We should focus on
testing the behavior, observing
changes on its state.
Gateways, Resources and
Persistence - We should focus
on the interactions and
collaboration (Mocks, test
doubles)
http://martinfowler.com/articles/microservice-testing/
29. INTEGRATION TESTS - PERSISTENCE E GATEWAYS
22http://martinfowler.com/articles/microservice-testing/
30. COMPONENT TESTS - IN PROCESS
23http://martinfowler.com/articles/microservice-testing/
31. COMPONENT TESTS - OUT OF PROCESS
24http://martinfowler.com/articles/microservice-testing/
32. COMPONENT TESTS - HOW TO SIMULATE EXTERNAL SERVICES?
25
Mock your APIs for fast,
robust and comprehensive
testing
mountebank - over the wire
test doubles
42. COMPONENT TESTS - PROBLEMS WITH STUBS
27
Your application Stub / Imposter
Test
43. COMPONENT TESTS - PROBLEMS WITH STUBS
27
Service
constantly
evolving
Your application Stub / Imposter
Test
44. COMPONENT TESTS - PROBLEMS WITH STUBS
27
Service
constantly
evolving
Your application Stub / Imposter
Test
45. COMPONENT TESTS - PROBLEMS WITH STUBS
27
Service
constantly
evolving
Your application Stub / Imposter
Test
Becomes
invalid!
46. COMPONENT TESTS - PROBLEMS WITH STUBS
27
Service
constantly
evolving
Your application Stub / Imposter
Test
Becomes
invalid!
47. COMPONENT TESTS - PROBLEMS WITH STUBS
27
Service
constantly
evolving
BECOMES
INVALID!
Your application Stub / Imposter
Test
Becomes
invalid!
48. COMPONENT TESTS - PROBLEMS WITH STUBS
27
Service
constantly
evolving
BECOMES
INVALID!
Your application Stub / Imposter
Test
Becomes
invalid!
49. COMPONENT TESTS - PROBLEMS WITH STUBS
27
Service
constantly
evolving
BECOMES
INVALID!
Your application Stub / Imposter
Test
Becomes
invalid!
50. COMPONENT TESTS - PROBLEMS WITH STUBS
27
Service
constantly
evolving
BECOMES
INVALID!
Your application Stub / Imposter
Test
Becomes
invalid!
51. COMPONENT TESTS - PROBLEMS WITH STUBS
27
Service
constantly
evolving
BECOMES
INVALID!
Your application Stub / Imposter
Test
Becomes
invalid!
52. COMPONENT TESTS - PROBLEMS WITH STUBS
27
Service
constantly
evolving
How frequently do you change your stubs?
BECOMES
INVALID!
Your application Stub / Imposter
Test
Becomes
invalid!
102. MEAN TIME TO RECOVER
39
Tests are very important to reduce the amount of
defects in our systems. However, it's important to
acknowledge that bugs will always happen in
production.
How fast we can recover from them will help
determining our success!