• Grey Facebook Icon
  • Grey Twitter Icon
  • Grey YouTube Icon

Droidcon is a registered trademark of Mobile Seasons GmbH

Mocks, Stubs, and Spies, Oh My

Brian Gardner

Developer & Instructor at Big Nerd Ranch

The object you use to satisfy a dependency during testing depends on what kind of test you are writing. The dependency you would provide an object in a unit test is different from that of an integration test. In a unit test you want an object you have full control over. This allows you to specify the return values of any method calls and verify the right methods are called. In an integration test you want an object as close to the real object it replaces as possible. In this talk you will learn about the different types of test doubles available to you. From mocks to spies and fakes, you will learn to use the right kind of test double for each type of test to get the most benefit from your test suite.