"I have a mind like a steel... uh... thingy." Patrick Logan's weblog.

Search This Blog

Monday, November 01, 2004

Designing and Analyzing

Jon Udell on source code analysis writes...

TDD (test-driven development) is one increasingly popular approach to finding bugs.

Analysis is taking things apart. Design is putting things together. The tools described by Jon for automated analysis are fine.

But TDD is an approach for developers putting things together in such a way as they need less analysis later. Jon is misleading readers by putting TDD in the same category as automated analysis. TDD prevents bugs rather than find them.

Where more complex analysis is required today if available at all, the tools for design are improving in such a way as to reduce the amount of subsequent, after-the-fact, analysis. Such tools provide truly valuable model-driven development.

A really nice introduction into the theory and practice of these new tools is provided by the book "Concurrency: State Models & Java Programs". The future of TDD and truly advanced modeling is so bright you'll need to wear sunglasses.

2 comments:

Jesus Henry Christos said...

i pretty much agree this post, but i disagree with your contention that TDD prevents bugs rather than finds bugs. i don't see how this can be true unless you are narrowly defining a "bug" as an error that ships.

i define a "bug" as an error that is introduced into my system the second that it is typed in, and using this definition, TDD helps me to find the bugs i entered into my system -- better than any other methodology that i am aware of --, but it does nothing to prevent such errors from ever being entered in the first place.

infact, the only thing that i can think of that prevents errors from being introduced into my system is something that prevents mistyping (as in keyboard typing, not OO typing).

but you might see/use TDD differently than i do, and i would like to hear more about why you consider TDD a bug-preventing tool since that will perhaps cause me to change my programming practices for the better.

Patrick Logan said...

Dear Jesus,

TDD may be considered a bug detection device, but generally those bugs will only exist on the order of minutes before being detected. To me that's essentially "prevention". But this is a fine nit to pick.

Blog Archive

About Me

Portland, Oregon, United States
I'm usually writing from my favorite location on the planet, the pacific northwest of the u.s. I write for myself only and unless otherwise specified my posts here should not be taken as representing an official position of my employer. Contact me at my gee mail account, username patrickdlogan.