4 ms·
The way I've started to think about testing is like this: you should test your interfaces, because the interface is what matters. If your code is a web app, the
by toasterlovin 7y ago
The way I've started to think about testing is like this: you should test your interfaces, because the interface is what matters. If your code is a web app, then you should be testing the user interfaces and workflows that users interact with throughout the app. If your code is a library, then you should be testing the classes and functions that users will be interacting with when they use your library. In my opinion, everything else is an implementation detail.
But, I think this distinction gets blurrier the larger your organization. While you may have intended some class in your web app as an implementation detail, the larger your organization is, the more likely it is that somebody will start using that class for some other purpose. And thus and implementation detail becomes an interface that other people depend on.