Writing tests before code sounds silly doesn't it? I'm going to show you how it can be useful!
Test driven development is the practice of writing a failing test (unit or functional or whatever..) before writing the code that will make the test pass. It gives you a goal to work at, and forces you to think about how accessible your code is. It can also be used to gain confidence within your codebase.