Re: Three Law of TDD - to strictly follow, or not?
"George Dinwiddie [email protected] [testdrivendevelopment]" <[email protected]> Thu, 28 Aug 2014 14:17:33 -0400
| Newsgroups | gmane.comp.programming.test-driven-development |
|---|---|
| Organization | iDIA Computing, LLC |
| Message-ID | <[email protected]> |
Michal, On 8/28/14 12:03 PM, Michal Svoboda [email protected] [testdrivendevelopment] wrote: > 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. I write acceptance tests all at once. I write unit tests a bit at a time, often starting with the creation of a new object whose definition does not yet exist. In this fashion I work inside-out within the bounds of outside-in. > 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. With effort, you can. But how does that drive the design? - George -- ---------------------------------------------------------------------- * George Dinwiddie * http://blog.gdinwiddie.com Software Development http://www.idiacomputing.com Consultant and Coach http://www.agilemaryland.org ---------------------------------------------------------------------- ------------------------------------ Posted by: George Dinwiddie <[email protected]> ------------------------------------