I was exploring TDD, specifically the Outside-In TDD pattern, where we need to write the acceptance (integration) test and then jump on to granular unit tests to implement the feature and make the acceptance test pass at the end.
This all looks good with a monolithic application where all the logic for the feature resides in a single codebase. But how do we implement an Outside-In TDD pattern with Micro-services and Micro-frontends, where a single feature can span across several Micro-services?
Consider the following scenario/feature:
- We have 3 Micro-services and 1 Frontend
- Micro-service[A]
- Micro-service[B]
- Micro-service[C]
- Frontend contains a form that needs to be filled by the user and when the user submits the form, the details are sent to Micro-service[A] to be persisted in the database.
- Micro-service[A] internally calls Micro-service[B] for some operations and further Micro-service[B] calls Micro-service[C] for some other operations.
- Once these operations are done, Micro-service[A] finally persists the data in the database and then triggers an email to the user for confirmation.
How can we follow the Outside-In TDD approach in this case for this feature? Is it even possible in this case?