Linked Questions

Popular Questions

What does code coverage mean and how it works in Xcode 10?

Asked by At

I am a bit confused by the code coverage reports generated by Xcode 10.1.

I have three test files; two unit tests ones and one UI. None of them have tests written yet and I deleted the default ones.

However, when I run the tests, the code coverage report is not null and gives me, for instance, a 100% code coverage for func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int (my app has a table view with 6 or 7 rows).

Question

How does it work ? In my memory (older Xcode versions), code coverage showed which methods are tested by the tests. Here there are no tests, why is the code coverage not null ?

Nota bene: the scheme settings for code coverage is: Gather coverage for some targets and the target is the main app target, not the test targets

Related Questions