Fundamentals of instrumentation testing
Before we see how we can configure Maven to execute Android instrumentation tests, let us elaborate a little more about instrumentation testing. To run such tests, you will want to set up two things. First, you need a project that contains your tests, and second you need to deploy your application to a device or a running emulator. Then, you will be able to run the tests against the deployed application. You should be familiar with this structure, as we have already seen it in the previous chapter when we discussed unit testing as an activity.
The difference, however, is that activity unit testing is limited to testing one activity in isolation of the rest of the system, whereas instrumentation testing can verify the interaction of all Android components: activities, content providers, and services. You can start activities by other activities, make use of content providers and consume services and run complete test scenarios in various Android versions...