Test-driven development starts with developing test for each one of the features. The test might fail as the tests are developed even before the development. Development team then develops and refactors the code to pass the test.
Test-driven development is related to the test-first programming evolved as part of extreme programming concepts.
Add a Test
Run all tests and see if the new one fails
Write some code
Run tests and Refactor code
Repeat
Valid inputs
Invalid inputs
Errors, exceptions, and events
Boundary conditions
Everything that might break
Much less debug time
Code proven to meet requirements
Tests become Safety Net
Near zero defects
Shorter development cycles