Friday, March 31, 2006
« dotnetrocks interview on CSLA .NET 2.0 | Main | Expert VB 2005 Business Objects beta ebo... »

During the early banter-and-have fun part of my recent dotnetrocks interview I dissed TDD (Test Driven Development, not the text translation service for the deaf). Of course this wasn’t the focus of the real interview, and prior to sitting down behind the mic I hadn’t thought about TDD at all, so we were all just having some fun. As such, it was flippant and it was short - meaning I was having fun, and that I surely didn't have the time or opportunity to really express my thoughts on design or testing. That would be an entirely different show all by itself.

 

Nor do I have time to write a long discussion of my thoughts on design, or on testing, just at the moment. But I did respond to some of the comments on Jeffery Palermo’s blog – and here are some more thoughts:

 

As a testing methodology TDD (as I understand it) is totally inadequate. I was unable to express this point in the interview due to the format, but the idea that you’d have developers write your QA unit tests is unrealistic. And it was pointed out on Palermo’s blog that TDD isn’t about writing comprehensive tests anyway, but rather is about writing a single test for the method – which is exceedingly limited from a testing perspective.

 

Of course you could argue that since the vast majority of applications have no tests at all, that it is a huge win if TDD can get companies to write just one test per method. That is infinitely better than the status quo (that whole division by zero thing) and so TDD is hugely beneficial regardless of whether it is actually the best approach or not. I’d go with this: some testing is better than no testing. But one-test-per-method is pretty lame and certainly doesn’t qualify as real testing.

 

But the real key is that developers are terrible testers (with perhaps a few exceptions). This is because developers test to make sure something works. Actual testers, on the other hand, test to find ways something doesn't work. Testers focus on the edge cases, the exceptional cases, the scenarios that a developer (typically?) ignores. Certainly there's no way to provide this level of comprehensive test in a single test against a method - which really supports another person's comment on Palermo's blog: that TDD isn't about testing.

 

Having spent a few months being employed specifically to do that type of QA unit testing I can tell you that I suck at it. I just don't think in that "negative" manner, and it is serious effort for me to methodically and analytically work my way through every possible permutation in which a method can be used and misused. I’ve observed that this is true for virtually all developers. As a group, we tend to be optimists – testing only to make sure things work, not to find out if they fail.

 

But as someone on Palermo's blog pointed out, TDD is mis-named. TDD isn't about testing (thankfully), nor apparently is it about development. It is, he said, a design methodology.

 

That's fine, but I don't buy into TDD as a “design methodology" either. You can't "design" a system when you are focused at the method level. There’s that whole forest-and-trees thing... Of course I am not a TDD expert – by a long shot – so for all I know there’s some complimentary part of TDD that looks at the forest level.

 

