01 October 2012

Testing your own code

There is a different mindset in programming and testing, as a programmer you want your code to work while as a tester you want to discover in what ways the code is not working. Sounds sane, right? Well, I'm starting to believe this is not necessarily true.

Lately I've been developing a lot in PHP. At one point I thought about the starting statement of this post and realized it might not really apply. I'd noticed I was just as thorough when testing my own code as any other's code, and not only that, I even cared more that my work was functioning well than "I feel I generally care when testing some random product". Why? Shouldn't I simply look at parts and say: "Well, I know that is working so no testing required there"?

Soon after a programmer at my work said something that got me thinking. To give you a quick background, he's a really great programmer that has excelled quite a lot lately in testing as well. Anyway, he was testing his latest work on quite a high functional level, far away from his usual domain. When we talked about testing in general he said: "I really love this testing business! Code is the one thing I produce and when I hand it over I want it to be as awesome as it can be".

That made me realize something important: "I assume people using what I've programmed will judge me personally for it's function and therefore I want it to be as well functioning as humanly possible in the time given to produce it". So rather than "wanting it to work" I "wanted to make sure I found every significant bug there is".

Of course this is just two observations, I know you find what you want to find and I'm aware my first statement often reads as "you should not be the only one to test your code", and I'm not challenging that. But I do think it's an interesting point of view. I believe if you can make every programmer on your team thinking: "I take personal pride in my code working as good as it can in the time given" and combine that with an awareness of test, I think your job as a tester would be a lot simpler.

No comments:

Post a Comment