Mark DiFranco covers how to enable code coverage in the sample project. Code coverage allows you to determine how much of your code is covered by unit tests. Learn how to turn on the code coverage feature in Xcode that overlays the coverage right on your source code.
- [Instructor] Now that we have tests for our entire project…we can take advantage of few more tools…Xcode has made available to us.…One of those tools is inline code coverage stats.…Code coverage indicates how much of your code…is covered by tests.…To enable this, let's head over to our scheme…and select the proper option.…We'll click the scheme at the top of the file…and we'll go to Edit Scheme near the bottom of the menu.…On the left, we'll select Test…and then in the center here…we can see a section called Code Coverage…and we'll check the box that says Gather coverage data.…
We can now close this menu.…We can also have Xcode display the code coverage results…over our source code.…To enable this, we'll head over to Xcode…on the top left of your screen and open up Preferences.…In the Text Editing section,…we'll look at the bottom on the code coverage value.…We'll set the checkbox Show iteration counts to checked.…You'll notice there will be a section…on the right side of your code with the iteration counts.…
- Why write unit tests?
- What is dependency injection?
- Using protocols to help with tests
- Handling external dependencies
- Anatomy of a test case
- Writing tests
- Analyzing code coverage
- Visualizing test results
- Writing and extending UI tests
Skill Level Intermediate
Core Data for iOS and macOS Enterprise Developerswith Jon Bott1h 46m Intermediate
Learning Server-Side Swift with Vaporwith Ron Buencamino1h 30m Intermediate
1. Dependency Injection
2. Using Protocols
3. Writing Tests
4. UI Tests
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.