But frankly I don’t care a whole lot, because I use a modified CRC (class, responsibility and collaboration) approach. This approach is highly regarded within the agile/XP community, and is to my mind the best way to do OOD that anyone has come up with to this point. (David West's Object Thinking book really illustrates how CRC works in an agile setting) The CRC approach I use sees the forest, then carefully focuses in on the trees, pruning back the brush as needed.

 

Now I could see where TDD (as I understand it) would be complimentary to CRC, in that it could be used to write the prove-it-works tests for the objects' methods based on the OO model from CRC – but I’m speculating that this isn’t what the TDD people are after. Nor do I see much value at that point – because the design is done, so whether you write the test before or immediately after doesn't really matter - the test isn't driving the design.

 

But to my mind writing the tests is a must. In the interview I mentioned that I (like all developers) have always written little test harnesses for my code. What I didn’t get to say (due to the banter format) was that for years now I’ve been writing those tests in nunit, so they provide a form of continual regression testing. In talking to Jim Newkirk about TDD and his views on this, he said that this is exactly what he does and recommends doing.

 

And as long as we all realize that these are developer tests, and that some real quality assurance tests are also required (and which should be written by test-minded people) then that is good. Certainly this is my view: developers must write nunit tests (or use VSTS or whatever), and that I strongly encourage clients to hire real testers to complete the job – to flesh out the testing to cover edge and exceptional cases.

 

None of which, of course, is part of the design process, because that’s done using a modified CRC approach.


Friday, March 31, 2006 10:40:57 AM (Central Standard Time, UTC-06:00)
IMHO: Unit Tests, when used in correlation with Automated Build Tools and/or Continuous Integration, really only provide the base foundation for smoke tests, not full functional testing.

The analogy here is like when I repair a television--I can replace IC's, transistors, and capacitors, but the first true test that everything is playing nice is when I plug it in for the first time. If I reversed polarity of a electrolytic capacitor, then it will overhead, explode, and send up a nice puff of smoke.

But, passing a smoke test and not blowing a fuse does not necessarily mean that the television is showing a correct picture, or that it is properly calibrated. This is where functional testing comes in.

I see the value of unit testing in order to establish the base parameters that each component or subsystem must operate within (else it will "smoke"). And TDD is a nice way to ensure that you are creating unit tests for each new component of your system as you create that component, because by definition, you don't write a method without having a way to test the method first.

The alternative to TDD considers unit testing as an after-thought, and as such, usually leaves your project without tests if you run into a crunch.
Friday, March 31, 2006 10:41:08 AM (Central Standard Time, UTC-06:00)
I agree with you Rocky.

The issue is -

1. TDD does_not reduce your debugging time to zero. You do end up with an army of tests to maintain. Since the tests are written by and maintained developers, you cannot go with the assumption that the tests themselves aren't bug free. So you write tests to check your tests? Inifinite loop.

2. There is a critical mass of a project that could actually benefit from TDD. Smaller projects can get away with not doing TDD, and larger projects need a much more macro view than tests at class or method level.

3. Again, TDD focusses only on getting "logic" right. It doesn't concentrate on other aspects of software engineering - Load Testing, Transactional consistency, Concurrency issues etc. Sure you could write tests to address all of these, but if you really did cover every aspect, you'd need an army of monkeys to write tests for you.

I like to see TDD as a bamboo scaffolding. You don't need scaffolding when you build a hut. Scaffolding could help when you are building a house. But when you're building a skyscraper in downtown NYC - a bamboo scaffolding won't help.
Friday, March 31, 2006 1:13:03 PM (Central Standard Time, UTC-06:00)
The real question is whether or not we should be using artificial or natural keys in database designs...

In all seriousness, the industry has had a lot of ideas that have waxed and waned as well as a lot of arguments and discussions that eventually just fade away. For the most part the ideas that survive also are generally consistent with common sense. Is TDD consistent with common sense? Is pair programming consistent with common sense? Is zero up front design consistent with common sense?

The one comment I agree with on Palermo's blog is that there is very little reason for console app type tests now that we have integrated unit testing. It is pragmatic, gives you a tangible pay off and requires very little extra effort.
owen
Friday, March 31, 2006 2:21:19 PM (Central Standard Time, UTC-06:00)
"But the real key is that developers are terrible testers (with perhaps a few exceptions)"

You get good at what you practice. If you regularly write tests, with the aim of making sure your code doesn't break, then you get good at writing those kinds of tests. This is what mentoring is all about. I write a bunch of tests for junior programmers to "make green". As they learn how those test break thier code, they are also learning how to write tests that break code.
Friday, March 31, 2006 2:21:19 PM (Central Standard Time, UTC-06:00)
Rocky,
I agree with all your points. TDD is not a complete testing methodology, and only doing unit tests is short-sighted. Good points.

A comprehensive testing strategy is a must, and testers should have a good testing plan. On my team, we do tons of automated testing (unit, integration, and acceptance). The unit tests and integration tests are developer tests. The acceptance tests are automated tests written by the tester (although our FIT fixture are developed by us). TDD is one tiny, miniscule, part of our testing strategy, and I don't even follow the letter of the law with it. For instance, I don't test simple property accessors. I mainly concentrate on test-driving behavior.

There is so much more to software that one single method, and methodology zealots cause a lot of misinformation to fly around. Common sense is the best approach, as Owen states. Only common sense approaches that actual produce results will stay around past the hype.
Sunday, April 02, 2006 2:49:03 PM (Central Standard Time, UTC-06:00)
I initially thought this was an April fool's post until I saw the date, and realised it was actually a day early for that.

You seem to have got two really fundamental points wrong:

First, TDD absolutely does *not* require a single test per method being tested. Nobody I know who practices TDD does this, and I've never previously heard anyone suggest that you might work this way. You've just set up a straw man here. Yes, it would be a terrible idea, and no, that's not what TDD is about.

I think you've misunderstood what Jeffery meant when he talked about a 'single test'. I think what he was referring to was the typical development pattern of "Write one test, then write code to make it pass. Then write one more test, and then make that pass. Then write another test (again, just the one) and make that pass." The point being you write your code one test at a time. Of course at the end of this you usually end up with loads of tests for a single implementation method.

This is *very* clearly stated in all the introductions to TDD I've come across. (And famously, it's pretty much the centrepiece of Kent Beck's classic introduction to TDD.) So from this, it looks an awful lot like you've not read anything about TDD before forming your conclusion that you don't like it. Is that a fair observation or am I missing something?

Second, TDD is not a testing methodology, it's a style of *development*. (Hence the name...) It's not intended to replace QA testing. It's meant to improve the quality of code before it makes it into QA. It's still vitally important to have normal QA testing. (Again, the introductions to TDD I've seen make this very clear.)

So in summary, it looks like the thing you think is a bad idea bears very little relationship to TDD. And I'd agree - what you describe would be a pretty bad idea. This is probably why I don't know anyone who advocates anything resembling what you've described - you're the first person I've ever seen proposing this strange technique that you've chosen to label, inappopriately, as TDD.

Yer actual TDD, on the other hand, actually has a lot to offer.

BTW, as far as 'TDD as a design approach' is concerned, the way I look at it is that it is not a substitute for software design. (Just like it's not a substitute for QA.) But it can be helpful with small scale design. Not design in the sense of deciding what classes you'll create, but design in the sense of what the class members are and what your method signatures are. Mainly because it provides a useful discipline for thinking through exactly what the code that uses the classes looks like before implementing those classes.

It's not the only way of achieving that of course. But many people find it useful.
Sunday, April 02, 2006 9:42:58 PM (Central Standard Time, UTC-06:00)
Yup here's another common thing I've seen in the TDD cult.

You criticize TDD, and someone comes saying "This post clearly shows that you haven't done TDD".
Monday, April 03, 2006 12:24:59 AM (Central Standard Time, UTC-06:00)
I agree with Rocky that you can certainly write the to-be-tested/target code first. Jeremy said "You must write a test first!", http://codebetter.com/blogs/jeremy.miller/archive/2006/03/31/142091.aspx . come on, give me a break!

wait! on the other hand, I also agree with Jeremy! -- most of the time, before you write your target code, you do need to to "prepare" your currrent unit testing first -- if you do not, then, sometimes, you have to make sure it fails, then, change your taget code, then, run it again, to make sure it is indeed it is because your chanages of your target code cause the testing to pass. ---- this is trivial common sense though, that is why I say, give me a break, which is first, really, hens or eggs?!

The real 2 issues are: (1) do you write your own unit testing during within one hour or so (even if you are a big architect, or a super team lead)? -- if yes, it is TDD, if not, crap/suck.
(2) of course, (unless you use some dubious "high-tech" stuff), unit-testable code is always non-UI code. So, TDD means that you do your best to reduce UI code as much as possible.

I believe Rocky passes those two criteria with flying colors -- CSLA (custom class with databinding) does more work than anybody in the second area. That is why I like Rocky, even he was a VB programmer (I myself was/is also a VB programmer, just kidding).

So, I believe Rocky is a star in TDD, in reality already, not in name, yet.



Kia
Monday, April 03, 2006 12:41:26 AM (Central Standard Time, UTC-06:00)
as for why TDD says it is design by code. Read some history. It is not micro, on the opposite, it is at the high 4000 miles above that you say TDD is design by code -- just the opposite of UML's goal (code by design) -- however, because of the 40000miles above, the two opposites are the same. Why. Read this URL -- it is the orgin of "design by code" or "code as design".

http://www.developerdotstar.com/mag/articles/PDF/DevDotStar_Reeves_CodeAsDesign.pdf


The key is, ask yourself, are developers assembly-line workers, or, are they like physician, attorney -- professionals?

Is coding like assemly-line actions, or, is coding like designing?

Another hint: Once upon a computer language is considered equv. to a foreign language. Do not never ever forget that. Computer language is easy. it is not a big deal. VB and UML makes thing even "easier", but programming is still "design". "design" does not have to be "visual". Human being is more lanugage a being than a diagrammatic beging.
Kai
Monday, April 03, 2006 6:21:46 AM (Central Standard Time, UTC-06:00)
"You criticize TDD, and someone comes saying "This post clearly shows that you haven't done TDD"."

Sounds like a version of what the OOP purists say:

"You clearly haven't done OOP" after criticism of some aspect of OOP (usually comes from consultant architects who come into working on a homegrown codebase written by "Morts" who have no desire to develop using trendy technology - and get frustrated when everything isn't laid out for them in some nice OOP package).

I still have not figured out under TDD - just whom is responsible for testing the tests. And who is going to test the unit tests that are testing the unit tests.
Monday, April 03, 2006 9:40:15 AM (Central Standard Time, UTC-06:00)
I mentioned this over at Jeffery's blog - but I will say it again here for your folks. I believe that TDD's value is shown all the more when it is practiced with the practices it is best excercised with. Put in the correct context TDD does provide extreme value.

I have seen developers that are not practicing IoC (Inversion of control or dependency injection) have a very hard time writing meaningful tests for their code. The typically say something like "this code cannot be tested" etc. That being said - when you DO practice IoC - then you can really test your code more completely.

Rocky - Thanks for instigating good talk here.

-Chris

I have elaborated over here also:

http://chrisdonnan.com/blog/2006/04/03/rocky-and-jeffrey-battle-on-about-test-driven-development-and-my-2-cents/
Monday, April 03, 2006 12:04:07 PM (Central Standard Time, UTC-06:00)
I've read some of those introductions to TDD and even played with it a bit (very briefly).

First, the way I understand it is that TDD is a methodology that has generally been embraced and used by those in the agile movement, but they are not one in the same. In other words, TDD does not equal paired programming, etc.

Secondly, I'll say that I remain unconvinced on the "commen sense" argument. I can only imagine the size and complexity of the battery of tests that would fully evaluate a CSLA-based enterprise business layer. One change in the BL design could require a dozen changes to the tests. Then what am I actually testing when I run them? Others here have brought up this fundamental problem and I also just don't "get it".

Finally, I do think I'm a better developer for having examined and considered TDD. While I think at the enterprise application level TDD does suffer from the lack of the "forest" vision, I also think it's helpful in keeping you from designing a forest when all you need this week is a couple of bushes.

It is of course a tremendously important decision just how much time should be spent in forethought for any given project. I would bet that most developers that think at the architect level probably err too often on the side of overdesigning. Which is to say that the number of hours spent in creating elegant designs that are never really needed would probably be more than the hours spent refactoring work done previously that turns out to be inadequate some time later.
Daniel Billingsley
Tuesday, April 04, 2006 7:40:42 AM (Central Standard Time, UTC-06:00)
TDD does not replace QA tests ,it compliments QA Testing.
One's nunit test suite becomes comprehensive
when you include the issues discovered QA testing in your test suite.
Tuesday, April 04, 2006 2:17:16 PM (Central Standard Time, UTC-06:00)
I agree Vikas.

Which returns us to one of my original comments - by the time you've written a comphensive set of unit tests for your code, you lose a great deal of flexibility. Changing your code (refactoring or whatever) causes rewrites of many tests. This is why it is easy to keep 1+ testers busy per developer.

And then add in your XML comments. It can easily take twice as long to document methods as to code them, especially if you are commenting for use with ndoc; because in that case you want to have good remarks, usage samples, etc. THEN if you change your code you must maintain all the comments too.

Again - I think unit tests (and documentation) provide benefits that make them worthwhile. But it would be foolish to ignore the very high cost these things do add to development and especially to maintenance of code. The fact that, in most cases, the benefits outweigh these costs does not in any way negate the costs themselves.

If you don't have actual QA people and code documenters (and how many of us have either luxury??) then you can easily spend several times as many hours testing and documenting your method as you did writing it. Too bad testing and documenting isn't nearly as much fun... I guess that is why this is called work :)
Tuesday, April 04, 2006 2:26:12 PM (Central Standard Time, UTC-06:00)
Thanks Rocky - for taking on what can sometimes be considered a sacred cow.

This is what I would really like to see. Some *real* evidence - something beyond anecdotes here and there, that show where the benefits of TDD outweigh the costs.

Often times, we allow ourselves as technologists to get way to caught up into trendy technologies and/or methods. Sometimes, in consulting, this is by necessity (as in, our clients are demanding we do and say X, so we do and say X) - but other times, it is completley avoidable, if we take a long term perspective on things and get better means of judging whether a new technique has business value or not.

I suspect, with TDD, that we already were doing it where it makes sense (e.g. mission critical components where correct is more important than fast) - and perhaps not in areas where it does not matter as much (think getters, setters, and other trivialities). We used to call it "writing a test harness" or "test suite" - usually concurrently with construction of the actual software, and using same to gauge whether the component could be deployed in a wider technical ecosystem.
Tuesday, April 04, 2006 3:09:25 PM (Central Standard Time, UTC-06:00)
Ok Rocky, now that the TDD donkey is beaten to death, lets see a post about Pair Programming :)
Tuesday, April 04, 2006 8:06:59 PM (Central Standard Time, UTC-06:00)
TDD donkey is dead, how about refactoring? Then, how about let's propose throw away C#, let's go back to VB?

I do not agree with extreme extreme programming. However, all they said is basically true and practical.

It really extremely interesting that a VB lover is advocating custom class; and a C# MVP is using dataset and not using TDD.

Still, I believe Rocky is on the right track, the CSLA-2's C# is earlier than VB is a proof. Unwillingly or not, you have to do what need to be done. Custom class is for guys that is code centric. The only real difference between C# and VB is their culture -- whether it is code centric or not. so, eventually, most "customers" of custom class are C# programmers. It is inevitable.

As for Bilingual: only (OK, mostly) C# programmer can do that -- this is not my assertion; it is actually the base of the policy that although there are more and more C# programmers, it is said that docs are more in VB format, because C# programmer will read it, but if it is in C#, VB programmers will not read it at all!

As for "mort is vb" -- that is just totally crap. C# and java (and perl, ruby, etc) are "business oriented also". The whole "mort is vb" is just vb lovers' crap.

Why I am talking to VB and C# again. C# is code centric, all its feature is build around this philosophy. And code centric means TDD.

Rocky is actually using nunit and log4net (another code centric thing -- both nunit and log4net is to "replace" clicking-oriented debugging). We see how people's deeds than their words.

However, to be frank, Sahil, I do not see where you are going. How can a C# MVP not using custom class and not using TDD? -- how long this can last??????

Kai
Wednesday, April 05, 2006 8:16:54 AM (Central Standard Time, UTC-06:00)
I think that TDD makes refactoring more comfortable in most cases.
I write my test cases at factory layer or Fascade layer or at component level and make sure that they have good code coverage.
My unit test cases give me confidence to make any changes to internal implementation behind these layers.
My unit tests are there to cover me if some thing breaks. TDD gave me confidence to make internal changes to my components one day before moving them to QA testing.

Now structural or behavioral changes to factory layer, fascade layer or component level public interfaces will be
driven generally by requirements. In that case one should be happy to see the test cases failing and need to be fixed.It would help him to perform impact analysis.

I think that is why you say, benefits overweigh costs in most cases.

I totally agree with there is a cost associated with TDD. If writing a good component is hard, writing
good test cases is harder, requires more planning and imagination.
Wednesday, April 05, 2006 3:48:39 PM (Central Standard Time, UTC-06:00)
Kai - you're talking out the wrong end of you body again...

Sahil - as usual, you crack me up with your dry wit. I now make sure I'm not drinking anything when I read your comnments. An army of monkeys... ;-) And you're right about challenging the TDD cult; GOD forbid you don't agree with them. They'll shoot you down and make accusations that you some how can't be smart. My GOD, you don't now TDD then.

Rocky - you're spot on with your common sense and perspective. Thanks for not caving from pressure from the cliquey kewl kids using all the newest kewlest toys.

For your reading pleasure... :-))
http://www.iconixsw.com/emperorsnewcode.html
John Williams
Wednesday, April 05, 2006 11:22:46 PM (Central Standard Time, UTC-06:00)

