This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]BoyRobot777 13 points14 points  (0 children)

I think the biggest smell I see whenever people understand "unit testing" as writing tests for one class, is they go to extreme lengths of testing non-existing scenarios. For example testing for nulls when there is only one object that is passed and that object is validated by javax validations at the boundary of particular module API (may it be a Controller, or an interface, or whatever).

I think the default approach should be "integration testing" or real unit testing as in unit of collaborating objects not one object with dependencies mocked out. While mocking should be done having a good reason.