¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

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


 

Kaleb Pederson kaleb.pederson@... [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

Join [email protected] to automatically receive all group messages.