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.
Part 2: Unit Testing Basics
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.
In this video tutorial, you'll learn the basics of adding unit tests to an already existing project.
Often times unit tests need to access code from other modules. Learn how to do this using @testable.
In this video we will discuss the structure of unit tests and what is expected when you write them.
At long last, it's time to run your first test. Like with all things with Xcode, there are many way to do this.
Now that you have experience writing a unit test, in this challenge you will go ahead and try writing another one.
Writing unit tests often means fixing unit tests. In this video we will walk you through the process.
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.
Tests can get messy. In this video, you'll do a little clean up to make your tests cleaner and understandable.
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
This video gives you an overview of some of the advanced techniques that you'll be learning in this section.
This video covers some strategies when testing methods that return results over an indeterminate time.
The XCTWaiter and expectations allow you to wait for a result in your unit tests.
In this challenge, you'll add an XCTWaiter to your unit test.
There are times in your testing when you'll need to create objects that pretend to be other objects. This is called mocking.
Writing tests for your mock objects takes a little bit of reworking. This video walks you through the process.
Knowing what is tested and what is not, is as important as writing the tests. Thankfully, Xcode provides code coverage reports.
In the second challenge of this section, you'll use your newfound skills to test a view controller.
Sometimes you'll want to test how well a method preforms and for that, you use a special unit test: a performance test.
This video reviews the section and reminds you about some strategies to keep in mind.
Part 4: UI Testing
UI tests all you to test the user interface of your iOS app. Xcode allows you to autmate the process.
Thankfully creating a UI test is as simple as clicking a button and recording your actions.
This video covers how to take recorded UI actions and convert them into bonafide UI tests.
Now that you have an idea on how to write UI tests, your challenge is to write one on your own.
Queries are used to fetch items like navigation bar and buttons. This video covers the process on how it works.
Some UI tests on iPhones won't work on iPads. This video gives you strategies on dealing with the issue.
Challenge: About Screen Test Your next challenge is to write a test the about screen view controller.
This video concludes the series and gives you some things to think about in your future testing.