This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I belong to a group of six Java developers, mostly working on Servlets and JSPs. One other group member and I are interested in adopting XP as a methodology, but are getting resistance from the other members. They are afraid of pair-programming and put off by "writing all those tests." Does anyone have suggestions on trying to get these folks interested enough to try XP? Or should we just give up? Thanks
My answer to this is largely the same as my answer to convincing management. Show, don't tell. Write your own code test-first. Refactor to make code better. Plan your work using stories and cards. Be open about sharing code and discuss designs with your team members. Just don't call it anything fancy. When your colleagues see that your code is finished more quickly, does what the customer wants, and has hardly any "bugs", they won't be able to help themselves but be interested. If applying these principles doesn't help YOU produce better code, faster, then you haven't really any right to force it on your colleagues, anyway.
Servlets and JSPs are often considered difficult to test and on the other hand, shouldn't contain much stuff critical enough to be thoroughly unit tested. Fortunately, developers seem to be easier to "convert" into using XP. A good start would be to place some XP articles around the coffee room and maybe try to arrange a kind of "brown bag session" by gathering (with lunch, the brown bags) the developers into a negotiation room and host an info brief about agile processes. You could also consider starting without the test-first part as it's often the most intimidating of the XP practices... Another seemingly good approach for gaining root-level acceptance was mentioned by Frank Carver in another thread.
Damn. I hate it when someone posts while I type... [ May 14, 2003: Message edited by: Lasse Koskela ]
The most effective way to get others to write tests is to help them write their tests. When someone asks me for help, I ask them to explain the problem and present a solution using a test. This helps them to starting thinking about why something is failing, how to reproduce the problem, and ultimately fix it. This approach works very well with programmers that have never written a test (or are novice programmers) because they have me, a seasoned programmer, to help them get through it. I now see programmers who used to fight the urge to write tests encouraging others to write them, too. Once testing is in you, it's hard to get it out.
Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0596003870/ref=jranch-20" target="_blank" rel="nofollow">Java Extreme Programming Cookbook</a>