360 andev 2017 brian gardner header

Take a Stab at Test-Friendly Architecture with Dagger 2

If you enjoy talks from 360 AnDev, please support the conference via Patreon!

A well tested app gives developers confidence both when adding new features and when refactoring current implementations. This confidence leads to faster development, less bugs, and better design decisions. The question is, how do you set up your application to make it easily testable? Selecting a suboptimal architecture can needlessly tie your application components together making it difficult or impossible to test them separately.

Get more development news like this

In this talk you will learn how to leverage dependency injection to design easily testable objects. We will use Dagger 2, the dependency injection tool, to decouple components in an application which allows changing those dependencies in test. Whether you want real components to test against or replace them with mock objects, dependency injection gives you the flexibility you need to correctly configure your test cases.

Next Up: Android Architecture Components and Realm

General link arrow white

About the content

This talk was delivered live in July 2017 at 360 AnDev. The video was recorded, produced, and transcribed by Realm, and is published here with the permission of the conference organizers.

Brian Gardner

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.

4 design patterns for a RESTless mobile integration »