The Freak Parade

Strange noises from the mind of Nathan Stults…
  • rss
  • Home
  • About The Freak Parade

What Lao Tse thinks of TDD

September 22, 2008

Summer is tumbling into fall and apparently it has stirred the technology muses because the last few days seem to have invoked a collective urge to wax philosophical about development practices in the small corner of the blogosphere that I follow. Jimmy Bogard started the ball rolling comparing  TDD to living a more healthy lifestyle, Ayende expressed his understanding of the true, sensitive core of Agile, Kyle Bailey wondered aloud if the ALT.NET horse is pulling too far ahead of the cart, Rod Cottingham of ReadWriteWeb briefly awakened from his Social Media junky trance to wonder if there wasn’t more to life before pushing in the plunger once more and sinking back into the carpet, and the usual band of roaming ALT.NET monks came to the vigorous defense of TDD, which was apparently issued a challenge on the ALT.NET mailing list. All this in addition to the usual, melodious gospel music emanating from Los Techies and CodeBetter.com.

For me, it was quite a treat. In addition to being a rabid technologist, I am also an armchair philosopher, so this kind of material is food for me. I will have more to say about the enormous question so fleetingly put in Rod Cottingham’s post another time, but today I want to think a little bit about the flurry of emotion regarding TDD, because while the passion its practitioners exhibit for the methodology is in itself compelling I don’t feel they are otherwise expressing its true value very effectively to those who I presume they are speaking, which is to say to me, the layman and the novice.

I myself have only just begun to experiment with Test Driven Development in particular and Agile methodologies in general, along with the rest of my small and equally inexperienced team. Speaking from such a demographic, I can confirm that TDD is a difficult discipline to become comfortable with. Speaking from a project management perspective, I can also confirm that starting from standing still getting up to cruising speed with TDD is, at least superficially, expensive from a productivity standpoint. I believe every member of my team is both talented and passionate about the mystical process of creating quality software, but taking up TDD is nevertheless quite challenging.

Even so, our limited and amateurish experience with TDD so far has deeply impressed all of us, so much so that the productivity cost of the learning curve has never once felt like anything but an investment. To wonder whether or not the cost is worth the benefit is perplexing to me, I can’t imagine having that emotion. Maybe I’m spoiled by the talent and passion of my colleagues, maybe if you find yourself alone amongst a crew of 9 - 5 clock punchers the row is much tougher to hoe, but you don’t have to scratch very deep into the surface of TDD to find its extraordinary value, even though it does require constant discipline (which often falters, by the way) to continue using it, at least at the early stages we are in.

What is this great value that outweighs the effort?

Well, there isn’t any point in my spelling out the tangible, objective benefits. That the TDD monks express quite well, and anyway I’m a layman, so I wouldn’t be able to do it effectively in any case. What I find strange, though, is how TDD seems to always be discussed outside of its Agile context - as if it were a side dish you could have with any kind of meal without it losing any of its overall value. Rather, I see TDD as the chorus to the Agile song - it may be beautiful to sing in isolation, but it grew out of, and belongs to, a larger melody, and to really understand its value an experience and understanding of the larger context is of the utmost importance.

The larger context? Iterative, outside in development, of course. Agile is a highly iterative development methodology that focuses first on the need and then on the implementation in short repetitive cycles. It has the potential to transform software development from a giant thought experiment in which we attempt to construct  tightly fitting, complicated wardrobes of clothes for our customers by asking them to describe the shapes of their bodies in perfect detail and list up front every social function they will ever need to attend, to one in which we take small, precise measurements, create one article of clothing at a time, try it on the customer, have them spin in front the mirror, and make adjustments accordingly: to the patterns, to the materials, to our tools and our processes.

The universe itself is rhythmic, cyclical and defined by nothing if not constant change, and so therefore are our lives, our work and the needs of our businesses. Software, unlike other more traditional engineering disciplines that deal with physical space and universal themes, must keep constant pace with the rhythm and change of human activity for it to be useful. Not only that, but the complex needs software aims to serve cannot simply be measured, like a plot of land or the gorge a bridge must cross, it must intersect usefully with myriad human minds rather than relatively predictable physical material, and the human mind is famous for not knowing itself very well.

So Agile attempts to adjust for this by addressing human need in an interactive way - assess the general outline of the need first, build a little something, see how it fits, make adjustments here and there, fill the general shape of the need, add the detail in layers as it is discovered. It brings to my mind an image of a potters wheel - the clay spins always, an iteration at a time, you shape a vessel first with your fingers, relying as much on tactile feedback as you do your logical understanding. Then you apply detail, little by little, and when it is finished you can fire it in the kiln and paint it, but not before. If you build the detail too soon, it will quickly get rubbed away as the true need emerges, or worse, it will remain because you’ve put the thing in the kiln too soon, but it won’t be appropriate to the piece you’re creating, so you cover it up with fresh clay and fire it again, and you end up with something structurally unsound, or ugly, or altogether useless.

