TDD helps you to pay attention to the right issues at the right time so you can make your designs cleaner, you can refine your designs as you learn. TDD enables you to gain confidence in the code over time.
In this chapter, we will show how to develop safe, flexible applications using test-driven development (TDD): a technique that can greatly increase development speed and eliminate much of the debugging nightmare--all with the help of JUnit 5 and its features. We will point out the main concepts involved in TDD and apply them in developing a Java application that Tested Data Systems (our example company) will use to implement the business logic for managing flights and passengers and following a set of policies. Our focus will be on clearly explaining TDD and proving its benefits by demonstrating how to put it in practice, step by step.