On Proggit today I was reading the comment thread on a submission entitled, "Why Unit Testing Is A Waste of Time".
I'm not really concerned with premise of the article so much as I am with a comment made concerning it:
The stem of the problem is that most “units” of code in business software projects are trivial.
Change the size of the unit until it is no longer trivial? Who the hell defined the unit of code as a single function or method anyway!?
and
Well, some of the guys I worked with wanted to define a unit as single functions. It was completely stupid. My favorite definition of "unit" is: the smallest piece of the code that can be usefully tested.
Are we spending too much time just to Mock out some objects and test a trivial piece of code and not really adding anything of value?
What should a "unit" be when Unit Testing? Are function level tests too granular?