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?
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.
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.
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.
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With