From the post:
I do not use mock objects when building my application, and I do not see
the sense in using mock objects when testing. If I am going to deliver
a real object to my customer then I want to test that real object and
not a reasonable facsimile This is because it would be so easy to put
code in the mock object that passes a particular test, but when the
same conditions are encountered in the real object in the customer's
application the results are something else entirely. You should be
testing the code that you will be delivering to your customers,
not the code which exists only in the test suite.
I don't think the argument for unit testing is that you should ONLY do unit testing. By stubbing/mocking and removing dependent systems from unit tests, you're usually left with: 1. Tests that run very well in isolation
2. Tests that run very quickly
3. Tests that are very stable (as long as the code isn't changing,
results shouldn't change from run to run)
All of these are great qualities for tests that will help you, the developer, continue to safely refactor code as your application ages. Functional tests where you're not stubbing / mocking will help you ensure your application continues to function as expected from a user interface perspective. Both are valuable to different audiences and for different purposes :-).