Unit testing of activities
Clearly, one of the most important parts of an Android application is the implementation of activities. Like we already discussed, all applications have activities, but only a few of them include domain models and business logic. The norm is to create applications that behave like clients of an existing backend system using web services.
There are two types of activities testing:
- Unit testing: Each activity is tested in isolation from the rest of the application. This type of testing focuses on the layout and the expected components.
- Integration testing (in Android, it's also called instrumentation): Each activity is tested as part of the overall application. This type of testing ensures that the activities are doing the right things on user behavior, such as opening new activities, displaying toast messages, and so on.
In this chapter, we are going to see how to use Maven to drive the unit testing of activities and part of the following chapter will discuss...