JUnit testing

No development project is complete until it has been thoroughly and rigorously tested, and Android Studio incorporates JUnit testing directly into the workspace. As the name suggests, the framework allows the testing of individual units of code. These are often individual modules but can just as likely be a single class or method.

The Android Studio JUnit test framework provides for two distinct types of test. They are as follows:

  • Local unit tests are used to test business logic in an isolated environment that is not dependent on Android components or other code, although it is possible to mock some dependencies. These tests run on the local Java virtual machine and are consequently considerably faster than testing on a hardware ...

Get Mastering Android Studio 3 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.