There's a very good talk from Sandi Metz which explains how to decide when is enough (regarding unit tests) youtube.com/watch?v=URSWYvyc42M
As for integration/E2E/whatever tests what I do is to take into account that tests have a cost and that I want to get the biggest benefit from them with the smaller cost possible.
If I can avoid adding a test, I do. Unless of course adding the test saves me money/time/whatever other costs.
In this case, my questions would be:
Do you need to have tests for KlassB and KlassC at all?
Are they only collaborators of KlassA or are they widely used around your app? Then test only KlassA unless you can find another very good reason to test B and C.
Is KlassA only delegating into those? Then I wouldn't test KlassA except for some integration.
Is KlassA doing some other query or does it have any other side effect? Then I would definitely test those as well.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
There's a very good talk from Sandi Metz which explains how to decide when is enough (regarding unit tests) youtube.com/watch?v=URSWYvyc42M
As for integration/E2E/whatever tests what I do is to take into account that tests have a cost and that I want to get the biggest benefit from them with the smaller cost possible.
If I can avoid adding a test, I do. Unless of course adding the test saves me money/time/whatever other costs.
In this case, my questions would be:
KlassB
andKlassC
at all?KlassA
or are they widely used around your app? Then test onlyKlassA
unless you can find another very good reason to test B and C.KlassA
only delegating into those? Then I wouldn't testKlassA
except for some integration.KlassA
doing some other query or does it have any other side effect? Then I would definitely test those as well.