Skip to main content

Can Programmers Test?

I spend a lot of time working closely with programmers on the software testing process. Much of my career mission is to get more people embracing techniques like Test Driven Development. As I push more and more of the testing demands onto the developers I sometimes run into people who say they need a tester for "independent testing".



It's a concept I'm familiar with from early days in my career. A tester can look at the system and requirements with fresh eyes and find all those cases the programmer didn't consider. If the programmer does all the testing they'll be too tempted to just test the cases they know the code is handling and not discover any new areas where bugs may be hiding. The problem I have with this idea is I never was that type of programmer.

As a programmer if I didn't test something it was purely out of laziness and arrogance. I'm a big supporter of Larry Wall's three great virtues of a programmer. A lazy programmer will do their best to eliminate bugs as early as possible to save time. But if the programmer knows someone else will spend a lot of time looking for bugs then why should he bother? Just chuck it to the test team as soon as possible for all that information. It takes either removing that test team or a higher level of discipline to break that pattern. The independent tester is not catching bugs the programmer would not have found himself. They're spending a lot of time documenting bugs the programmer couldn't be bothered finding himself.

The comparison I like to make is a writer and an editor. As a writer you need to stay focused and complete your work before you get to thinking about editing. Then you edit it. You edit it multiple times constantly revising your work until you think it's fantastic. Only at that point do you hand it over to a professional editor. I'd like to see programmers all do the same thing. You can do testing. You should do testing. You should test until you feel there are no bugs left to find. Then hand it to a tester and maybe they'll find one or two things.

Testers are not all that independent anyway. They're reading the same requirements as the programmer. They're under similar deadlines and goals to get the product out the door. Any argument that says a programmer would avoid testing something could just as equally be applied to a tester. The reality is it doesn't happen because we're professionals and understand the need for a quality product. There's no reason the demand for quality should be solely the responsibility of the tester.

What is required to get programmers more testing is education. They're not often taught about testing methods or the kind of data that makes for good tests. That alone would add great value to the tests they can quickly perform before handing over a product. But there also needs to be a shift away from the thinking that a programmers time is too valuable to perform testing. If the programmer finds the errors they can quickly fix them before moving onto their next task. The longer it takes before the bug is found the longer it takes for a fix to apply as the programmer has to open up old code, go through any required reviews again, and finally get the fix out for re-testing.

So I strongly believe programmers can and should test. But how do I get that message across to everyone?

Comments

Popular posts from this blog

RestFixture

So most of the tests I'm writing now in Fitnesse are using RestFixture . Being able to do all this black box style testing has helped me get a lot of tests up and running without having to change the existing code base. Now I've taken a step future with my own little fork  so I can use scenarios and build nice BDD style scripts. But first I want to give me own quick guide to using RestFixture Step 1: Installing You can dive straight in by grabbing the latest jar files for RestFixture here  https://github.com/smartrics/RestFixture/downloads If you know what you're doing can get the nodep version to work nicely along side other libraries you may be including in Fitnesse. But I grabbed the 'full' version and unzipped it into a RestFixture folder alongside my FitNesseRoot folder. Step 2: Write your first test I took advantage of the built in Fitnesse api as a basic test and wrote a page called RestFixture with the following contents !define TEST_SYSTEM {slim} !

A brief introduction

And then I'll get into my first rant. I'm some guy who thinks about stuff. Stuff you probably don't care about but I'm going to tell you anyway! Now I don't think I'm going to cure cancer or create world peace but it'd be nice if I could make the world a little better. Stuff I'd like to talk about will focus on: Games I've always been a game player and am fascinated in how one designs a game. Yes it's mostly computer games these days and even then it's mostly consumed by World of Warcraft . Shut-up you in the back! We all have our vices and I'll avoid sniggering at your hentai collection if you leave my level 80 mage alone. Programming Only 2 years ago I was introduced to this weird concept of Test Driven Developmen t and the broader concept of Agile . Programming has been part of my life since I was eight. When I haven't been doing it professionally I've found myself doing it more in my free time. So it's nice that after 20+