Re: Three Law of TDD - to strictly follow, or not?
"Kaleb Pederson [email protected] [testdrivendevelopment]" <[email protected]> Thu, 28 Aug 2014 08:26:56 -0600
| Newsgroups | gmane.comp.programming.test-driven-development |
|---|---|
| Message-ID | <CAF4m_uWE2r7_XGCioWWJxQL4nS1k4MvtudLDjMKi3BuxGNzjLA@mail.gmail.com> |
On Tue, Aug 26, 2014 at 12:33 PM, Michal Svoboda [email protected] [testdrivendevelopment] <[email protected]> wrote: > > Do you consider, "an incomplete but green test is at best misleading > > and at worst wrong"? > > A test is only wrong in case you have never seen it fail. All other > tests are complete and functional. As for misleading, that depends how > good a story the test tells. Tests can lie or drift apart from reality. > Usually that is more likely when the test uses mocks. I think you've just described my biggest concern with writing the entire test up front. 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? --Kaleb