logoalt Hacker News

fg137today at 1:56 AM0 repliesview on HN

I have seen, many times, code that has lots of tests but don't work.

Why?

Some of the patterns that I saw:

* The code is only called from tests but never called in production

* Tests are not testing the actual application logic, or the logic that matters. In some cases, the tests have nothing to do with the application code at all, because it does not even run any application code.

* Tests repeat the same logic as in application (tautology). All the time.

* Application code is actually incorrect. But tests just end up using the wrong expected value to make tests pass, disregarding what should happen.

That's using the latest models.

To make things better, apparently people never bothered to go through the manual workflow at least once to verify the behavior.

Good luck just relying on tests.