Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of Unit Test in Xcode 5

Tags:

I am writing my first bigger iOS project and I want to use as much of Xcode 5 as possible. Now I want to use testing but I have never done it before.

My project uses come Views and dynamic `TableViews. How could I implement the test in the code, so that it makes sense?

like image 283
Christian Seiler Avatar asked Sep 26 '13 14:09

Christian Seiler


People also ask

What is unit testing in Xcode?

Unit tests are awesome. They not only improve the overall quality of your code, they also make it easier for you to test individual pieces of your app without having to manually run your app. Given Apple's extensive support for unit tests in Xcode and Swift, it's surprising that so few iOS developers write unit tests.

What is the use of unit testing?

The main objective of unit testing is to isolate written code to test and determine if it works as intended. Unit testing is an important step in the development process, because if done correctly, it can help detect early flaws in code which may be more difficult to find in later testing stages.

What is unit testing in iOS?

by simple example. To test an app, one needs to write three different kinds of test code. Unit Test — Test the single function without any external dependency. e.g. to test the given email is valid or not. Integration Test — Test the single function with dependency.


1 Answers

Please start by watching WWDC '13 session 409 - Testing in Xcode 5. It's a very good starting point.

Next, if you're not feeling confident of your approach to unit testing, I'd recommend reading "Test-Driven iOS Development" by Graham Lee.

For now, remember that a unit test tests single "unit" of functionality and does not cover performance, UI interaction and whole system integration.

like image 152
matm Avatar answered Nov 18 '22 03:11

matm