What does all this melodrama have to do with TDD? TDD is your fingers in the clay. Code is clay, after all, not gears and pistons and fittings, it has constraints, of course, but is largely pliable imagination. TDD is what finds an ideal shape for the code that is elegant, appropriate and capable of realizing the emerging and actual (not theoretical) needs of your customers as they are incrementally uncovered by the larger Agile process. TDD feels out, does not deduce via thought experiment, an appropriate API. This has been my takeaway from our limited experiments with the methodology, at any rate. TDD as the smallest possible step, the smallest possible rhythm, red-green-refactor, red-green-refactor, you rely predominantly on a sense of practical aesthetic, an ability of the mind to find a natural shape for things, a process that is usually expressed in terms of “reducing friction” by the community of vocal practitioners. Of course this is a logical process too, of course, not just an artistic one, there are general rules and guidelines, it is a strange coupling of mathematics and logic with imagination and creativity and pseudo-tactile feedback. Your mind is clicking along in a scientific way, but a larger part of the brain is enlisted to participate, a part that, as engineers, we too often discount, more than just the cold eye of logic with too little information at its disposal and too high an opinion of itself. In the end its all very Taoist :) The Taoist butcher, as you may know, never has to sharpen his knives because he always cuts his meat precisely along the grain - he isn’t cutting at all, actually, but merely separating the material along its natural seams. TDD aims to find those seams in the seemingly solid material of a programming language as it applied to a complex human problem and the result is often of very high quality, both aesthetically and functionally, and the secret is both qualities are the same quality when approached in this way.

Anyway, that was a lot of grandiose hoo ha, and I’d be surprised if any of you left brained technologists have made it this far. Whether or not I’ve made any sense, my main point is that when practitioners are always saying TDD is about design and not about testing, I think this is in essence what they mean. Even if it isn’t, that distinction - the distinction between “design” and “testing” is tragically under-emphasized, or at least under-explained, and that distinction, in my mind, is the crux of the whole matter, is the first thing that should be said about TDD to anyone who is interested in listening. In that context, the question of “is it worth the cost” is almost nonsensical.

If by some miracle you have read this far, I’d love to hear what you think - what is your understanding of TDD? Or, do I simply need to lay off the hookah?

 

The Butcher

There was once a butcher who was carving a joint of meat for a customer who had been coming for many years.

 

“Pardon me,” the customer asked, “But isn’t that the same knife you had last year? Do you need to sharpen it often?”

“It’s the same knife I’ve had for the last 17 years,” the butcher replied, “And I haven’t had to sharpen it even once. For, when I cut the meat, I allow the knife to find its own way through the flesh without effort or stress.

“And when I come to a tricky bit with lots of cartilage, I just slow down and allow the mystery to solve itself and in no time the meat falls right off the blade.”

If there’s one thing the Taoists love, it’s getting things done without any effort at all

 

Replace “Toaist” with “Programmer” in that last sentence and you have the essence of our industry :)

Comments
Comments
Categories
Agile, Sermons, TDD
Comments rss Comments rss
Trackback Trackback

CrapOverflow? Really? Oooooooook then… (Or, the fallacy of elitism)

September 14, 2008

I noticed an incoming link to this blog today coming from a site called crapoverflow.com, and since I know you’ll never guess it on your own I’ll just come out and tell you that it is a play on the name of the new programming Q + A web site stackoverflow.com (which I posted about a while back ago).

The crapoverflow.com web site seems to be just one page. In addition to the razor sharp wit of the name itself, crapoverflow sports a simply side splitting logo that lampoons the stackoverflow logo by making it look like the “stack” might be “crap” coming out of a toilet. Although my description should be vivid enough to elicit an HD quality image in your minds eye, I’ll paste the sites header into the post for those of you lacking imagination:

logo
Ask programming questions. Get answers… just not good ones.
Stack Overflow is by programmers, for mediocre programmers — regardless of platform, or language.
Jump in and share your lack of software engineering expertise! No accuracy or evidence is required. Ever.

