For iOS developers who want to gain more understanding, particularly in unit testing, this video course titled “Unit Testing Swift Mobile App” is ideal. Described as suitable for developers with Swift, Mac OS, and Xcode experience, it shows how to apply the TDD process to add features to iOS apps. You will first learn the basic concept of Unit Testing and then go step by step through the practical lessons, continuing to implement the User Signup feature in a detailed Model View Presenter (MVP) mobile application.
In the ‘Unit Testing Swift Mobile App’ course, you will be clear on how you can write both Unit Tests & UI Tests for Swift applications throughout the entire course. By the end, you will be able to test even the most complicated Swift code line if you follow all the guidelines carefully. Such a set of skills is most important if you are preparing to start working in a big team, as in such a team, unit testing is crucial for working on critical functions of the app.
As somebody who is already a freelance developer, it is important to learn how to do unit testing for those who want to land a job on a large team. With the help of this course, you will feel comfortable writing secure, tested Swift code for iOS applications.
Unit Testing Swift Mobile App Table of Contents:
- Introduction
- Source Code (00:04)
- Introduction (01:49)
- Basics of Unit Testing in Xcode
- 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. Implementation Model Validator
- 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
- Introduction (01:47)
- Dependency Injection (02:47)
- Use of Protocols (03:41)
- Test Toubles - Fake, Mock, Stub, Dummy (03:50)
- TDD. Implementation Network Service Class
- 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. Implementation Presenter Class in MVP Application
- 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 into Presenter (05:11)
- Unit Test to Assert that Presenter Calls a Method on View Delegate (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 an Error Handler on View Delegate (03:42)
- Review Code Coverage of Presenter Class (01:50)
- Unit Testing View Controller
- 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
- 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
- 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
- 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
- Overview of UITextField Attributes: Content Type, Keyboard Type, Placeholder... (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
- 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
- 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
- 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
- Introduction (04:55)
- Passing and Reading Launch Arguments (03:59)
- Passing and Reading Launch Environment Values (04:29)
- UI Testing. Test Plans
- 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
- Bonus Lecture (02:24)
Who is this course for?
- Beginner Swift developers
Click on the links below to Download Unit Testing Swift Mobile App!
You are replying to :