Test Driven Development(TDD) is a practice where developers write new code if their automated test has failed. TDD aims at making the code simpler, clearer and bug-free. It starts with designing and developing tests for small functionality of the application.
In the normal Software Testing process, we first generate the code and then test. Tests might fail since tests are developed even before the development. In order to pass the test, the development team has to develop and refactors the code. Refactoring a code means changing some code without affecting its behavior.