I am renowned for not testing my code to death. Cause it worked before I assume it will work again
Not so just recently. In tiny, I changed my code so that user’s Id’s were guids instead of ints, as I saved the id in a cookie, by having it as a guid would be much more secure – people can’t just go around changing cookie values and getting into other accounts now
I tested every piece of functionality in the site bar one – Register! So last night I got a bunch of errors come through from people trying to register and they couldn’t. It’s working now…hopefully. I am going to spend some time today building up testing scripts, as relying on me checking each page is not reliable!!
Yes I know someone will respond and say “Blah blah blah set up unit tests blah blah blah” but the problem I have with unit tests is they take sooooo much more time to build. You have to think up the test case, build it, test the test case, and then at the end of the day your tests are only as good as the person writing the tests. I have never done real unit testing. I have never needed to. The code that I use has been tried and tested over the last 5 years. It’s good code. This one error today was because of a type change. Yes unit tests would have instantly picked that up, but I would have spent hours of coding to find that one tiny bug, which was picked up by the error handling I have in place, and fixed in matter of moments!
I just have this belief that people should stop harping on about unit tests, especially for small systems. If I was developing a large banking systems, which all unit test demos seem to think we only ever build, then yes unit test your cotton socks off!
However that said, I will be starting to use Selenium more and more. A great plug in for FireFox that allows you to script different actions in a very unit test kind of way, but using the UI of your application rather than the low end code.
Anyways I need a drink, can’t sleep as you can tell by the stupid time of this post!





Leave a comment