Re: Three Law of TDD - to strictly follow, or not?

"Michal Svoboda [email protected] [testdrivendevelopment]" <[email protected]> Thu, 28 Aug 2014 18:03:32 +0200
Newsgroups gmane.comp.programming.test-driven-development
Message-ID <[email protected]>
Kaleb Pederson [email protected] [testdrivendevelopment] wrote:
> When the entire test is written up front (for a new class at least)
> the test will fail, because a failure to compile is considered a
> failure. The problem that I have with the approach is that when it
> "passes", does it pass for the right reason? Or, do we have
> unnecessary test code? or production code? Did the test ever fail for
> the expected reason, or did it fail only in the form of a compilation
> failure?

Hi Kaleb,

I hear what you are saying. But it really goes down to that gut feeling.
Sometimes I want to see the whole story first, not just "once upon a
time there was an object". It usually depends on what level of certainty
I feel over my requirements. The objective is to drive the design with
the test, not to just write it first.

Even if the test is written in a bigger chunk, you can still add in the
code one bit at a time and see the test fail for various reasons until
you get (and subsequently fix) the desired one.

Cheers,
Michal



------------------------------------
Posted by: Michal Svoboda <[email protected]>
------------------------------------