In the world of agile software development, it's critical to have unit tests and it's a well accepted practice to develop software test first. You write a unit test, make it fail, then write the code to make the test pass, refactor the code to make it simple, then write another unit test.
One aspect of testing that's often overlooked, however, is acceptance tests. Where unit tests verify that the software works like the developer intended it to, acceptance tests verify that the software does what the users need it to do. Ideally, these tests would be written by the users or the users' representative. They cover the software from the point of view of the user's interaction and tend to be more complete tests of the entire system than tests of one particular area. I've found that on legacy systems in the absence of any automated tests, writing acceptance tests of the system can provide a much bigger bang for your buck than trying to write unit tests for it.Download