Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Testing in Android

Soham Mondal
September 15, 2016

Testing in Android

A presentation on Testing in Android presented at the Mobile developer summit 2016.

Soham Mondal

September 15, 2016
Tweet

More Decks by Soham Mondal

Other Decks in Technology

Transcript

  1. About me - Founder, Triveous - Creator, Voice Recorder -

    Google Expert: UX - Android/UX consultant - Organizer at Blrdroid - Mentor at the Google Launchpad Accelerator
  2. Agenda • Android architecture: MVP/MVVM/MVC? • What is Testing? Testing

    principles • Types of Tests • Unit testing • Demo: Unit Testing • Instrumentation Testing • Demo: Instrumentation testing • Continuous Integration
  3. Android Architecture • MVC: Model View Controller • MVP: Model

    View Presenter • MVVM: Model View ViewModel • Clean Architecture by UncleBob
  4. Clean Architecture • Framework • Slaves of the Framework •

    Separate business logic from Framework • Activities/Fragments • Entanglement • Impacts Portability/Maintainability/Clarity of the solution
  5. MVP • Presenter • Injecting presenter into Views • Can

    unit test the presenter http://hannesdorfmann.com/mosby/mvp/
  6. Testing Principles • Clean architecture • Understand what you’re trying

    to test • Isolation • Integration • All possible scenarios • TDD
  7. Type of Tests • Unit tests • Integration tests •

    End to end tests (Instrumentation tests) http://googletesting.blogspot.in/2015/04/just-say-no-to-more-end-to-end-tests.html
  8. Objective of Unit Testing? • Just the core functionality/business logic

    • No external dependencies • Quick and predictable • All possible scenarios • TDD
  9. Objective: What are you testing? • End to end functionality

    • UI • External dependencies • Longer • Flaky
  10. Instrumentation tests • Options: Robotium, Espresso • Why is espresso

    generally better? • Espresso test recorder in android studio • Support for firebase test lab
  11. More Espresso • Espresso-Intents and Intent Stubbing • Espresso-Contrib for

    DatePicker, RecyclerView, Drawer actions, Accessibility checks, CountingIdlingResource • Idling resources • Code coverage
  12. CI • Jenkins • Travis/Circle CI/others • Integration with github

    and others • Automated reporting: Email/Update slack • Deploy to play store