Test Doubles explained


Dummy objects are passed around but never actually used.

Fakes - Working implementation, but much more simple than the original

Mocks - Mocks are objects that register calls they receive, but do not execute the real system behind.

Stubs - Stub is an object that holds predefined data and uses it to answer calls during tests.

Spies usually record some information based on how they were called and then call the real method. (or not)