Sponsored Link •
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.
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?
|Alberto Savoia is founder and CTO at Agitar Software, and he has been life-long agitator and innovator in the area of software development and testing tools and technology. Alberto's software products have won a number of awards including: the JavaOne's Duke Award, Software Development Magazine's Productivity Award, Java Developer Journal's World Class Award, and Java World Editor's Choice Award. His current mission is to make developer unit testing a broadly adopted and standar industry practice rather than a rare exception. Before Agitar, Alberto worked at Google as the engineering executive in charge of the highly successful and profitable ads group. In October 1998, he cofounded and became CTO of Velogic/Keynote (NASD:KEYN), the pioneer and leading innovator in Internet performance and scalability testing. Prior to Velogic, Alberto had 13-year career at Sun Microsystems where his most recent positions were Founder and General Manager of the SunTest business unit, and Director of Software Technology Research at Sun Microsystems Laboratories.|