5 ms·
That's a bad test though. Its not brittle but assuming it was written in a Tdd manner there should be at least two chances for the developer to catch the bug if
by boyter 15y ago
That's a bad test though. Its not brittle but assuming it was written in a Tdd manner there should be at least two chances for the developer to catch the bug if they don't use the constant they are testing in the test.
I have no source on this but isn't it bad practice to use constants in your tests? I personally use a new string with the expected value. It forces me to look twice and really consider what I am doing.
- nl 15y agoIt's a comment on hacker news illustrating a point, not a guide of how to write test cases. The point is that it is possible to have good test coverage and still have bugs that are best found by humans.