Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Yeah, assuming you think it's not a bug when the backend API that you're mocking is accidentally removed or changes its response slightly.


You seem to be implying that I prefer all unit tests and no integration or system tests. Far from it.

A system test catches the backend API issue. A unit test can demonstrate that my component degrades gracefully if the backend API is not available (because I used a mock to provoke a timeout response).


There are plenty of systems out there that can't degrade particularly gracefully.

That said, the big issue with unit tests is they don't test the glue which is where a lot of issues happen. In languages with strong type systems, this is less of an issue.

Unit tests are great when you actually have complex logic with relevant corner cases, but when you're building web apps, 95%+ of your code is just boilerplate data munging




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

Search: