Microservices is a popular architectural choice today, and it opens up new possibilities for automated testing. We will look at how you could use Approval testing to:
We will work in small groups to write tests for an example microservice application.
Write sticky notes individually. 1-2-4-all
Change in test strategy compared with a monolithic architecture. Use the additional APIs that you have. Less ‘whole system’ thinking. Test one microservice by itself.
Scenario: You work on a product for hotel bookings. Right now have only a few hotels using it, one instance per hotel. Come to the point we need some automated tests for it. Imagine this service is part of a larger system with other services for hotels.
We’re using my fork of Mark Winteringham’s code.
A Test is when I’m hoping to discover something I don’t know. A Check is when I already know something, and the check will tell me if anything has changed. Write a list of checks you could do on this code. 1-2-4-all.
What could go wrong with this microservice? What could cause it to stop being available and useful? What could work badly and cause problems for users? 1-2-4-all
Match the risk list with the checks list from earlier. Can we think of additional checks now? Can we prioritize our checks?
Note the process we used now to come up with a test strategy for this microservice. Is anything different about it compared with any other kind of application or architecture?
Based on what you already know about approval tests, how would you apply an approval testing approach to this microservice? Discuss in pairs, report findings to group.
What it does, how to use it.
Add test cases for rest api endpoints. Use the prioritized check list you made earlier.
My best efforts are in the ‘with_tests’ branch
If you had a different microservice in a different application, what have you learnt today that you could apply to it?
Have you ever worked with a microservices architecture? Did you have any end-to-end tests?
slides about my experiences and Accelerate research
Using BeeFriendly. Examine the existing test and write another one.
Particularly looking at the use_case.py file. How does this compare with other selenium tests you’ve seen and worked with?
Has this ever been a problem for you?
Slides about my own experiences
Using BeeFriendly. Register for a newsletter and examine the trace with jaeger. Which service is buggy?
What do you think about using distributed tracing as part of the approval test?
Mind map questions