Hacker News new | ask | show | jobs
by zlynx 1805 days ago
If you have a web API that returns a 200 OK with a JSON object with a missing entry when an item is not found, instead of a 404 error, then you have a bug in your API.

But you cannot allow it to change because your users are relying on the existing behavior.

1 comments

And this is the case for, what, maybe 0.1% of unit tests?

And you're using that... to justify that the "only" thing unit tests achieve is maintain bugs? Although in any case, this is no longer a bug, it's part of your spec now.

But regardless, what about the other 99%+ of unit tests that are enforcing correct behavior...?

Your argument is like saying that food is bad because people occasionally get food poisoning.