Introduction
Testing is a fundamental part of software engineering if you want your code base to be scalable and maintainable. In Android, there are basically two types of testing: one is unit testing and the other is integrated testing. Unit testing is a type of testing where individual units are tested independently, while integrated testing, which is also sometimes known as instrumentation testing, requires an Android device or an emulator for the tests to run. Since integrated testing requires real devices or an emulator, these tests are often slower to execute. Unit tests are fast because they don’t have any such need for real devices or emulators in order to run. Since unit tests are faster and instrumentation tests are slower, it is often thought that a robust test suite should have these tests in the proportion of 80% to 20%. So your code base should consist of 80% unit tests and 20% instrumentation tests.