Start learning with our library of video tutorials taught by experts. Get started

Unit Testing iOS Applications with Xcode 4
Illustration by Don Barnett

Unit Testing iOS Applications with Xcode 4

with Ron Lisle

Video: Welcome

Hi! I am Ron Lisle and welcome to Unit Testing iOS Applications with Xcode 4. In this course, we will look at unit testing and how to unit test iOS applications. We will use the support built into Xcode 4 called OCUnit and also a couple of open-source unit test frameworks called GHUnit and OCMock. I will start off easy by explaining what unit testing is and how it differs from other types of testing. I'll show you how to install and use the OCUnit support built into Xcode 4, and then we'll see how to add and use the additional unit testing capabilities provided by GHUnit.
Expand all | Collapse all
  1. 2m 46s
    1. Welcome
      1m 7s
    2. What you should know
      31s
    3. Using the exercise files
      1m 8s
  2. 9m 55s
    1. What is unit testing?
      49s
    2. Understanding different types of testing
      51s
    3. Why unit test?
      1m 42s
    4. Understanding how to unit test
      1m 9s
    5. Working with unit testing frameworks for iOS
      1m 48s
    6. Understanding test-driven development
      1m 35s
    7. Understanding the use of unit tests in refactoring
      1m 27s
    8. A summary of unit testing concepts
      34s
  3. 45m 46s
    1. What is OCUnit?
      2m 17s
    2. Using OCUnit with Xcode 4 vs. Xcode 3
      1m 46s
    3. Including unit tests in a new project
      2m 37s
    4. Adding unit tests to an existing project
      2m 19s
    5. OCUnit: application tests vs. logic tests
      6m 28s
    6. Writing a logic unit test
      9m 17s
    7. Understanding the rules for writing good unit tests
      4m 30s
    8. Writing an application unit test
      12m 1s
    9. Exploring Xcode dependencies and schemes
      4m 31s
  4. 36m 38s
    1. What is GHUnit?
      1m 36s
    2. Adding GHUnit to a project
      6m 52s
    3. Writing GHUnit unit tests
      5m 12s
    4. Looking at asynchronous tests
      12m 18s
    5. Testing an API with GHUnit asynchronous tests
      10m 2s
    6. A summary of GHUnit
      38s
  5. 11m 27s
    1. An overview of debugging
      1m 29s
    2. Debugging OCUnit tests
      3m 17s
    3. Providing debug info in STAsserts
      1m 55s
    4. Debugging GHUnit tests
      2m 16s
    5. Debugging product code using unit tests
      2m 30s
  6. 23m 28s
    1. What are mock objects?
      3m 20s
    2. Installing OCMock
      2m 13s
    3. Creating OCMock stubs
      4m 28s
    4. Expecting and verifying calls to a mock
      5m 20s
    5. Exploring OCMock partial mocks
      3m 58s
    6. Reviewing unit test coverage for an existing class
      4m 9s
  7. 45m 30s
    1. Forming an iOS unit testing strategy
      3m 21s
    2. More on OCUnit application testing
      3m 16s
    3. Setting up a ViewController for testing
      3m 27s
    4. Testing ViewControllers
      6m 55s
    5. Testing notification generation
      3m 48s
    6. Testing notification handling
      5m 9s
    7. Testing notification registration
      4m 6s
    8. Testing singletons
      3m 46s
    9. Testing gesture recognizers
      6m 32s
    10. Analyzing code coverage with CoverStory
      5m 10s
  8. 1m 31s
    1. Where to go from here
      1m 31s

Watch this entire course now —plus get access to every course in the library. Each course includes high-quality videos taught by expert instructors.

Become a member
please wait ...
Unit Testing iOS Applications with Xcode 4
2h 57m Advanced Apr 30, 2012

Viewers: in countries Watching now:

Unit testing increases productivity and raises code quality. In this course, author Ron Lisle explains installation and effective use of unit testing tools and techniques for iOS projects, to ensure more stable, functional apps. An example application is provided to demonstrate testing and as the course progresses, developers are shown how to tackle the increasingly complex problems encountered when unit testing iOS development projects.

Topics include:
  • What is unit testing?
  • Comparing the unit testing frameworks for iOS
  • Using unit testing in the refactoring workflow
  • Writing a unit test with OCUnit
  • Writing GHUnit tests
  • Debugging product code with unit tests
  • Using mock objects
  • Testing iOS ViewControllers
  • Testing iOS notifications
  • Testing gesture recognition
