4 ms·
The tl;dr part should just say "If you haven't started coding yet, then you shouldn't bother much about unit testing" which is.. well... common sense.
by smanuel 13y ago
The tl;dr part should just say "If you haven't started coding yet, then you shouldn't bother much about unit testing" which is.. well... common sense.
- thirsteh 13y agoThen test-driven development defies common sense. Its whole point is to write a runnable specification in the form of a test suite before you write the actual code.
- kleiba 13y ago...which can have its benefits, but can also go terribly wrong if you get lost. (Case in point, Peter Norvig comments on a famous series of TDD blog posts that had the goal of writing a Sudoku solver, but ultimately failed: "And I could see, right from the start, you put these two together, and you could solve this Sudoku thing. He didn’t know that so he was sort of blundering in the dark even though all his code “worked” because he had all these test cases." http://pindancing.blogspot.com.au/2009/09/sudoku-in-coders-at-work.html http://pindancing.blogspot.com.au/2009/09/sudoku-in-coders-a...)
- thirsteh 13y agoDefinitely. I'm not a big fan of TDD myself. I think that an advanced system can add a lot of the same checks, leaving you to do just the scrutinous testing via e.g. QuickCheck.
- norswap 13y agoIsn't TDD all about writing tests before coding?
- warmwaffles 13y agoI like MDD, money driven development. It usually works wonders ;) I mix between TDD and not writing tests until after a section of the code is done. It really depends on what I'm trying to accomplish. If I'm spiking things, I tend to just write tests to confirm my work and make sure I'm sane. Other times I know exactly what I want and write the tests first then code. Really just depends on the situation.
- blowski 13y ago> I like MDD, money driven development. Good line. A lot of people will shoot back with "in the long run, it will cost you more" but the point is - a startup doesn't even know if there is a long run.
- warmwaffles 13y ago> "in the long run, it will cost you more" This is true if you don't have tests or your tests lack. But if you write tests as you work or a little ahead of yourself, the cost difference will probably be negligible. To each his own.
- marcosdumay 13y agoThat. TDD isn't lean. Writting tests for things that were already proven is.
- dragonwriter 13y ago> TDD isn't lean. Overtesting isn't lean, but TDD is a practice which fits very well within lean (particularly, its a practice which prevents waste by doing things that aren't needed, since it concretely bounds what is necessary, as well as the more-often discussed effect of preventing additional downstream waste in the form of rework because of incorrectly implemented work that gets into production.) > Writting tests for things that were already proven is. I'm not sure what that sentence means; it sounds like something decidedly non-lean (if something is "already proven", writing tests for it seems to be a task known to be redundant, and thus pure waste.)
- warmwaffles 13y ago> since it concretely bounds what is necessary What do you mean by this?