Writing test cases before development
In this book, we started developing a simple service in Chapter 2, Writing Your First Cloud-Native Application, in Spring Boot to get you excited about cloud development. However, real development follows a different style of best practice.
TDD
A project starts with understanding the requirements and writing test cases that validate the requirements. Since the code does not exist at this point, the test case will fail. Then, the code is written that passes the test case. This process iterates till the test cases and the required code are complete to realize the business functionality. Kent Beck has an excellent book on this subject, Test Driven Development by Example. In the next section, we will redo the product service from Chapter 4, Extending Your Cloud-Native Application, using the principles in this chapter. But before that, let's look at another important concept, BDD.
BDD
Taking a leaf out of Agile development principles and user stories, BDD encourages...