This is a post that has been a while in the making because I can't seem to quite get it right.? It is essentially the basis behind my recent post The Danger of Bad Tests, so I figured that now is the time.? Developers make bad testers.
There I said it.? Everyone knows it.? Some people even talk about it.? But somehow we still manage to ignore it.? Writing code does not qualify you to test code, in the same way that testing code does not qualify you to write it.? This does not mean that developers should never have to test, nor that all testers should be exempt from writing code.? Instead it means that it is time to stop pretending that we can save money by pressing developers into double duty.
A lot of times developers make bad testers simply because they don't want to test.? This is the same reason that no one wants to work on maintenance projects consisting of mostly bug fixes.? All developers want to be making the cool new feature, not reading someone else's code to figure out why it is broken or running through ten different variations of the same function to make sure it can handle all the edge cases.? So, they do the bare minimum they need to do to get by and still be able to claim that a feature was tested, and then they return to the more interesting work of writing new code.
Of course, not all developers are seeking to simply scrape by.? There are a number that genuinely want to release quality software, and they make sincere attempts to test new features to ensure they work.? The problem is that developers know how the code should work, and test to make sure that it works the way they think it should.? They continue refining their code until they achieve their desired result, then they try to hit a couple of outlier cases and claim completion.? Only a few times have I ever encountered a situation where someone knowingly claimed a feature was complete when it wasn't (and this was always due to management plans that set an arbitrary code-complete date and then allowed for as much bug-fixing and testing as needed – a horrible plan that simply encouraged the developers to submit sloppy code and then fix it during the much longer testing and bug-fixing phase).
Finally, most developers become very attached to the feature as they wrote it.? They simply don't conceive of a way in which someone could use their feature in a wrong or unexpected way, so it doesn't occur to them to test those cases.? It doesn't occur to them to test what happens when you try to save a large file to an external drive and yank out the cord halfway through it.? Not because they are dumb or otherwise unimaginative, but because they already know that if you pull the external drive out while a file is saving, the file will not get saved.? Since you are trying to save the file, there is no reason to disconnect the hard drive until you are done.? Developers will argue for hours about whether something is a bug or a user error because if it is a bug, it implies there is something wrong with their code.? So when they test, they assume a perfect user, because a perfect user would never do something as dumb as disconnect a hard drive during a save.? Unfortunately, we all know the perfect user does not exist, but somehow the myth persists on.?
Just like the mythical developer as tester.