Documentation Archive

Developer

Xcode Overview

Using Code Coverage

Code coverage shows you which of your app’s code paths are being tested. When you run a set of tests with code coverage enabled, Xcode tracks how many times each branch in your code is called. The test report shows a hierarchical view of test coverage for each file.

image: ../Art/Code_Coverage_report_2x.png

Clicking one of the files or methods opens an editor annotated with the number of times the unit tests call each code branch.

image: ../Art/Code_Coverage_editor_2x.png

Turn on code coverage in the scheme editor for a target.

image: ../Art/Code_Coverage_enable_2x.png

For more information on code coverage, see Code Coverage.