Test driven development, or TDD, is a development strategy where you write tests before you write code. Adopting this strategy leads to fewer bugs and a greater confidence in your code. Extending and refactoring your code will be easier and less error prone.
The most common way of writing TDD is by writing failing unit tests while you code, supplying with integration tests, end to end tests and other tests as needed.