Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between Logic Test and Application Test in Xcode?

In Xcode when you create a new objective c unit test case, it asks you to choose between "Logic" test and "Application" test. What's the difference?

like image 837
john Avatar asked Oct 25 '11 02:10

john


People also ask

What is difference between unit tests and UI test in Xcode?

The really short version is that unit tests have access to the code in your app (or whatever kind of module you are building) and UI tests do not have access to the code. A unit test only tests one single class per test.

What are tests in Xcode?

Unit testing is an essential tool to consistently verify your code works correctly. Learn about the built-in testing features in Xcode, using XCTest. Find out how to organize your tests and run them under different configurations using test plans, new in Xcode 11.

How do I run all test cases in Xcode?

Using ⌃⌘U will run all the test cases without building the test target. It is the opposite of ⇧⌘U. This is especially useful when you want to skip a slow-building test target and jump straight into running all the test cases.


2 Answers

The Logic Test part is for doing White Box testing; it allows you to test things at a more granular level.

Application Test is more like Black Box testing where you check that interactions with UI controls and the UI of your application is giving you the expected results/behavior.

like image 87
Saurabh Avatar answered Oct 12 '22 09:10

Saurabh


Logic tests are the very low unit test type tests. (Think a single method.)

Application tests are at a higher level and include the whole of the app, the object graph, outlets, etc. (Think more of an integration test.)

http://developer.apple.com/library/ios/ipad/#documentation/Xcode/Conceptual/ios_development_workflow/135-Unit_Testing_Applications/unit_testing_applications.html

like image 33
Grant Lammi Avatar answered Oct 12 '22 09:10

Grant Lammi