Testing in iOS

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! By Brian Moakley.

Leave a rating/review
Save for later
Comments
Share

Part 2: Unit Testing Basics

01
Toggle description

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.

Toggle description

In this video tutorial, you'll learn the basics of adding unit tests to an already existing project.

Toggle description

Often times unit tests need to access code from other modules. Learn how to do this using @testable.

Toggle description

In this video we will discuss the structure of unit tests and what is expected when you write them.

Toggle description

At long last, it's time to run your first test. Like with all things with Xcode, there are many way to do this.

Toggle description

Now that you have experience writing a unit test, in this challenge you will go ahead and try writing another one.

Toggle description

Writing unit tests often means fixing unit tests. In this video we will walk you through the process.

Toggle description

There are many strategies for writing unit tests and one of them is called the Red Green Refactor. This video walks you through it.

Your challenge is to write another unit test but this time, adhering to the Red Green Refactor method.

Toggle description

Tests can get messy. In this video, you'll do a little clean up to make your tests cleaner and understandable.

Conclusion 1:15
Toggle description

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.

Part 3: Advanced Unit Testing Techniques

Toggle description

This video gives you an overview of some of the advanced techniques that you'll be learning in this section.

13
Toggle description

This video covers some strategies when testing methods that return results over an indeterminate time.

Toggle description

The XCTWaiter and expectations allow you to wait for a result in your unit tests.

Toggle description

In this challenge, you'll add an XCTWaiter to your unit test.

Mocking 7:10
Toggle description

There are times in your testing when you'll need to create objects that pretend to be other objects. This is called mocking.

Toggle description

Writing tests for your mock objects takes a little bit of reworking. This video walks you through the process.

Toggle description

Knowing what is tested and what is not, is as important as writing the tests. Thankfully, Xcode provides code coverage reports.

Toggle description

In the second challenge of this section, you'll use your newfound skills to test a view controller.

Toggle description

Sometimes you'll want to test how well a method preforms and for that, you use a special unit test: a performance test.

Conclusion 2:18
Toggle description

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

Part 4: UI Testing

Toggle description

UI tests all you to test the user interface of your iOS app. Xcode allows you to autmate the process.

Toggle description

Thankfully creating a UI test is as simple as clicking a button and recording your actions.

Toggle description

This video covers how to take recorded UI actions and convert them into bonafide UI tests.

Toggle description

Now that you have an idea on how to write UI tests, your challenge is to write one on your own.

Queries 4:56
Toggle description

Queries are used to fetch items like navigation bar and buttons. This video covers the process on how it works.

Toggle description

Some UI tests on iPhones won't work on iPads. This video gives you strategies on dealing with the issue.

Toggle description

Challenge: About Screen Test Your next challenge is to write a test the about screen view controller.

Conclusion 1:36
Toggle description

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