Re:How to avoid brittle code
by prodigal_erik on Monday March 28, 2016 @04:46PM
(#11377259)
I think I'm arguing for letting white-box unit tests make assertions about implementation details in a simple and clear way, rather than having to somehow devise a test using only the black-box API that happens to fail if the assertion doesn't hold. In other words, you can only guarantee parts of the internal state are valid if you know how to infer them from outside.
Are you arguing that all unit tests should be black-box?
"Can't tell unless" means exactly the same thing as "can tell". You have a way to get to that corner case through the public functionality.
If there really is no way to tell through the current public API, there the bug doesn't exist.