Subjects:
Developer Mobile Apps
Software:
iOS Xcode
Author:
Ron Lisle

Welcome

Hi! I am Ron Lisle and welcome to Unit Testing iOS Applications with Xcode 4. In this course, we will look at unit testing and how to unit test iOS applications. We will use the support built into Xcode 4 called OCUnit and also a couple of open-source unit test frameworks called GHUnit and OCMock. I will start off easy by explaining what unit testing is and how it differs from other types of testing. I'll show you how to install and use the OCUnit support built into Xcode 4, and then we'll see how to add and use the additional unit testing capabilities provided by GHUnit.

Then we will move up to some more advanced techniques including the use of mock objects using OCMock. Finally, we'll look at some of the problem areas when unit testing iOS applications and how these tools can be used to solve difficult testing situations. So let's get started with Unit Testing iOS Applications with Xcode 4.

Find answers to the most frequently asked questions about Unit Testing iOS Applications with Xcode 4 .


Expand all | Collapse all
please wait ...
Q: I'm encountering the following error:

OCMock.h not found

What should I do?
A: This error indicates that you are probably working in a path with spaces. Relocate the exercise files folder to a path with no spaces. See the exercise files movie for more details.
Q: I'm encountering the following error:

GHUnit link error / (_OBJC_CLASS_$_SenTestCase not found)

What should I do?
A: This means the build settings for the GHUnitTests target needs to have the Framework Search Paths changed. Try these steps.

1. Select the GHUnitTests target.
2. Display "Build Settings."
3. Locate the "Framework Search Paths" setting.
4. Delete the existing values.
5. Add the following values:
   $(SDKROOT)/Developer/Library/Frameworks
   $(DEVELOPER_LIBRARY_DIR)/Frameworks
   $(SRCROOT)
 
Share a link to this course

What are exercise files?

Exercise files are the same files the author uses in the course. Save time by downloading the author's files instead of setting up your own files, and learn by following along with the instructor.

Can I take this course without the exercise files?

Yes! If you decide you would like the exercise files later, you can upgrade to a premium account any time.

Become a member Download sample files See plans and pricing

Please wait... please wait ...
Upgrade to get access to exercise files.

Exercise files video

How to use exercise files.

Learn by watching, listening, and doing, Exercise files are the same files the author uses in the course, so you can download them and follow along Premium memberships include access to all exercise files in the library.


Exercise files

Exercise files video

How to use exercise files.

For additional information on downloading and using exercise files, watch our instructional video or read the instructions in the FAQ .

This course includes free exercise files, so you can practice while you watch the course. To access all the exercise files in our library, become a Premium Member.

Join now Already a member? Log in

Are you sure you want to mark all the videos in this course as unwatched?

This will not affect your course history, your reports, or your certificates of completion for this course.


Mark all as unwatched Cancel

Congratulations

You have completed Unit Testing iOS Applications with Xcode 4.

Return to your organization's learning portal to continue training, or close this page.


OK
Become a member to add this course to a playlist

Join today and get unlimited access to the entire library of video courses—and create as many playlists as you like.

Get started

Already a member ?

Become a member to like this course.

Join today and get unlimited access to the entire library of video courses.

Get started

Already a member?

Exercise files

Learn by watching, listening, and doing! Exercise files are the same files the author uses in the course, so you can download them and follow along. Exercise files are available with all Premium memberships. Learn more

Get started

Already a Premium member?

Exercise files video

How to use exercise files.

Ask a question

Thanks for contacting us.
You’ll hear from our Customer Service team within 24 hours.

Please enter the text shown below:

The classic layout automatically defaults to the latest Flash Player.

To choose a different player, hold the cursor over your name at the top right of any lynda.com page and choose Site preferences from the dropdown menu.

Continue to classic layout Stay on new layout
Exercise files

Access exercise files from a button right under the course name.

Mark videos as unwatched

Remove icons showing you already watched videos if you want to start over.

Control your viewing experience

Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.

Interactive transcripts

Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.

Are you sure you want to delete this note?

No

Your file was successfully uploaded.

Thanks for signing up.

We’ll send you a confirmation email shortly.


Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

Keep up with news, tips, and latest courses with emails from lynda.com.

Sign up and receive emails about lynda.com and our online training library:

Here’s our privacy policy with more details about how we handle your information.

   
submit Lightbox submit clicked
Terms and conditions of use

We've updated our terms and conditions (now called terms of service).Go
Review and accept our updated terms of service.