© Avi Tsadok 2020
A. TsadokPro iOS Testinghttps://doi.org/10.1007/978-1-4842-6382-2_3

3. Writing Tests – The Basics

Avi Tsadok1 
(1)
Tel Mond, Israel
 

Pay attention to zeros. If there is a zero, someone will divide by it.

—Dr. Cem Kaner

Introduction

In the previous chapter, we have learned how to set up our infrastructure for testing. It seems we are ready to write. But, even when your code is excellent, with pure functions and dependency injection, we need to learn the basics of how to write proper tests that we can maintain over time.

In this chapter, you will learn
  • What exactly are unit tests

  • What are the XCTest framework and XCTestCase class

  • How to configure your target and your test bundle to work together

  • About the XCTestCase life cycle and how it ...

Get Pro iOS Testing: XCTest Framework for UI and Unit Testing now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.