"Test-driven design (TDD) is a development technique where you must first write a test that fails before you write new functional code.[...]TDD does not replace traditional testing, instead it defines a proven way to ensure effective unit testing. A side effect of TDD is that the resulting tests are working examples for invoking the code, thereby providing a working specification for the code. - Ambler"
Scott Ambler has a thorough article on Test-Driven Development that explains the methodology. If you're curious on the subject, I recommend reading it: