Some developers are easily test-infected - they take to unit testing like a duck to water. Others need some time and encouragement, but eventually "get it". A third group appears to have immunity to test infection. I invent a test-gene model to categorize these groups and look at its implications for the future of developer/unit testing.
Developer testing is the simple, but logical, idea that developers should take responsibility for playing an active role in testing their own code. We are nearing the 10th anniversary of JUnit - the unit testing framework that kick-started the developer testing revolution. But, despite its obvious benefits and broad agreement that "it's the right thing to do", developer testing is still only practiced by a minority of developers in a minority of organizations.
I gave talks on JUnit and the developer testing revolution at two JavaOne conferences (2004 and 2006) where I talked about the three possible outcomes for the future of developer/unit testing:
Long-Term Defeat: The idea of developer testing was a noble, notable, but ultimately short-lived blip in the history of software development. Almost all developers went back to the old way of thinking: testing is for QA.
Minor Victory: Developer testing does not disappear, but it remains a niche activity. Practiced only by a devout minority of test-infected developers.
Major Victory: Developer testing becomes a standard software development practice. The rule, instead of the exception. Releasing software without unit/developer testing is as unthinkable as releasing software without QA.
I am rooting, of course, for the major victory, but I am starting to have my doubts, and wondering why progress is so slow. Below is my analysis of what I believe is happening and I'd be very interested in your opinion.
The Developer Testing Gene
In the past few years, I've noticed that some developers are easily "test-infected", others require longer exposure and some encouragement but eventually "get it" , and one group seems to have a built-in immunity.
It's as if there are 3 basic types of test genes:
T1 - Very susceptible to test infection. Show them a single JUnit example and they get it immediately - and start using it regularly and with great fervor. When time pressure hits, they fight hard for enough time to test and would rather quit than produce code without tests. They often have framed pictures of Kent Beck on their desk :-).
T2 - Somewhat susceptible to test infection. Show them how to use JUnit/TDD, give them some encouragement and time to appreciate the benefits and rewards; eventually they will become regular users. When time pressure hits, however, they often revert to no-test mode without too much kicking and screaming.
T3 - Immune to test infection. There's no amount of showing and convincing that will get them to practice developer testing on their own with any regularity - if at all. Many of them would rather quit than have to write tests on a regular basis.
I would love to be able to say that these genes are somewhat evenly distributed. A rough Gaussian distribution. Something like this:
T1: 30% T2: 40% T3: 30%
But my experience is that developers with the T3 gene outnumber the combined number of those with T2 and T1 gene.
This spells trouble because I have also found that when developers become managers they bring with them their attitudes toward developer testing. And a T3 manager is not going to provide an environment where the T2 (the ones that require some time and encouragement) can become test infected. And this might explain why developer testing is still practiced by a minority of developers in a minority of organizations.
What do you think? Am I too pessimistic? Is predisposition to testing more a matter or nature or nurture?
Posted by Alberto Savoia at January 26, 2007 09:59 AM
TrackBack URL for this entry:
I found myself reversing the roles and
"rereading" this articles as "Tester Developer"
where "unit testing" turned into coding (automating). Still deciding on what to use for the tester's "Junit" ;>) -- too many choices. Think the article would still ring true.
Posted by: Al Snow on January 26, 2007 06:37 PM
Maybe there is a fourth gene:
T4-Testing vouyers. They love to read good articles about TDD, refactoring, etc. but they don't put the whole thing into practice. They always plan to start doing TDD in the next software project but they are too much lazy or they still don't have enough courage to kick it off.
You could name T1 of "Testing freaks", T2 of "Testing pragmatics" and T3 of "Testing Immunes".
Posted by: Thiago Delgado Pinto on January 31, 2007 10:51 PM