/SwiftUnitTesting

Techniques, processes and tricks for Unit Testing (In Swift)

SwiftUnitTesting

Purpose

For over 8+ years of doing unit testing across various platforms and different programming languages (including both strongly typed and weakly typed languages), I've accumulated massive amounts of strategies, processes and tricks. Over the years I've coached senior/team lead seasoned developers as well as jr. developers as well using this knowlege with much success.

Most of the techniques have been communicated through various means, but the purpose of this repo is to get all my thoughts down on "paper" so that it can be used for everybody at any time.

While most of these techniques can be used for various platforms, since I'm an iOS/Swift developer by day, the examples will be focused on that platform.

Table of Contents

  1. What is Unit Testing
  2. Programming to an interface (Protocol Conformance)
  3. Mocks
  4. Dependency Injection
  5. Patterns to avoid
  6. Builders (TBD)
  7. Wrappers
  8. Final Thoughts

Additional Notes:

These documents will show examples using the more "modern" Quick and Nimble frameworks.