A while back during a presentation on unit tests a member of the audience asked me a question I hope never to answer ever again - “So these unit tests you’re talking about, are they written by developers?”
The reason I don’t particularly care for that question is that developers think that unit tests (and tests in general) are a part of the tester’s work (hence the name). Just because TDD (Test Driven Development) has the word test in it doesn’t mean it is a form of testing, in fact is a development methodology which means that it should be practiced by developers to create code.
It’s not that unit tests cannot be written by testers, in fact I’ve worked on a project where some of the unit tests were written by the QA team with very limited success - because the QA team didn’t know the code I wrote as good as it was difficult to produce good unit tests.
So why should testers care about unit tests? Some think that tester’s role will become obsolete if we’ll write enough automatic tests, both unit tests and integration/acceptance tests – I say that’s just wrong. Even if an application can be 100% tested using automatic tests there is no way in hell that the developer that wrote the code will be able to come up with all of the scenarios in which his code can fail. Us developer are too attached to our code, and testing our application for flaws is almost impossible emotionally.
So the tester’s job is safe. But should he care about what the crazy dev guys are up to? absolutely!
Because when a developer take the time to unit test his code it means that the tester receives a better product to test.
I cringe when I remember what a crappy code I used to ship to QA – some of it was so low quality that it didn’t even run. Nowadays this doesn’t happen, I do get a bug reported from time to time but it’s usually not a “stupid bug” because I made sure that my code worked before it left my machine.
Unit tests proved that my code can run and do most of what it suppose to do so that the tester can concentrate in finding bugs instead of checking that that my code passes basic sanity.
So if you’re a tester get the dev team to TDD so you’ll be able to do real work instead babysit code the developer was too lazy to run even once…
Interview: James Bach – The role of the tester (Five Whys)
Labels: Agile, TDD, Thoughts, Unit tests