Book Image

Test-Driven iOS Development with Swift

By : Dr. Dominik Hauser
Book Image

Test-Driven iOS Development with Swift

By: Dr. Dominik Hauser

Overview of this book

Test-driven development (TDD) is a proven way to find software bugs early. Writing tests before your code improves the structure and maintainability of your app. Test-Driven iOS Development with Swift will help you understand the process of TDD and how it impacts your applications written in Swift. Through practical, real-world examples, you’ll start seeing how to implement TDD in context. We will begin with an overview of your TDD workflow and then deep-dive into unit testing concepts and code cycles. We will showcase the workings of functional tests, which will help you improve the user interface. Finally, you will learn about automating deployments and continuous integration to run an environment.
Table of Contents (15 chapters)
Test-Driven iOS Development with Swift
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Chapter 7. Code Coverage and Continuous Integration

We now have about 80 tests and the code that makes tests pass. But do the tests really test all the code? Using TDD, the code coverage of our tests should be quite high. Should.

Instead of guessing, we would rather have numbers that tell us how good the code coverage of our tests really is. Before Xcode 7, it was quite difficult to measure the coverage of a test suite. But with version 7, Apple added this feature to Xcode.

In this chapter, we will measure the code coverage of our tests, and we will take a look how we can use Xcode Server and fastlane to automate everyday tasks in our lives as iOS developers. The chapter is structured like this:

  • Enabling code coverage

  • Continuous integration

  • Automatic deployment with fastlane