News for hackers. Stuff that matters.
Re:When you shouldn't bother unit testing by smanuel on Friday May 17, 2013 @09:25AM (#5724139)
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.
Re:When you shouldn't bother unit testing by thirsteh on Friday May 17, 2013 @09:35AM (#5724199)
Then 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.
Re:When you shouldn't bother unit testing by kleiba on Friday May 17, 2013 @09:38AM (#5724217)
...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-a...)

Re:When you shouldn't bother unit testing by thirsteh on Friday May 17, 2013 @09:40AM (#5724227)
Definitely. 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.
Re:When you shouldn't bother unit testing by norswap on Friday May 17, 2013 @09:36AM (#5724206)
Isn't TDD all about writing tests before coding?
Re:When you shouldn't bother unit testing by warmwaffles on Friday May 17, 2013 @09:39AM (#5724222)
I 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.

Re:When you shouldn't bother unit testing by blowski on Friday May 17, 2013 @10:28AM (#5724529)
> 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.

Re:When you shouldn't bother unit testing by warmwaffles on Friday May 17, 2013 @11:29AM (#5724926)
> "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.

Re:When you shouldn't bother unit testing by marcosdumay on Friday May 17, 2013 @01:51PM (#5725786)
That.

TDD isn't lean. Writting tests for things that were already proven is.

Re:When you shouldn't bother unit testing by dragonwriter on Friday May 17, 2013 @01:59PM (#5725815)
> 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.)

Re:When you shouldn't bother unit testing by warmwaffles on Friday May 17, 2013 @02:37PM (#5725993)
> since it concretely bounds what is necessary

What do you mean by this?