Excellent point. In many ways I find integration and functional tests are more useful than unit tests. If all you’re testing is the little bit of code in isolation it’s too easy to miss the cracks of interaction between layers. You can test that the SQL statement is what you expect, but until you actually run it on the database you don’t know if it will work or not.
Amen to that. I just wrote about the same sort of thing, as it’s something which has been consuming my time for the past few weeks. We have a lot of unit tests with decent coverage; but when we started doing our acceptance tests, we came across a ton of issues that unit testing had not and could not illuminate (e.g. network timeouts, database issues). Capturing expectations about components external to the application is just as vital as unit testing in getting to a decent working system.