Mô tả

Unit Testing is a must-have skill and this video course is about Unit Testing Swift code.

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 for your Swift mobile application, and you will be able to test even very complex Swift code.

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.

Have a look through the curriculum of this course to see what it covers. Watch a few sample video lessons. And if you have questions, I am always here to help you.

Bạn sẽ học được gì

Unit Test iOS Mobile App

XCTest Framework

Create, Run and Debug Unit Tests

Mock Dependencies

Use Dependency Injection

UI Testing

Yêu cầu

  • Knowledge of Swift
  • Mac OS and Xcode

Nội dung khoá học

17 sections

Introduction

2 lectures
Source Code
00:04
Introduction
01:49

Basics of Unit Testing in Xcode

19 lectures
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 Default Unit Test Case Class Explained
07:08
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
Assertions
07:32
Enabling the Failure Debugger Breakpoint
04:29
Parallel Distributed Testing on Multiple Simulator Clones
03:57

TDD. Implementing Model Validator

7 lectures
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
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
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
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
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
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
Loading UIViewController that uses a Storyboard
03:45
Loading UIViewController that uses XIB
02:36
UIViewController that creates Views programmatically
03:12

Examples: Testing methods that throw Error

4 lectures
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

Examples: Unit Test UITextField Attributes

4 lectures
Overview of UITextField Attributes: Content Type, Keyboard Type, Placeholer...
06:41
Test that UITextField has the Email Address UITextContentType set
05:05
Test that UITextField has Email Address keyboard type set
02:53
Test that Password UITextField is a Secure Text Entry
02:36

Examples: Testing Navigation. Push to Navigation Stack.

4 lectures
Project overview
02:20
Push UIViewController into UINavigationController. Wait for expectations.
07:31
Test Push Navigation. Alternative way.
03:17
Test Push Navigation with Spy class
05:43

UI Testing

16 lectures
Introduction
05:48
Accessing UI Elements
06:09
Add UI Tests target to a project
02:02
Create a new UI Test case class
02:21
Recording UI Tests. An introduction
02:45
Recording UI Tests. Test if UITextFields are enabled
04:44
Testing with UITextField placeholders
02:41
Test Assertions to check if UITextFields are enabled
05:09
Adding accessibility identifiers to UITextFields
04:03
Finding UI elements
02:26
A Test method to assert that an error alert is presented
04:57
Making UIViewController display UIAlertController
06:01
Refactor
02:42
Test for Success Alert Dialog
05:29
Wait for View Controller to appear
07:02
XCUIElement Actions and Gestures
03:05

UI Testing. Screenshots & Attachments.

5 lectures
Introduction
01:34
Generating and Previewing Screenshots
02:42
Enabling and Disabling Automatic Screenshots
01:36
Taking Screenshot of Specific UI Element
04:07
Take a Screenshot of Current Device Screen
02:47

UI Testing. Launch Arguments.

3 lectures
Introduction
04:55
Passing and Reading Launch Arguments
03:59
Passing and Reading Launch Environment Values
04:29

UI Testing. Test Plans.

5 lectures
Introduction
02:37
Creating a new Test plan
03:21
Creating new test plan configuration
04:21
A separate Test Plan for UI Tests, Unit Tests and All Tests
04:18
Localization screenshots demo
07:22

Bonus section

1 lectures
Bonus lecture
02:24

Đánh giá của học viên

Chưa có đánh giá
Course Rating
5
0%
4
0%
3
0%
2
0%
1
0%

Bình luận khách hàng

Viết Bình Luận

Bạn đánh giá khoá học này thế nào?

image

Đăng ký get khoá học Udemy - Unica - Gitiho giá chỉ 50k!

Get khoá học giá rẻ ngay trước khi bị fix.