Testing Code: 3 reasons why you should do what I once thought was pointless.
I was once a very naive programmer. I thought that testing code was for people who wrote bad code, and that tests were dumb because the time spent writing them was time that could be spent building new features, thinking up ideas, doing browser compatibility, etc., but then I went to work on a project that actually has users. I can now say first hand that two things are certain:
Developing on a codebase you didn't build yourself, for a platform with over 100,000 users, is absolutely terrifying.
If you crash a server by releasing bugs and you don't have tests, you will have explaining to do.
Tests are really cool for a number of reasons. First off, you begin to know your code. When you have to think about how to write a test case that is going to accurately measure the success of user interaction, you will begin to think about your code in ways that you didn't know were possible. You will have a broader understanding of how the system works, especially if your working on a system you didn't build.
The second reason I think you should test code, is that you (almost guaranteed) will find bugs you didn't know existed. There are only so many times you can click through your own website before you get tunnel vision, fall asleep at the wheel, forget something basic, and make a mistake that breaks the feature that you coded three months ago. We've all been there, and it sucks to realize after the fact.
The final reason I think code should be backed by tests is, if you want your code to be collaborated by other developers, you will need to have some way for them to validate their collaboration. This is a big leap in software development, and if more than one developer is working on something, than theres a good chance it's fairly important. Don't look like a jabroni, back your code.
Don't get me wrong, tests aren't everything, and obviously you will hit a diminishing point of return on the effectiveness of your ability to find/eliminate bugs at a certain point, but having some basic guidelines for components that need to work is important.