DEV Community


Discussion on: Ask me to write about anything.

jorinvo profile image

Hi Bertil, not sure if you are interested in this, but I would love to hear more people speak about testing software.
In particular I am lately thinking a lot about testing of systems in a time that everyone want to build micro services.
We can write unit and integration tests to ensure that each service works, but what approaches do people take to ensure their system is working as a whole? How do you create tests that have to deal with potentially hundreds of separate services at once? Do people run automated tests for this or do they spend a lot on QA in a dedicated staging environment?

bertilmuth profile image
Bertil Muth Author

Others have written quite extensively about this topic. One popular way to test microservices is by Consumer Driven Contract Tests. The basic idea is that when you test a microservice X, you make all the behavior expected by consumers of X part of X's test suite.
Look here for details:

Another thing to keep in mind is: for a microservice approach to work, you need technical excellence in operations. That's why Netflix for example pioneered their "Chaos Monkey" that randomly terminates services in production (in order to check how resiluent the whole system is). Look here:

Hope that helps.

jorinvo profile image

Thanks, that article on Consumer Driven Contract Tests looks interesting! I put it on my list!
Chaos Monkey is definitely a good tool to test and harden your production system.
I still think there is room for more material in that space. There are just too many aspects that matter for ensuring a complex system is working properly.
I really like this article talking about staging environments and yet I think there needs to be more material and examples about setting up automated tests in an as realistic as possible staging env.
Testing in production is another big topic. There are many thing you can do around A/B and split testing. There are great tools like GitHub's scientist, that solve specific use cases and of course there is a lot to say about monitoring and observability.