TDD is BS?

irritate irritate at gmail.com
Wed Jun 19 07:44:26 PDT 2013


On Wednesday, 19 June 2013 at 11:01:05 UTC, Szymon Gatner wrote:
> D is the only language (that I am aware of) that has first 
> class unit testing support. What do you think? Do we really 
> just "mentally masturbate"?

My feelings about TDD changed when I saw that talk explaining TDD
in the context of double-entry bookkeeping in accounting (maybe
linked off of here:
http://unhandled-exceptions.com/blog/index.php/2009/02/15/uncle-bob-tdd-as-double-entry-bookkeeping/).

Writing your tests and code separately is actually an important
part of it.  If you are copy-pasting your code into your test
after you write it, then that's not really giving you the
guarantees you want.

And for anyone who's never tried the loop of:
1. Write a failing test.
2. Write the code that makes the test pass.
3. Make all the lights go green, then goto 1.

You might want to give it a try.  I was surprised by the feeling
of accomplishment I would get from making the failing tests pass.

irritate


More information about the Digitalmars-d mailing list