-4

I was asked this in an interview, I have always read about what unit tests do, but what do they not do?

Is Unit Testing worth the effort?

Any insights? Thanks!

LoveMeow
  • 3,468
  • 9
  • 42
  • 63

1 Answers1

3

"Good" unit tests are meant to test units in isolation. Period.

Thus a "real" unit test will not exercise those dependencies of your class under test - that you decided to "cut out" (using mocking/stubbing).

Of course that means that you do not test assumptions how that 3rd party API will react to your calls for example. Because you mock out that 3rd party API.

GhostCat
  • 133,361
  • 24
  • 165
  • 234