Application Tests VS Logic Tests
Since application tests can now be run on the simulator from Xcode, what would the advantage be, apart from possibly a small saving in execution time, of still separating your tests into logic and application tests?
The differentiation as per the Apple docs:
Logic tests. These tests check the correct functionality of your code in a clean-room environment; that is, your code is not run inside an application. Logic tests let you put together very specific test cases to exercise your code at a very granular level (a single method in class) or as part of a workflow (several methods in one or more classes). You can use logic tests to perform stress-testing of your code to ensure that it behaves correctly in extreme situations that are unlikely in a running application. These tests help you produce robust code that works correctly when used in ways that you did not anticipate. Logic tests are iOS Simulator SDK–based; however, the application is not run in iOS Simulator: The code being tested is run during the corresponding target’s build phase.
Application tests. These tests check the functionality of your code in a running application. You can use application tests to ensure that the connections of your user-interface controls (outlets and actions) remain in place, and that your controls and controller objects work correctly with your object model as you work on your application. Because application tests run only on a device, you can also use these tests to perform hardware testing, such as getting the location of the device.
- Accessing an image with specific resolution in the Asset Catalog
- Tint a UIView with all its subviews
- “Application windows are expected to have a root view controller” conditional appearance
- How to get a swift enum's associated value regardless of the enum case
- Wake up ios app when a bluetooth device is near by
- iOS: how to set custom background colour with sliders?
Solutions Collect From Internet About “Application Tests VS Logic Tests”
Application tests compared to logic tests are really used for two different things:
Logic tests/unit tests are used to test very small behavior for one or a few methods, e.g. “Given that I create my object like this, is the value of a certain property what I expect it to be?”
Application tests however are used to test the big picture, e.g. “Do I get the right data in my detail view when I tap on a certain table view cell?”
- Hide dots from UIPageViewController
- Name conventions for xibs
- Libgdx for iOS with RoboVM – Unsatisfied link error at IOSGLES20.init
- weak property gives me nil when i'm trying to access it swift
- Asynchronously load image in uitableviewcell
- How to assign my CustomNavigationBar to a UINavigationController?
- How to show back button on the RootViewController of the UINavigationController?
- How to Store Username and password in Keychain and verify them through alertView
- NSLocalizedString only retrieves the key, not the value in Localizable.strings (IOS)
- Clear NSView programmatically in swift
- Check for private API “usage” yourself?
- How to disable 4 finger gestures on iPad?
- Using App Links Hosting API for link shared on Facebook from iOS app
- Status Bar Hide Cordova
- Xcode – how to include c library and header file to cocoa project?