John: The link is very funny. On the site, there is a link to a book, I will read it when I am in the B&N -- perhaps I will even buy it.

http://www.amazon.com/gp/product/1590590961/104-6165462-2251952?n=283155

As for "the wrong end"? I guess it fit you just as well.


I want to emphasize that, seriously this time, "Business Objects" and TDD are a good match. In CSLA term. You'd better test those static methods; but perhaps not every one during the original development (30% is a good number); but you must test every of those "workflow methods" (if you have any); and you only need to test very small portion of set methods.

Then, when you develop UI or it is used by other code, or, you find a problem, you add more nunit testing code.

Think about it, if you do not use nunit to test those, how can you develop?! Note that those business object are supposedly separate from UI. You should not -- never ever -- develop them immediately with a UI.

So, can you see? TDD is really enforcing the separation of business logic and UI. We always say that we should do that, and Rocky provides a good way to do it. However, it is TDD that really ENFORCES it. I guess that is why people who is used to visual programming resent TDD so much; but for people who use Business Objects, TDD is a god send. The enforcing effect of TDD is so strong, sometimes you find people answer the question, why do you want to use Business Objects? the answer: so that I can test the business logic!!

I noticed that some people mentioned IoC -- you need IoC so that you can easily test things. In my non-extreme TDD point of view, "Business Objects" is absolutely more important than IoC. I am not joking saying that Rocky is already a unsung hero for TDD. and Rocky should do some marketing to the TDD crowd, instead of alienate them. -- Perhaps this discussion or instigation is just a way to get their attention, then, mission completed, Rocky! People will see the deeds, not the words, so, they will be attracted to the “Business Objects”.

