Unit Testing
A test class inherits from XCTestCase
Testing for UI
Large part of an iOS app is the user interface, which is more difficult to test and usually is not worth writing unit tests for. For this, you would look into implementing the UI Testing framework.
Benefits of Unit Testing
XCTest
A testing framework built right into Xcode (since Xcode 5)
Test Methods must always return void, and start with the prefix “test” and take in no parameters
The structure of a test
Arrange - arrange all necessary preconditions and inputs
Act - act on the object or method under test
Assert - Assert that the expected results have occurred
What should I test?
TDD
Writing tests in swift
At the top of your test file, import your Swift application’s module. This will look like: import name_of_your_project
No quotes or .swift necessary. It probably wont autofill. If you have spaces in your project name, use underscores