This tutorial will show you how to get started with automated unit testing of your iOS applications. In this tutorial, you'll learn the basics of creating an iOS unit test, how to structure your project to include your tests, new features that Xcode 6 has provided for unit testing your application, as well as a couple other tips and tricks.
Source files for the Tuts+ tutorial: Introduction to Testing on iOS
Read this tutorial on Tuts+