Note: This blog is no longer active. Please visit Jeff's current blog instead. Unfortunately, any new comments entered cannot be retained or displayed. If you feel strongly about a blog entry, please contact us.
I try to keep up with all of the various agile "Yahoo! Group" lists: extremeprogramming, scrumdevelopment, refactoring, testdrivendevelopment, agile-testing, and so on. I post once in a while when I see a topic I feel qualified to respond to or that I'm passionate about. Lately I've been getting a lot less value out of these lists, some of which I've been following for ten years.
Many of the lists degrade into passionate statements of position, i.e. advocacy. Inevitably, people get burnt. Tempers flare, people get upset, some stomp their feet, some simply withdraw. I myself have gotten burnt on this same list, feeling that someone (probably not coincidentally, the same person who is withdrawing now) was looking to simply piece apart every single word written to find as much fault as possible with it.
I withdrew completely from that discussion. I've also withdrawn from perhaps a couple other difficult discussions (out of the hundreds I've engaged in over the years). Sometimes it's because I felt the environment was too hostile, and I justified it to myself by thinking that the individuals involved were being immature or offensive or whatever. But that's not courage speaking. I looked back at my most recent example and regretted how I handled it. Withdrawing didn't solve anything.
Sometimes a simple statement, meant to be innocuous by who wrote it, is taken as a stab and affront. We can pout and take our toys and go home, but that's not at all useful or commendable. Courage can help us find a way to face the challenge and learn how to get past the issue. We don't have to agree with everyone or get along with them, but sometimes a sour incident can lead to a valuable relationship.
So how is this at all relevant to anything? Well, if we are to succeed, agile software development requires that we face challenges and not bury them in isolated cubes. Similar clashes occur not only on email lists, but in real life, and we're particularly going to see such clashes more frequently in highly collaborative teams. Conflicts that are not handled properly will detract from a team's ability to deliver. The XP value of courage is still essential to learning how to regularly deliver quality software.
I started reading a very recently published book. I don't want to mention the name of the book, but it is a tome targeted at "application developers." After reading a small number of paragraphs from the book, I had to check my calendar to see whether this was 2009 or 1995.
Some choice sentences from the book that just grabbed me right off the bat:
For me, one of the most illuminating benefits of all this up-front emphasis on design seemed to be realized in the brilliant class diagram for a simple retail banking system. It looks something like:
Employee <|---- Teller <------ Customer
|
|-- Manager
The power of the "real world" comes alive! This ingenious class diagram existed to support building the following code:
static void Main(string[] args)
{
Customer cust = new Customer();
cust.Teller = new Teller();
cust.Deposit();
cust.Withdrawal();
}
Per the author, this code "validates" the design.
I'm speechless. (Well, no, I'm fingerless, or something. There must be a better word for being so flabbergasted that you can't start to type a response.) I could rail on this book to no end, but it would only draw attention to the book (and you'll note that I'm not providing a link to it either).
I've recently participated in a number of after-the-fact code reviews. Developers are supposed to be writing tests first, and are supposed to ask for help when they're not sure how to do so. Here's what it looks like:
C = one unit of time spent coding T = one unit of time spent testing I = " " " " " in an inspection or review meeting R = " " " " " doing rework based on results of review x = " " " " " doing other work CCCC xxxx TTTTT xxx IIIII RRR II
We're obviously in TAD (test-after development) mode here. Pay attention to the right hand side, which roughly indicates: When could this code actually ship?
Note that there are multiple Rs because many people are involved in the review meeting. Also note that there is a little more time spent on testing, and yet the coverage never ends up good enough (rarely more than 75%). And finally, note the rework and re-inspection that must take place.
What the same model looks like with TDD:
TCTCTCTC xxxx IIII xxx RR I
So, a little less time building the right code in the first place, and also means a little less time in rework. It also means a little less time in review meetings, since the tests can help effectively describe whether or not the developer captured the requirements correctly.
With pairing and TDD:
TTCCTTCCTTCC xxxx xxx
I've doubled up the Ts and Cs because there are now two people involved. I'm not even going to claim that pairing developers will produce a better solution faster, even though I've seen this to be the case. Note that this is now the shortest line by far. (It will even accommodate some amount of formal review--much smaller now because it's already been actively reviewed at least once and preferably twice by the pairs building it--and still be shorter than the original process.)
I'm also not accounting for "ramp-up" time wasted. The intervening xxx's in the inspection-based flow means that minds have moved on to other things. When it comes time to review code, or rework it, developers must put their head back around something that they might have done days ago. Particularly without good tests, this can waste considerable time.
I'm in an environment now where test-first is only beginning to take roots. Every day I see ample evidence why test-after is simply a bad, bad idea.
I'm not refactoring, I'm test-driving new code, writing assertions first, yet I get two green bars in a row. Stop! I need to figure out what's going on. The first possibility is that I didn't expect to get green:
There are no doubt other reasons for two greens in a row. No matter, the event should always trigger a need to stop and think about why.
February 2004 March 2004 May 2004 September 2004 October 2004 January 2005 February 2005 September 2005 October 2005 November 2005 December 2005 January 2006 February 2006 March 2006 June 2006 August 2006 January 2007 February 2007 March 2007 April 2007 September 2007 October 2007 November 2007 December 2007 January 2008 February 2008 March 2008 April 2008 May 2008 June 2008 July 2008 August 2008 September 2008 October 2008 November 2008 December 2008 January 2009 February 2009 March 2009 April 2009