This is a basic project that demonstrates the use of unit and UI tests with code coverage on XCode 7 using Swift 2. It consists in a calculator application that performs basic operations, such as sum, subtraction, multiplication and division.
To build and execute this project, the following requirements are needed:
- Mac OS X 10.10.4 (or higher)
- Xcode 7
Open the Calculator/Calculator.xcodeproj
file on Xcode and press ⌘ + B
to build and ⌘ + U
to execute the tests and generate the code coverage.
##User Interface tests Xcode 7 comes with UI tests functionality. It records the user actions on application and generate the code to be used on test scenario (it's very similar to the Selenium IDE plugin for Firefox).
Click on `Record UI Test` button to launch the application and start recording the steps
##Code coverage In addition to UI tests, the new version of Xcode comes with code coverage. To enable this functionality, act as follows
To see the code coverage, run the tests and execute the following steps
For more info about how to create tests and visualize code coverage, look at this Speaker Deck presentation.