Effective Android Testing for Mobile Developers

Effective Android Testing for Mobile Developers

2h 57mIntermediate2017-08-30

Authors

Chiu-Ki Chan

Chiu-Ki Chan

Android Developer, Speaker, Teacher

Course details

There's a difference between knowing how to implement testing and knowing when and why to do it. In this project-based course, get acquainted with best practices for testing Android apps by walking through a development workflow where testing is integrated throughout the process. As instructor Chiu-Ki Chan shows how to build the app, she explores the differences between JVM and on-device tests, explaining when to use each one. She also explores advanced techniques such as the MVP pattern. By demonstrating how testing fits into an app development workflow, she helps you bolster your ability to catch bugs—and determine where and when you should test.

Learning objectives
Why test?
Local vs. on-device
Code coverage
UI testing
RecyclerView
Hermetic environment
Dependency injection
Testing with MVP

Skills covered

Android DevelopmentAndroidCross-Platform DevelopmentMobile DevelopmentPersonaGoogle

Concepts

0. Introduction

  • 01 - Welcome
  • 02 - What you should know
  • 03 - Using the exercise files

1. Testing Considerations

  • 04 - Why test
  • 05 - Types of tests
  • 06 - Local vs. on-device

2. Test as You Go

  • 07 - The sample app
  • 08 - Smallest unit first
  • 09 - TDD - Red, Green, Refactor, part 1
  • 10 - TDD - Red, Green, Refactor, part 2
  • 11 - Code coverage
  • 12 - UI-less on-device test - RecipeStore
  • 13 - UI-less on-device test - Setup
  • 14 - UI-less on-device test - Null test
  • 15 - UI-less on-device test - Count test
  • 16 - UI-less on-device test - Lookup test

3. UI Testing

  • 17 - RecyclerView
  • 18 - Showing Recipes in MainActivity
  • 19 - RecipeActivity - Layout
  • 20 - RecipeAdapter - OnClickListener
  • 21 - RecipeActivity - Loading a recipe
  • 22 - Vector drawable - Create
  • 23 - Vector drawable - Use
  • 24 - SharedPreferencesFavorites
  • 25 - Favorite - OnClickListener
  • 26 - RecipeActivityTest - An espresso test

4. Hermetic Environment

  • 27 - Test doubles
  • 28 - Dependency injection
  • 29 - InMemoryFavorites
  • 30 - RecipeApplication
  • 31 - TestRecipeApplication
  • 32 - CustomTestRunner
  • 33 - Test state - Setup
  • 34 - Test state - Test

5. Robot Pattern

  • 35 - What vs. How
  • 36 - ScreenRobot
  • 37 - RecipeRobot
  • 38 - Clear favorites
  • 39 - Separation of concerns

6. Model-View-Presenter

  • 40 - Introduction
  • 41 - View Interface and Presenter
  • 42 - Refactor - Load recipe
  • 43 - Refactor - Show error
  • 44 - Refactor - Show recipe
  • 45 - Refactor - Toggle favorite
  • 46 - Mockito - Intro
  • 47 - Mockito - Setup
  • 48 - Testing with MVP - recipeNotFound()
  • 49 - Testing with MVP - Exception
  • 50 - Testing with MVP - ArgumentCaptor
  • 51 - Summary

Conclusion

  • 52 - Next steps
80,000 Toman