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.
Brian Gardner is an Android developer and instructor at Big Nerd Ranch and creator of its Advanced Android course. As a big believer in testing, he is always trying to learn the best ways to architect Android apps to be easily testable and finding the best tools for the job. He enjoys using his knowledge to help teach others how to develop their applications and ensure they are well tested.