Unit Testing Swift Mobile App
4.5 (86 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
449 students enrolled

Unit Testing Swift Mobile App

Apply Test-Driven Development(TDD) process to iOS mobile app development in Swift
Bestseller
4.5 (86 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
449 students enrolled
Created by Sergey Kargopolov
Last updated 6/2020
English
English [Auto]
Current price: $34.99 Original price: $49.99 Discount: 30% off
5 hours left at this price!
30-Day Money-Back Guarantee
This course includes
  • 8.5 hours on-demand video
  • 1 article
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Unit Test iOS Mobile App
  • XCTest Framework
  • Create, Run and Debug Unit Tests
  • Mock Dependencies
  • Use Dependency Injection
  • UI Testing
Course content
Expand all 135 lectures 08:39:39
+ Basics of Unit Testing in Xcode
19 lectures 01:16:24
Introduction
06:55
Testing Pyramid
03:29
The F.I.R.S.T Principle
03:46
Test-Driven Development Lifecycle
02:36
Enable Unit Tests in Xcode Project
03:22
The addTeardownBlock()
02:25
Creating a New Test Case Class
03:43
Ways to Run Unit Test in Xcode
04:07
The Default Order of Unit Tests
01:56
Unit Test Naming Requirements
03:08
Ways to Disable or Skip Unit Test
04:37
Viewing Test Results
03:51
Code Coverage
05:54
100% Code Coverage
01:20
Test Method Code Structure. Arrange, Act, Assert.
02:09
Enabling the Failure Debugger Breakpoint
04:29
Parallel Distributed Testing on Multiple Simulator Clones
03:57
+ TDD. Implementing Model Validator
7 lectures 34:28
Introduction
01:56
Test That User First Name is Valid
11:23
Test for a very short First Name
05:32
Test for a very long First Name
05:06
Challenge: Apply TDD to Implement Validation of Last Name and Email Address
03:59
Test if user passwords match
03:37
Test if user passwords do not match
02:55
+ Test Code in Isolation
4 lectures 12:05
Introduction
01:47
Dependency Injection
02:47
Use of Protocols
03:41
Test Toubles - Fake, Mock, Stub, Dummy
03:50
+ TDD. Implementing Network Service Class.
24 lectures 01:20:43
Introduction
03:06
Create Initial SignupWebServiceTests Unit Test class
01:12
Create Initial SignupWebService Class
02:40
Implementing SignupFormRequestModel
04:13
Adding CompletionHandler to Signup Method Signature
01:35
Implementing the Initial SignupResponseModel
01:23
Implementing the Initial SignupErrors Enum
01:03
Organize Project Folders
04:06
Assert that the Response Status is Equal to "ok"
02:19
Adding an Expectation and an Asynchronous Wait Method
02:35
Inject URL String
01:51
Prepare URL
01:41
Prepare URL Request Object
02:51
Create DataTask
02:14
Inject URLSession
01:00
Return Response Model
02:03
Trying how it works with Real HTTP Request
04:33
Mock URLProtocol
04:20
Make URLSession use MockURLProtocol
04:39
Handle Unknown JSON Response Model
07:25
When Empty URL Provided Return a Specific Error Message
05:42
Refactor SignupErrors Enum
02:53
Test URL Request Failure
13:20
Check Code Coverage
01:59
+ TDD. Implementing Presenter Class in MVP Application
21 lectures 01:09:25
Introduction
06:10
Create Presenter Unit Test Class and Test Method
01:48
Create Signup Form Model Struct
02:47
Create SignupPresenter class and the processUserSignup() method
02:16
Create Initial MockSignupModelValidator class
03:07
Create Validator Protocol
04:45
Inject Validator Mock and validate each property
06:59
Refactor
03:16
Unit Test to verify the signup() was called
03:03
Create SignupWebService Mock Class
02:39
Signup Web Service Protocol
02:59
Inject Signup Web Service Mock in to Presenter
05:11
Unit Test to assert that Presenter calls a method on View Delagate
01:18
Create View Delegate Protocol and MockSignupViewDelegate
06:59
Inject View Delegate into Presenter
05:09
Counting number of times a method was called
00:54
Verify that successfulSignup() called one time only
01:25
Refactor
00:55
Coding Challenge
02:13
Assert that Presenter calls a Error Handler on View Delagate
03:42
Review Code Coverage of Presenter Class
01:50
+ Unit Testing View Controller
8 lectures 47:34
Introduction
03:34
Create a New Test Class and a Test Method
05:28
Test UITextFields are initially empty
05:24
Test UITextField has a referencing outlet
06:38
Test UIButton has @IBAction assigned to it
09:15
Test UIButton Action invokes code in Presenter
03:46
Create MockSignupPresenter class
05:11
Inject MockSignupPresenter into View Controller
08:18
+ Testing Old or Legacy Code
6 lectures 20:44
Introduction
01:29
Refactor Massive View Controllers
02:40
Use Protocols and Dependency Injection
05:45
Adding code to existing methods
03:27
Break large functions into smaller ones
02:34
Wrapping existing classes. Decorator pattern.
04:49
+ Examples: Ways to Load UIViewController in a Unit Test
3 lectures 09:33
Loading UIViewController that uses a Storyboard
03:45
UIViewController that creates Views programmatically
03:12
+ Examples: Testing methods that throw Error
4 lectures 15:14
XCTAssertThrowsError example
06:55
XCTAssertNoThrow example
02:33
An example of Do Try and Catch instead of XCTAssertThrowsError
04:00
An example of Do Try and Catch instead of XCTAssertNoThrow
01:46
Requirements
  • Knowledge of Swift
  • Mac OS and Xcode
Description

Unit Testing is a must-have skill and this video course is about unit testing.

If you take this video course, you will learn how to follow a Test Driven Development process to implement a feature for an iOS mobile app built with Swift.   

This video course starts with Unit Test basics and continues with a very practical set of lessons that demonstrates how to follow a Test-Driven process to implement the User Signup feature in the Model View Presenter mobile app.

By the end of this video course, you will have a very clear understanding of how to write Unit Tests and UI Tests.

If you are a freelance developer you might postpone learning how to unit test iOS app for some time. But if you are planning to join a bigger team, then unit testing is a must-have skill for you to be able to work on important app features.

Who this course is for:
  • Beginner Swift developers with no experience with Unit Testing