The rest of the page is quotes from blog reviews, like the one from my (mostly positive) write up. All the quotes say something un-complimentary about stackoverflow.com. Before I continue, though, I would like to emphasize a few things: I am not writing this to defend stackoverflow.com from this  odd attack. I have little interest in stackoverflow.com personally and could care less about that  Also, I am not writing this to condemn the utterly juvenile author of crapoverflow.com for being utterly juvenile. Whoever took the time to register a domain name, create a logo and dig up any possible hint of a negative mention of stackoverflow.com was clearly slighted in a personal way by either the community that inhabits stackoverflow.com or Jeff Atwood or Joel Spolskey or a combination thereof. While I am tempted to say “time to grow up you sad, humiliated creature” I kind of think this kind of outlet is preferable to  showing up at the stackoverflow.com offices with a semi-automatic and a backpack full of pipe bombs.

imageSo what is my point? A noble one: I will rise to the defense of the poor, downtrodden mediocrity. The “mediocre programmer” gets a lot of hate mail these  days, and it makes my skin crawl every time I see it. First of all, by definition, most programmers are mediocre. Even if most programmers were capable of hacking into NASA and re-programming the space shuttle to swing through a McDonalds drive through and bring them a happy meal, they would still be mediocre because most programmers must be mediocre, mathematics and the English language are very insistent in that regard. So mathematics and the English language being what they are, when a community develops on the Internet and begins to thrive, and it turns out that this community is made up of mostly *gasp* mediocre programmers, whose business is it to issue condemnations?

Closet Mediocrity

First, I’ve yet to meet the programmer who would classify themselves as mediocre. And yet statistically most of us are in those ranks. That means more than a few mediocre programmers are erroneously counting themselves among the elite. So unless you have some sort of proof (beyond the cajoling whisperings of your own ego) that your light shines brighter than that of the status quo, you better keep your yap shut on the matter.

Community is Community

If you start a Q + A site and the experts don’t show up, should the rest then lay down and die? Or rend their tunics and make sacrificial offerings hoping they will show up after all? If most of us are mediocre by definition, and we get together to help one another out as best we can, who is the victim? Let’s have a thought experiment shall we … let’s say I asked for some help and I received some advice and the advice turned out to be mediocre. Even so, despite its impurity, it helped me through my problem. It wasn’t the way an expert would have solved the problem, to be sure, but the expert never showed up to gift me with her genius, and yet things turned out OK in the end anyway. The solution to my problem, thanks to the mediocre chap that answered my mediocre question, was squarely mediocre. Actually since I myself am mediocre the solution fit in nicely with the rest of my mediocre project. It doesn’t strike terror into my heart to contemplate such a scenario, nor does it make me snigger condescendingly and count my lucky stars I’m not mediocre. It makes me glad such communities exist, because if the elite programmers are too busy writing software to lend a hand they may as well not exist, and yet we must march on, mediocre or not.

Actually, We’re All Mediocre

Whoever you are, you too are mediocre. Even if your genius in matters of programming is unparalleled then in your personal relationships, or your spiritual life, or in the sack, whatever, mediocrity has set a place for you at its table. But let’s reel it in a little and assume you’re not one of the half dozen most brilliant programmers in the world - in that case, I can make you an utterly mediocre programmer no matter who you are just by choosing the set of programmers in which you are to be counted. So mediocrity then is entirely relative, and therefore an illusion. To look down your nose at the man treading water down stream from you is to ignore the countless others who have already passed you by a mile. If the fellow is struggling and it distresses you, lend a hand. If you can’t be bothered, then don’t, he’ll do just fine. But it is vulgar and absurd to shout an insult at him, or to preach to others that its people like him who are keeping us from reaching our full potential.

Is this the part where you say “Amen” and hand out the little crackers?

Sooooo…thats it really. To be fair, the vast majority of people in the programming communites I haunt that I would consider to be “elite” expend vast amounts of effort feeding the community the fruits of their knowledge and insight, and usually with a reasonable amount of humility. It’s even a little awe inspiring sometimes. It is usually the false-prophet, the average Joe that fancies himself a rock star, that is likely to make some pointless attack on the imaginary ranks of the mediocre (what I like to call  “spitting on Mort”). Even so, each time someone does this it leaks a little poison in the water supply we all depend on for survival, even though it is almost always unintentional. So if I had a particular point, I guess it would be to try to keep a few things in mind, especially when you feel the urge to jump onto a soap box and start talking down to people:

1. We’re all doing the best we can. Really. What else could we do?

2. Everybody has a right to lend a helping hand, to ask for help, to discuss a technology, to offer an opinion, to participate. If we all had to be experts and 100% sure of what we say in order to participate in the community you’d hear nothing but crickets, I guarantee it. If you encounter an error someone has made through inexperience, be generous and correct it, don’t complain about it, it makes you look ugly and as a result you won’t get laid without having to pay for it.

3. However smart you may be you’re a bumbling idiot compared to someone. Just keep that in mind and not only will you be more pleasant to be around but you’ll be more useful to the world and you’ll learn faster as well.

