Hacker News new | past | comments | ask | show | jobs | submit login

> The only thing you achieve with unit tests is to prove that you are still bug for bug compatible when changing your code.

If your tests are ensuring buggy behavior, then... you're writing your tests wrong?

What are you even trying to say with this? I've never once seen a unit test intended to enforce a bug...?




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.


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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: