Daniel Russel wrote: > How does it help if a unit test specifically calls a particular piece of > API as opposed to the API is used internally? > In both cases the API is being tested similarly thoroughly.
I think you misunderstood my point. Coverage is one thing, but a simple unit test that directly accompanies a new piece of code helps to document the intent of that code (e.g. in a submitted patch). Hiding the test for code in an apparently unrelated patch makes code review hard.
I'm not sure what you mean by "internally" in this context, but if a method is not designed to be used by external users, why is it part of the API?
> And given the current state of our unit test code, I hope no user looks > at them for anything.
That is no excuse for not writing tests, of course, because they can always be incrementally improved. But unit tests are not documentation (sure, it'd be nice if they were readable enough to serve as simple examples, but tests and examples are two rather different things).
Ben