On Testing
A recent thread on the cgi-app mailing list discussed testing that is really worth noting.
The key statement came from Jason Purdy when he said:
My advice would be to factor your code such that the code is separated into a testable module.
I admit to being slow to developing tests for my work once I did I came to realize that this statement above to be very true. Once writing tests where introduce in to my development process it changed how I wrote the code, not only to make writing tests easier and more thorough, but for the betterment of the code.
I’ve yet to break the habit of writing code and then the tests. (Testing advocates suggest you write tests upfront.) This one has been harder for me because often start from existing code, experimenting and capturing ideas that slowly gets molded into working code. On a few occasions I had a written a piece of code before I realized I was doing it.
I’m strange though and this is not an argument or excuse to follow good form.
[Read more →]
