Hacker News new | ask | show | jobs
by deadso 2176 days ago
Their point is that the test case provided would lead the developer to believe that the implementation is a correct identity function, when in fact it isn't.

Just clarifying, I do not take this as a good reason to not write tests.

1 comments

Ah, right. I didn't realize some people believe tests should "prove" the correctness of a function (or that if they can't, they're worthless).

Testing has its flaws, but that's not one of them. There's often very good reason to ask the question "does this function operate the way I expect it to when I provide this input?"