Updated Course: Testing in iOS

Learn the basics of constructing unit tests and UI tests, and how to incorporate them into your app. By Brian Moakley.

Leave a rating/review
Save for later
Share

A few weeks ago, we released an update to our Networking with URLSession course, which brings everything in our Getting Started with iOS category up to date for iOS 11, Swift 4, and Xcode 9. If you’re ready to move on, and learn about how to automate the process of ensuring your apps are functioning as expected, Testing in iOS is for you!

In this 28-video course, you’ll get started writing basic unit tests, and then pick up some more advanced techniques. You’ll also explore UI testing to test your app’s user interface. And of course, this course uses the latest version of Swift, iOS, and Xcode as well!

Let’s have a look at what’s inside.

Part 1: Unit Testing Basics

In this first part, you’ll learn about the structure of unit tests, and strategies for writing and refactoring your tests.

Part 1

This section contains 11 videos:

  1. Introduction: In this video, you’ll get an overview of what will be covered in this first section and why testing is important.
  2. Getting Started: Learn the basics of adding unit tests to an already existing project.
  3. Importing Modules: Often times, unit tests need to access code from other modules. Learn how to do this using @testable.
  4. Test Case Structure: This video covers the structure of unit tests and what is expected when you write them.
  5. Running Your First Test: At long last, it’s time to run your first test. Like with all things with Xcode, there are many way to do this.
  6. Challenge: Writing Your First Test: Now that you have experience writing a unit test, go ahead and try writing another one.
  7. Fixing Your Second Test: Writing unit tests often means fixing unit tests. This video will walk you through the process.
  8. Red Green Refactor: There are many strategies for writing unit tests and one of them is called “Red/Green/Refactor”. This video walks you through it.
  9. Challenge: Write Red Green Refactor Test: Your challenge is to write another unit test but this time, adhering to the Red Green Refactor method.
  10. Optimizing Tests: Tests can get messy. In this video, you’ll do a little clean up to make your tests cleaner and understandable.
  11. Conclusion: This reviews what it means to write unit tests and reviews some essential strategies.

Part 2: Advanced Unit Testing Techniques

In part 2, you’ll pick up some more advanced techniques, including testing asynchronous methods, using mock objects, and testing performance.

Part 2

This section contains 9 videos:

  1. Introduction: This video gives you an overview of some of the advanced techniques that you’ll be learning in this section.
  2. Asynchronous Testing This video covers some strategies when testing methods that return results over an indeterminate time.
  3. XCTWaiter and Expectations: The XCTWaiter and expectations allow you to wait for a result in your unit tests.
  4. Challenge: Adding XCTWaiter: In this challenge, you’ll add an XCTWaiter to your unit test.
  5. Mocking: This video explores relationships that you can establish between objects.
  6. Mocking Tests Writing tests for your mock objects takes a little bit of reworking. This video walks you through the process.
  7. Code Coverage: Knowing what is tested and what is not, is as important as writing the tests. Thankfully, Xcode provides code coverage reports.
  8. Performance Testing: Sometimes you’ll want to test how well a method preforms and for that, you use a special unit test: a performance test.
  9. Conclusion: This video reviews the section and reminds you about some strategies to keep in mind.

Part 3: UI Testing

In the final part of this course, learn how to test your app’s user interface with UI testing.

Part 3

This section contains 8 videos:

  1. Introduction: UI tests allow you to test the user interface of your iOS app. Xcode allows you to autmate the process.
  2. Recording a UI Test Thankfully creating a UI test is as simple as clicking a button and recording your actions.
  3. Refactoring Your UI Test: This video covers how to take recorded UI actions and convert them into bonafide UI tests.
  4. Challenge: Write Your Own UI Test: Now that you have an idea on how to write UI tests, your challenge is to write one on your own.
  5. Queries: Queries are used to fetch items like navigation bar and buttons. This video covers the process of how it works.
  6. Multidevice UI Testing Some UI tests on iPhones won’t work on iPads. This video gives you strategies for dealing with the issue.
  7. Challenge: About Screen Test: Your next challenge is to write a test for the about screen view controller.
  8. Conclusion: This video concludes the series and gives you some things to think about in your future testing.

Where To Go From Here?

Want to check out the course? You can watch the introduction video for free! Asynchronous Testing, in Part 2: Advanced Unit Testing Techniques, will also be free when it is released.

The rest of the course is for raywenderlich.com subscribers only. Here’s how you can get access:

  • If you are a raywenderlich.com subscriber: The first part of the course is ready for your today! The rest of the course will be released next week. You can check out the course here.
  • If you are not a subscriber yet: What are you waiting for? Subscribe now to get access to our updated Testing in iOS course and our entire catalog of over 500 videos.

Stay tuned for more new and updated iOS 11 courses to come. I hope you enjoy the course! :]

Contributors

Over 300 content creators. Join our team.