Test Driven Development
We should try to do Test Driven Development (TDD) when we create our microservices. TDD will not only help us to ensure that our microservices are tested correctly, it will guide the design of our microservices to a better implementation. The overall idea for doing TDD is that you start writing a test first that will fail since there is no code for it yet, this test will be red. Then you move to implement just the minimum code to make the test pass, the test will be green. Then you refactor your code to improve it and rerun the test to check that it is working again, and if not, fix it. You then write another test, for example, to make another change in your code and repeat the cycle as before. These short cycles of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access