As for the "test as design", as people pointed out in the discussion -- that is what I learnt in this discussion -- it directly means "design objects by their behaviors".

As for "a lot of coding". This is just like saying "a lot of objects" in OO. From my past first-hand experience, there are 4 things: (a) you can cut/paste those code to your UI code, so, the time is NOT wasted; (b) others can cut/paste those code in their UI code also -- i.e., it is documentation (as for the "real" documentation -- who cares -- yes, I am a "pragmatic" programmer -- as a programmer, do you really trust any thing that is not running? – give me a break! Documentation is a costly feature, not a must-do in a software project). So, you save time from unnecessary “internal” documentation; (c) Writing Unit testing is really easy (thinking about them is difficult -- but that is part of the design, so, that time should never be attributed as "extra"). (d) In general, writing code is easy -- if you do not need to do a lot of debugging -- I know this last point is a stretch, but that is really what you feel after you do TDD. in Visual programming, it is “programming by debugging” -- that is why the VB6's "change-code-and-continue" is so crucial, but for TDD, since you have automated unit testing (and logging!), coding is really not that kind of nervous acts anymore.


kai
Thursday, April 06, 2006 8:10:23 AM (Central Standard Time, UTC-06:00)
All I can say is thank heavens, that the construction industry doesn't follow TDD. Imagine trying to build a bridge that way? I can just imagine the very first dialogue:

