DEV Community

Discussion on: What exactly is a "unit" in unit testing?

Collapse
 
aghost7 profile image
Jonathan Boudreau

I think unit tests are not always appropriate. If you're trying to test code which is largely business logic I'd go with unit testing, for example. If you're trying to test code which is very network intensive I would do integration testing or something along those lines instead. You end up doing so much mocking in those situations that it becomes apparent that you're making a lot of assumptions (i.e., the benefit is negligible).

Pick the right tool for the job I suppose.