Panasonic Youth rob sanheim writes about software, business, ruby, music, stuff and things



Posted
15 July 2005 @ 10am

Tagged
TDD

Discuss

should you really be writing that code?

Courtesy Keith Ray on the TDD mailing list:

“If you’re not smart enough to test the code you’re writing, what
makes you think you’re smart enough to be writing it?”

Anytime I think I can’t test something, I should think of this.


2 Comments

Posted by
Jim Halberg
19 July 2005 @ 10am

Does this mean if you’re not smart enough to test it? or does this mean if you’re not smart enough to write automated (Junit) tests for it?

Would you consider any argument that a test may be more expensive to write than it’s worth (in some very rare circumstance)?

i.e. I can test this with 5 minutes of paper and pencil (so I’m “smart enough to test it”) in debug but it would take me 3 hours to code a test for it.

Or if I find myself in this situation would you say that this code is (categorically) a victim of poor (non-TDD) design.


Posted by
Rob
19 July 2005 @ 1pm

I would say, in general, that your code is not well designed if it is that hard to test. There will always be exceptions, but I think if you are talking about new code that you have control over, you should be able to test it. Legacy systems are a whole different issue.


Leave a Comment

Why I switched from Roller to Wordpress Its not so much the heat, its the humidity