At our company we typically make sure that we write an end-to-end test for our websites/web apps. That means we access a URL, fill in a form, submit the form to another URL and check the results of the page. We do this to test form validation, test that the HTML templates have the correct context variables, etc.
We also use it to indirectly test the underlying logic.
I was told by a co-worker that the reason for this is that we can rip out and change the underlying implementation at any point as long as the end-to-end tests pass.
I'm wondering if this sort of decoupling makes sense or if it's just a way to avoid writing tests for smaller units of code?