Testing in iOS

Dec 26 2017 · Video Course (1 hr, 51 mins) · Intermediate

Testing is a great way to help ensure the pieces of your app remain functionally correct and bug-free. Explore Unit Testing, UI Testing, Test-Driven Development, best testing practices, and more!

Version

  • Swift 4, iOS 11, Xcode 9

Unit Testing Basics

Introduction

2:13 Free
In this video, you'll get an overview of what will be covered in this first section of this course and why testing is important.
1
In this video tutorial, you'll learn the basics of adding unit tests to an already existing project.
2
Often times unit tests need to access code from other modules. Learn how to do this using @testable.
3
In this video we will discuss the structure of unit tests and what is expected when you write them.
4
At long last, it's time to run your first test. Like with all things with Xcode, there are many way to do this.
5
Now that you have experience writing a unit test, in this challenge you will go ahead and try writing another one.
6
Writing unit tests often means fixing unit tests. In this video we will walk you through the process.
7
There are many strategies for writing unit tests and one of them is called the Red Green Refactor. This video walks you through it.
8
Your challenge is to write another unit test but this time, adhering to the Red Green Refactor method.
9
Tests can get messy. In this video, you'll do a little clean up to make your tests cleaner and understandable.
10

Conclusion

1:15
In this conclusion video for the first section of this course, we will review what it means to write unit tests and some essential strategies.
11

Advanced Unit Testing Techniques

This video gives you an overview of some of the advanced techniques that you'll be learning in this section.
12
This video covers some strategies when testing methods that return results over an indeterminate time.
13
The XCTWaiter and expectations allow you to wait for a result in your unit tests.
14
In this challenge, you'll add an XCTWaiter to your unit test.
15

Mocking

7:10
There are times in your testing when you'll need to create objects that pretend to be other objects. This is called mocking.
16
Writing tests for your mock objects takes a little bit of reworking. This video walks you through the process.
17
Knowing what is tested and what is not, is as important as writing the tests. Thankfully, Xcode provides code coverage reports.
18
In the second challenge of this section, you'll use your newfound skills to test a view controller.
19
Sometimes you'll want to test how well a method preforms and for that, you use a special unit test: a performance test.
20

Conclusion

2:18
This video reviews the section and reminds you about some strategies to keep in mind.
21

UI Testing

UI tests all you to test the user interface of your iOS app. Xcode allows you to autmate the process.
22
Thankfully creating a UI test is as simple as clicking a button and recording your actions.
23
This video covers how to take recorded UI actions and convert them into bonafide UI tests.
24
Now that you have an idea on how to write UI tests, your challenge is to write one on your own.
25

Queries

4:56
Queries are used to fetch items like navigation bar and buttons. This video covers the process on how it works.
26
Some UI tests on iPhones won't work on iPads. This video gives you strategies on dealing with the issue.
27
Challenge: About Screen Test Your next challenge is to write a test the about screen view controller.
28

Conclusion

1:36
This video concludes the series and gives you some things to think about in your future testing.
29

Contributors

Comments