Slide 23
Slide 23 text
DUMMIES
You pass in something, and you don’t care who it is used,
often the object is not used at all.
STUB
Opposed to dummies, stubs are objects created in a way
that you do care how they are used. For example, to tricky
an authorization to test if the user ca/can’t do certain actions
in the system.
SPIES
To assert that a method was called by the system under test,
as the post by [1]: “You can use Spies to see inside the
workings of the algorithms you are testing”.
True mocks, stubs, dummies, spies, fakes
TRUE MOCKS
Is interested in the behavior, instead of return of functions. It
cares about which functions were invoked, with what
arguments and how often.
FAKES
Fakes have business logic, so it can drive the system under
test with different sets of data.