chapter seven
7 Testing Microservices
This chapter covers
- Understanding the motivation behind testing
- Test strategies like unit testing, integration testing, and end-to-end testing
- Testcontainers usage in test automation
- Calculating and viewing the test Coverage for test suites
- Understanding Test Pyramid
Microservice Architecture encourages you to write minimal services, which means they can be easily testable as a unit. For example, while testing Order Service, the only context you need to focus on is Order. To test Order Service, you have two alternatives in high-level: Manual Testing and Automated Testing.
With manual testing, you must run actual service and dependent services to test the entire flow. As you can guess, it might be a time-consuming operation compared to testing backed by a machine. This inefficient testing methodology will also slow down your software delivery. However, with automated testing, you can get fast feedback from your implementation since you don’t need to wait until you finish and test the entire system.