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

> Nobody is advocating for integration tests to the exclusion of unit tests.

Oh, I got here just now, but well, let me advocate it. (Well, not all unit tests, but most of them.)

The ideal layer to test is the one that gives you visible behavior. You should test there, and compare the behavior with the specification.

Invisible behavior is almost never well defined and as a consequence any test there has a very high maintenance cost and low confidence results. Besides, it has a huge test area that comes with the large freedom of choice there. It is a bad thing to test in general.

Now, of course there are exceptions where the invisible behavior is well defined or where it has a lower test area than the visible one. On this case it's well worth testing there. But those are the exception.




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

Search: