We're very happy to be bringing you another great live code on Thursday, May 8 at 7pm with Colin Miller (Sr. software engineer @ LinkedIn)!
Testing on Android isn't always easy or straightforward, but it is a key part of creating applications - using the right tools when Testing on Android will help you to increase the robustness of your code, and decrease application development time.
This live code will feature writing Unit Tests for Android using Robolectric and Mockito on a small sample project.
Unit testing on Android is in a sorry state. Tests require an emulator or real device to run. This is slow because your tests need to spin up an emulator, copy files, run the tests, and transfer the results back. They can’t be run headless and there often isn’t an easy way of testing your networking code. Slow tests means you’re less likely to follow good testing practices or make testing a top priority in your projects.
The solution is Robolectric, a testing framework for Android that allows you to run your tests in a plain JVM without the need for a device or emulator.
Colin Miller is currently working on the flagship Android application at LinkedIn. There, he has implemented and promoted the use of pure unit testing on Android. A big proponent of TDD, Colin has made minor contributions to the Robolectric project, and enforces a practice of ensuring every commit at LinkedIn is accompanied by unit tests. He runs a general programming and android related blog at http://colintmiller.com
Big thanks to Splunk for providing the venue, food, and drinks!
As always, we encourage you to bring your laptops and contribute your questions.
See you there!
TJ & the BeMyApp team