3 ms·
> Depends. I'm certainly not advocating testing implementation details Then it is otherwise impossible to explicitly test a third-party dependency. As soon as
by randomdata 3y ago
> Depends. I'm certainly not advocating testing implementation details
Then it is otherwise impossible to explicitly test a third-party dependency. As soon as you state an explicit relationship, then the tests become tightly coupled to that dependency. If down the road you switch out that library for a different one, your tests will break as they explicitly reference that library. This is not where you want to be.
Well written tests will have no concern for what libraries you use. As before, they will only test the outside user interface. How that interface functions under the hood does not matter. As long as the user interface conforms to what you have documented, who cares what libraries you have used? The fact of the matter is that nobody cares about how it is implemented, they only care about the result.
> be that documented, hinted at, undocumented
Only the documented. Anything undocumented will never be considered. As stated in another comment, this is provable by taking it to the logical extreme and assume a program is completely undocumented (no tests). When no tests run, nothing will be tested.
Only the interfaces that which you have documented will be validated when you run your test suite, and they will only be validated for what you have documented as being true.