Defensive Programming in Android: Errors, Exceptions, and Testing


Overview/Description
Target Audience
Prerequisites
Expected Duration
Lesson Objectives
Course Number
Expertise Level



Overview/Description
Defensive Programming in Android uses coding practices and techniques to create apps that are reliable, resilient, and easily testable. This course will teach you about thinking defensively in your approach to errors and exception handling, and also how to create automated tests for Android apps.

Target Audience
Android developers who have experience creating apps using Java, and who want to employ defensive programming techniques

Prerequisites
None

Expected Duration (hours)
1.9

Lesson Objectives

Defensive Programming in Android: Errors, Exceptions, and Testing

  • start the course
  • recognize how errors and exceptions can be used in defensive programming
  • use the Java exception classes
  • use exception stack traces
  • test for specific kinds of errors based on domain and code
  • create custom Java error classes
  • inform end users of error information in an Android app
  • use an underlying error object to find out more detail about an error that has occurred
  • release Java resources in the event of an exception
  • recognize how unit testing can be used in defensive programming
  • use the android testing API to construct automated unit tests
  • use instrumentation in automated Android unit testing
  • use test case classes in Android automated unit testing
  • use Android assertion classes
  • use mock object classes in Android automated unit testing
  • use test runner classes for Android automated unit testing
  • view test results in the IDE
  • recognize where end-to-end testing can be used in defensive programming
  • set up the Android Testing Support API for automated UI testing
  • use Espresso test classes for Android automated UI testing
  • use instrumentation of activities for Android automated UI testing
  • test UI components in Android
  • use ViewAction, ViewInteraction, and DataInteraction classes to simulate actions when testing an Android app
  • describe the use of assertions for defensive programming in Java for Android
  • use basic assert statements in Java for Android
  • identify and use precondition, postcondition and invariant assertions
  • use annotations to aid in programming defensively for Android
  • create a Java app to use exceptions and assertions
  • Course Number:
    sd_dpfa_a03_it_enus

    Expertise Level
    Intermediate