Testing an application is very important. It may serve a lot of purposes such as be sure some features are correctly working, put in confiance other developers in modifying legacy code, or even development technics like TDD. However testing on Android evolved quite quickly recently,  a lot of new tools have to be considered, and the platform itself make testing on Android quite a challenge.

[Edit] I wont write any part 2 about using emulators for now, since the new official emulator has been released. For now it can not be used in CI since it does not support headless mode yet. More than that, Clean Architecture is taking a huge step forward lately (like Android-CleanArchitecture, or Ribot app). This kind of architecture let us minimize the dependency to the Android framework, and thus allow us to write a lot more pure Java tests.

About writing, debugging, and getting result from tests using AS, the official documentation from Google about testing has been fully rewritten. I encourage you to refer to it.

I may however write posts about specific cases of testing using Clean Architecture, based on RX Android and Dagger 2. [End of edit]

Continue reading