"Engineer: Kai, let's begin design on our bridge across this canyon. Kai: Hold on, no BFUD, let me get in my car and see if the bridge fails first. The design will emerge on it's own..." ;-)
John Williams
Thursday, April 06, 2006 10:29:22 AM (Central Standard Time, UTC-06:00)
:)
Building a bridge
An incomplete structure is often subjected to stresses and oscillations that would not arise after completion.


Even before any actual construction is done, substantial work may needed in the form of tests
Models of the bridge or of parts may be tested aerodynamically and hydrodynamically, and of course mechanical tests will be made.
Computer simulations will supplement these tests, enabling a great variety of applied forces to be investigated.

Reference:
http://www.brantacan.co.uk/construction.htm

This is what takes to avoid big disasters. :)
Thursday, April 06, 2006 11:37:52 AM (Central Standard Time, UTC-06:00)
Let's not confuse TESTING with TDD though. Whether someone writes their tests before, during or after writing a method is, to me, far less important than whether they write the tests AT ALL.

A few people have said that TDD gives them confidence to refactor. But frankly, that is a function of having unit tests AT ALL, not a function of TDD. Who cares if you wrote the test before or while writing the method (I prefer while - that's all). As long as you have the unit tests, you can reorganize/refactor your code and have the benefits of that regression testing.

I guess this is my problem with the discussion - it is FAR too easy to say TDD=unit testing. But that's not true. Unit testing is good - hands down. TDD is a particular philosophy that employs unit testing and it may be good. But many of the benefits attributed to TDD come from unit testing.

Which is not to say that there aren't potentially some benefits to TDD that extend beyond having unit tests. But equating TDD and unit testing benefits is not useful in justifying whether TDD itself has any value.
Thursday, April 06, 2006 8:25:45 PM (Central Standard Time, UTC-06:00)
Rocky: I agree with your pragmatic attitude (I noticed that the phrase “pragmatic programmer” is more and more a TDD phrase now – you cannot avoid them, man). However, I also believe that that "particular" philosophy of TDD is simply saying that Unit testing is so good that everything else should be built around it. If you consider you got to have non-UI "drivers" to run your objects, it is literally true that tests "drive" everything. If you feel you need deeper reasons, then, "tests" are "behaviors", and "behaviors" determins classes -- that goes back to your mantra, isn't it?

Vikas: those bridges are beautiful, and nice comments -- hoping not putting words in your mouth -- all software activities are "design", coding is not "construction", it is "designing".

John: I like the visual -- two green mountains, a deep dark valley with a white water creek, a virtual bridge in the mist, and a car falling, with a "design" bubbling up …
Kai
Saturday, April 08, 2006 10:10:05 PM (Central Standard Time, UTC-06:00)
After pondering Rocky's statement "Let's not confuse TESTING with TDD", I got suspicious; so, I went to the

http://perseus.franklins.net/dnrtv/0013/fnet.html

Now I know. So, I agree with Rocky's idea even more now, and put it this way, "Let's not confuse productivity TDD with 'advanced' TDD".

'Advanced TDD' (e.g., unit testing UI-related things, extensively using mocks) is not necessary for almost all projects. To me, it is a big mistakes to introduce TDD via those "advanced" stuff.

However, I still fell that just "using TESTING" is not enough. (Moderate) TDD enforces the separation of UI and business logic. This is a new and good thing,and it is simply and easy, and common sense.
Kai
Wednesday, April 12, 2006 11:29:31 PM (Central Standard Time, UTC-06:00)
See more of my comments here:
http://codebetter.com/blogs/jeffrey.palermo/archive/2006/04/12/142748.aspx
http://codebetter.com/blogs/jeffrey.palermo/archive/2006/04/12/142752.aspx
http://codebetter.com/blogs/jeffrey.palermo/archive/2006/04/12/142755.aspx
Friday, April 14, 2006 6:54:34 PM (Central Standard Time, UTC-06:00)
Hi Jeffrey:

(I also posted the link on your blog)

It seems that both Rocky and you believes that TDD is a lot of more than just “using unit testing”. I disagree. TDD is only a little bit more than “using unit testing”: it makes it easier to a degree that it can be enforced. That is it.

We do not need to unit testing UI related stuff to be TDD, we do not need to use mock objects to be TDD. As a matter of fact, more than 95% of the projects/code, you do not need UI related unit testing and mock objects.

Introducing/selling TDD by showing off UI related unit testing (even not unit testing UI) and extensive mock objects is a very bad idea, it is, well, just a meaningless, senseless showing off, nothing else, or, it just gives TDD a bad name of being meaningless, senseless, goalless, kid-playing, and dizziness.

Take a look of this DNRTV, you will know what was going on, you will know Rocky was right. http://perseus.franklins.net/dnrtv/0013/fnet.html

I am not criticizing the person who was doing the intro; I was criticizing the host. To correct the mistake, Mr. Franklins should give another common sense level (or, if you like it, an “intro” level) TDD show.
Kai
Friday, April 14, 2006 7:15:28 PM (Central Standard Time, UTC-06:00)
sorry, a friend of mine told me the TDD show link is somehow messed up, this is the link:

http://dnrtv.com/default.aspx?showID=10

or,

http://weblogs.asp.net/cfranklin/archive/2006/03/16/440359.aspx
kai
Saturday, April 15, 2006 9:20:18 AM (Central Standard Time, UTC-06:00)
Jeffrey,

Your posts do not rebut Rocky’s contention that most of benefits that are ascribed to TDD come from good unit testing practices.
TDD may be good for Tactical Design but for Strategic Design (when you are writing design documents for other guys to code) you are going to Use CRC, Domain Driven Design or Data centric Design (I know that Rocky does not like that)

Rocky,
I look forward to attend your CLSA 2.0 presentation at CNUG, Chicago on 19th

Sunday, April 16, 2006 9:40:02 PM (Central Standard Time, UTC-06:00)
Vikas,
Actually. You are right about most of what you say. Unit testing is a huge part of TDD.
Check out my post here:
http://codebetter.com/blogs/jeffrey.palermo/archive/2006/04/12/142748.aspx
Saturday, April 22, 2006 4:09:32 PM (Central Standard Time, UTC-06:00)
Rocky made one more controversial statement on TDD on Apr 19th, CNUG, IL

I attended Rocky’s talk on 19th April in CNUG, IL . I really enjoyed the talk. I wish that he would have talked for couple more hours.

In response to a question, Rocky suggested that one should write Unit tests to see whether object persistence is working or not. That is one more controversial statement on TDD.
Testing persistence is part of integration tests, not unit test cases as per TDD.
Reference:
http://www.onjava.com/pub/a/onjava/2004/02/04/juie.html


I write mine unit tests to test object persistence. :)
Most of mine .Net applications were so data centric if my unit tests are not testing object persistence, I won’t feel comfortable.


I follow the book Test-Driven Development in Microsoft.Net by James W.Newkirk and Alexei A. VorontsovNowhere they say that testing object persistence is part of integration tests.
Sunday, April 23, 2006 5:38:23 PM (Central Standard Time, UTC-06:00)
I believe we need to put this in the perspective of framework developers and morts (I call it OTTEC see
http://survic.blogspot.com/2006/04/c-and-ottec-one-two-three-enterprise.html )

I especially want to quote:

OTTEC (i.e. Morts) is flyweight XP/TDD. Note that for XPers orTDDers, it may sounds paradoxical; becuase they are used to feel that they are the most agile doves; and now, here are the flies ;-)


Comments are closed.