News for hackers. Stuff that matters.
Re:How deep are your unit tests? by jiggy2011 on Monday December 10, 2012 @06:06AM (#4898503)
> "If I don't typically make a kind of mistake (like setting the wrong variables in a constructor), I don't test for it."

Hmm, that sounds like the old "You don't need to test , just be an awesome programmer duh!" argument.

The kind of mistakes you never anticipate making are probably the sort of stuff you should be testing for.

The amount of times I've had something fail on an edge case that turned out to be a typo in a var name on some edge case somewhere..

Re:How deep are your unit tests? by jiggy2011 on Monday December 10, 2012 @08:27AM (#4898861)
don't know why this has so many downvotes.
Re:How deep are your unit tests? by pekk on Monday December 10, 2012 @08:40AM (#4898897)
Your tests routinely fail because of typos?
Re:How deep are your unit tests? by jiggy2011 on Monday December 10, 2012 @08:44AM (#4898914)
I've seen production code fail because of typos after months in deployment (because that's how long it took that else { branch to be hit in practice).

The code in question was only subject to very high level smoke tests that looked like they were basically cherry picked best case scenarios intended to pass.

A unit test would have picked this up before it even got to production.

Re:How deep are your unit tests? by TeMPOraL on Monday December 10, 2012 @08:48AM (#4898926)
In dynamic languages? Sure they may. The PHP script you thought works crashes, the Lisp routine out of the sudden enters the debugger, things like that.
Re:How deep are your unit tests? by pekk on Tuesday December 11, 2012 @02:24PM (#4906267)
The question isn't what "may" happen, but what routinely does happen for you.

If typos are even a significant problem in your code then the solution is to type more slowly, have your IDE flag unknown symbols, use autocomplete, etc. As a solution to this problem, strong typing is both disproportionate and inadequate.