Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Software testing is important if we want In order to deliver good quality products. In Android, testing is not easy because the view (Activity or Fragment) is coupled with the model. The model refers to the business logic of the application. Separating the view from the model is essential if we want to make testing simple., we need to embrace Software Testing. This helps us identify bugs swiftly and verify that  our software is fit for use. 

Type of Tests

According to android documentation there are two types of tests.

...

Individual elements are tests and everything else is mocked including the Android framework dependencies. An element is the smallest testable unit of the application. These tests are good for validating the business logic.  In Android, testing these units is not easy because the view (Activity or Fragment) is coupled with the model (business logic of the application) . Separating the view from the model is essential if we want to make testing simple.

Instrumentation tests

Individual elements are combined and tests together as a group. The tests run on an android device or emulator. The emphasis here is to test user stories and to mimic user interactions in the app.

...

https://code.tutsplus.com/tutorials/how-to-adopt-model-view-presenter-on-android--cms-26206

https://android.jlelse.eu/android-mvp-for-beginners-25889c500443