Errors, Exceptions, and Testing


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



Overview/Description
Defensive Programming in iOS has to do with using 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 iOS apps.

Target Audience
iOS developers who have experience creating apps using the Objective-C and Swift languages, and who are interested in learning to employ defensive programming techniques for iOS apps

Prerequisites
None

Expected Duration (hours)
2.3

Lesson Objectives

Errors, Exceptions, and Testing

  • start the course
  • use error information returned indirectly from methods
  • test for specific kinds of errors based on domains and codes
  • create and return error objects from custom methods
  • use alert views to inform end users of error information
  • use an underlying error object to find out more detail about an error that has occurred
  • create and throw/raise exceptions in iOS apps
  • catch and handle exceptions in iOS apps
  • use the @finally directive to guarantee code execution
  • convert a raised exception to an error when appropriate
  • capture and handle specific types of exceptions locally
  • create an XCTestCase Class using Xcode and Objective-C
  • create an XCTestCase Class using Xcode and Swift
  • create, execute, and check results of unit tests using Xcode and Objective-C
  • creating and executing unit tests in Swift
  • unit test private methods in custom classes
  • how to create tests that measure execution time of code
  • create and execute asynchronous tests
  • recognize how to initiate the creation of an automated test of an iOS app
  • access interface elements by navigating the element hierarchy
  • use accessibility labels to interact with iOS app elements when automation testing
  • select and tap interface elements in automation testing
  • define pass and fail benchmarks for automation testing
  • use the logElementTree method to understand an app's view hierarchy
  • import previously created automation scripts for reuse
  • create assertions using NSAssert
  • create assertions using the assert function
  • create assertions in Swift
  • work with creating and managing errors and exceptions
  • Course Number:
    sd_dpio_a03_it_enus

    Expertise Level
    Intermediate