[From UnitTestsReconsidered...]
UnitTests tell you when you're done.
When you CodeUnitTestFirst, you know that you're done when...
I submit that FunctionalTests tell you you're done. One doesn't need to test every class to know that the XML parser is complete. One just needs to feed in enough cases of XML to know that it is working. The entire subsystem then can be verified to a sufficient level of confidence without verifying each method.
FunctionalTests do a good job of telling you what functionality is present, but won't tell you how reliable and bug-free the software is. Like, XP customer-specified FunctionalTests probably wouldn't test to see what happens when the file contains invalid, unmatched, or otherwise malformed tags. UnitTests will, because they're typically written at a lower level of abstraction, where those issues are more obvious.
See above re: validation vs. verification. You're right regarding verification but that's not the debate here. Actually, you can test invalid XML files at the functional level. I'm not really sure that's the best example you could have provided. Perhaps, say, testing against errors in the Java Virtual Machine if you are writing a secure application? Maybe the line between functional and unit tests is weak.
"When you're done" leaves out an important parameter: what you're doing.
A single FunctionalTest tells you when you're done implementing some large piece of functionality the customer wants. Your whole suite of FunctionalTests tells you when you're done implementing everything the customer wants (and has expressed as FunctionalTests).
Now assume you're doing CodeUnitTestFirst (otherwise, you don't have the UnitTests for what you're working on yet, so of course they can't tell you when they're done):
A single UnitTest tells you when you're done implementing some very small piece of functionality, which needn't be directly visible to the end user. The collection of UnitTests for a given Unit tells you when you're done implementing the Unit. The main insight I gained by trying it was this: you only end up changing the UnitTests for the Unit you're changing, and (since you're changing the tests just before you change the code) it's only a tiny bit more work than just changing the code.
The "friction of functional equivalence" should be empirically measurable. The claim of ExtremeProgramming is that it's lower than the cost of not having UnitTests.
Finally, UnitTests can have bugs too. Sometimes there are BugsInTheTests!
This discussion would be easier for me to follow with an example.
How about chapter 14 of ExtremeProgrammingInstalled?
One counterargument is that FunctionalTests tell you you're done, and as a complete subsystem has a narrower interface than the units comprising it, are better than unit tests because they don't get in the way when refactoring the internals of the implementation.
Testing beneath this layer should not be strict nor restrictive with respect to the interfaces of classes because those interfaces should be pliable in order to work fast. In other words, you don't gain much by doing complete testing, but it costs you in time while you must continually fix tests as you rework the implementation. -- SunirShah
Serious question: how do you unit test a UI? Is it user experience testing at that point or is there a programmatic framework I don't know about yet?
Read up: TestFirstUserInterfaces. Because Views are the only part of a program that you "look at", they are high-bandwidth but low feedback. Tests can't check for esthetics or usability, but they _can_ preserve these at refactor time. And, at their highest level, tests can help you build-out new forms and widgetry without excessively stopping to "look at" your view.