With every unit testing text I get my hands on comes a little different terminology and more or less different definitions of various fake object types. I find that a lot of this differentiation is too theoretical to be of value in daily practice and I tend to simplify it all to mocks and stubs in the following way.
Stubs
- are fake objects which replace and supplement dependencies of the unit under test to make the testing of the unit possible
- should not break the test
Mocks
- are fake objects with set expectations about how the unit under test should behave and are asserted to verify these expectations
- can break the test
Is this a good way to simplify or am I missing some important points here?
Is it enough to only talk about stubs and mocks, or are there some other, equally important, base fake types that we work with regularly?
I don't need to consider any other fakes and these simple definitions are enough for me while working with unit tests on daily basis, but this can be because unit testing is not being taken too seriously at my environment. So I have this feeling that I may not be getting it right and would like to clear up my understanding before I grow some bad habits.