image

Amen. Here is the body, and here is the blood. See you next Sunday.

Comments
Comments
Categories
Sermons
Comments rss Comments rss
Trackback Trackback

A Response to "On Passion"

September 6, 2008

Jimmy Bogard recently gave an interesting sermon on the topic of passion in software development. I always enjoy posts like this. While I love the technical insights that flow like a river from the software development community, there is an under-served but very real need to pan out from time to time and reflect on the larger experience.

Software developers are an interesting breed - on the one hand we are technicians and engineers, a left-brained, puzzle solving people, and yet the medium in which we work is almost pure imagination. We sculpt more than we build, and yet we focus so intently on the mechanics and the techniques that I think we have a tendency to de-emphasize the broader creative process and the very human aspects of what we are really doing all day with these wonderful machines. So a discussion of passion, and particularly an encouragement to extend our passion beyond the realm of simply solving interesting logical puzzles, is refreshing and needed.

In his post Jimmy calls out the tendency of software developers to practice in an unbalanced way, to practice in a way that is obsessively, even selfishly focused on the self-gratifying enjoyment of technology for its own sake. If we were a self contained community of artists then it would be alright for us to practice in such a narrow minded way, we could revel in our technology with reckless abandon. But of course that is not the case. As a profession we are simply an organ in a much larger organism and we depend on the health and prosperity of the organism for our survival as much as it depends on us, despite our legendary hubris.

Observing this, Jimmy suggests that our ultimate success relies on our being as passionate about the domains we serve as we are about the software itself. He separates passion for “our craft” from passion for “the domain.” While I wholeheartedly agree with the underlying principal of what he is saying, I think his separating “the domain” from “the craft” and demanding software developers apply passion in equal measures to both does a great disservice to “the craft” and would be impossible to achieve for most of us in any event.

Any programmer reading Jimmy’s blog probably has little if any passion to spare. Software practitioners of an ilk that read blogs like those found at Los Techies are not looking for new outlets through which to direct our energies; we are already giving all we can (and often more) to “our craft.” Asking us to become passionate about the domains we serve is like asking someone running a marathon to pull a rickshaw full of tourists while they’re at it. Is it possible? Maybe. But it’s also absurd.

However, I certainly don’t think it is healthy, sustainable or ethical for us to fornicate with our technology at the expense of our patrons. I agree with Jimmy that such an approach to software development cannot end in success. I do, however, believe that a more appropriate mental framework would be to expand the scope of what we mean by “our craft” instead of relegating “our craft” to the realm of technology and layering on the additional responsibility of “the domain.” Most of us cannot be passionate about “the domain” anyway - if we could, we would have different careers. But we can, and we should, be passionate about shaping software that best contributes to the health and prosperity of the businesses in which we operate. This may seem similar to being passionate about “the domain”, but it is not at all the same thing. We should be passionate about our domain, but our domain is not technology any more than an artists domain is paint. An artist obsessed with paint may create some very beautiful colors, but uninteresting paintings. No, our domain is software, and software is about nothing if it isn’t about people. So we do have to understand the domains we serve through and through, we do have to place the user experience above technological self-gratification, but we should not dilute our passion by attempting to extend it beyond creating delightful, functional software.

In the end I think Mr. Bogard and I are saying the same thing - I don’t think he actually meant to suggest that we truly become passionate about, say, medical billing or real time currency trading, or whatever world you happen to be working in, but that we become passionate not just about technology but also (and predominantly) about sculpting software systems that enable those that are passionate about those things to achieve ever increasing levels performance and creativity. And I couldn’t agree more.

Comments
Comments
Categories
Sermons
Comments rss Comments rss
Trackback Trackback

Subscribe

Calendar

January 2009
M T W T F S S
« Nov    
 1234
567891011
12131415161718
19202122232425
262728293031  

Recent Posts

  • You Can’t Fill an Imaginary Hole
  • I don’t know but I’ve been told, ETL is gettin’ mighty old. BAM! BAM! EDA! I want my data right away!
  • Be Prepared To Be Surprised
  • Google Chrome, I could kiss you! (Or, multi-process browsers are a really good idea)
  • New Open Source .NET CMS/EPS Platform Released Today: Sense/Net 6.0 Beta 1

Recent Comments

  • Ashwani on Rule Based Access Control using an Expression Evaluator
  • Richers Blog on Identity’s new Identity - Part 3, The Technology
  • sandra on ESB’s for the Microsoft (.NET) Platform
  • nstults on Content Management Systems (CMS) for the .NET Platform
  • Adz on Content Management Systems (CMS) for the .NET Platform

Tags

TDD Testing

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox