Awesome Open Source
Awesome Open Source

Awesome Unit Testing in Swift

A curated collection of awesome blog articles, books, talks, podcasts, tools/frameworks and examples.

🎤 Talks:

Apple WWDC

Apple WWDC 2019 - Testing in Xcode (Session 413)
Apple WWDC 2018 - Testing Tips & Tricks (Session 417)
Apple WWDC 2017 - Engineering for Testability (Session 414)
Apple WWDC 2017 - What's New in Testing (Session 409)
Apple WWDC 2016 - Advanced Testing and Continuous Integration (Session 409)
Apple WWDC 2015 - UI Testing in Xcode (Session 406)

Realm Academy

Realm Academy. Jon Reid - Making Mock Objects More Useful
Realm Academy. Jorge Ortiz - TDD For Masses
Realm Academy. Jorge Ortiz - Unit Testing in Swift 2
Realm Academy. Michael May - Testing an Untested App
Realm Academy. Kyle Fuller - Testing Without xCode
Realm Academy. Veronica Ray - Real World Mocking Swift
Realm Academy. Giovanni Lodi - Testing Realm Apps
Realm Academy. TJ Usiyan - Property-Based Testing with SwiftCheck
Realm Academy. Jaim Zuber - Stylish Developers Guide to Unit Testing in Swift
Realm Academy. Ayaka Nonaka - Testing in Swift Protocols and ViewModels
Realm Academy. Jeff Hui - Testing in Swift
Realm Academy. Sam Soffes - DVR: Network Testing in Swift
Realm Academy. G. Tregoning & P. Zabelin - Successful Test-Driven Development on iOS


CocoaHeads Cincinnati (EN) Doug Sjoquist - Xcode UI Testing. The Good, the Bad, and the Ugly
CocoaHeads Dusseldorf (EN) Dominik Hauser - Test Driven iOS Development With Swift
CocoaHeads Kyiv (EN) John Sundell - Writing Swift Code with Great Testability
CocoaHeads Moscow (RU) Vadim Drobinin - Testing UI in xCode
CocoaHeads Moscow (RU) Igor Vasilenko - TDD Patterns and why Do We Need To Know About Them

Rambler & Co

Rambler & Co (RU) Rambler.iOS #5. Stas Tsyganov - VIPER & TDD
Rambler & Co (RU) Rambler.iOS #8. Egor Tolstoy - Clean Unit Tests
Rambler & Co (RU) Aleksandr Sychev - RDSDataSource: Clean tests with Swift
Rambler & Co (RU) Andrey Ryazanov - Test-Driven Development in iOS


Mobius 2019 (EN) Ewa Ludwiczak, Aleksander Grzyb — Layers of Testing in iOS Applications
Mobius 2016 (RU) Evgenyi Matsiuk — Writing Testable Code


fwdays (RU) Alexey Demedetsky - Unit Testing in Swift
NSSpain 2017. Dave Schukin - Why You Shouldn’t Write Tests (Yes, We’re Going There)
Swift London, Yvette Cook - Understanding Rx Swift using Rx Tests
Devoxx Belgium. Maxime David - How to test your awesome iOS mobile application?
MOConfBy, Eleni Papanikolopoulou - Venturing the world of Rx Swift Unit Testing
Pivotal Labs. Alex Tamoykin - Test Driven Development with Xcode
Jon Reid - Test Driven Development for iOS

💡 Docs, Blogs Posts and Written Tutorials:


Apple - Unit Testing Concepts
Andrew Bancroft - Unit Testing Model Layer with Core Data and Swift
Adam Borek - RxTest. How to test the Observable in Swift - How to Write Unit Tests in Swift
Alexander Grebenyuk - Rx Swift Testing
Alexander Murphy - The Guide to Unit Testing in Swift with Apollo and GraphQL (Part One) Matt Nedrich - Testing with Swift – Approaches & Useful Libraries - The Template for View Controller Unit Testing - Offline UI Testing on iOS with Stubs
Agranat Mark - Mocking in Swift with Sourcery (RU) - Automated UI Tests - Unit Testing in Swift - TDD with Quick & Nimble - How to test iOS apps with Combine, ReactiveSwift and Rx Swift


Bleeding Edge. Matthew Liam Healy - Writing better unit tests in Swift: Part One
Benoit Pasquier - Unit Testing your MVVM architecture in Swift
Benoit Pasquier - Rx Swift & MVVM - How to use Rx Tests to test your ViewModel


CocoaAcademy - Setup your iOS Testing Env
Cocoa with Love - Testing Actions Over Time
Chris Eidhof - QuickCheck-in Swift - Unit Testing iOS in Swift: A Testable Architecture - What Are You Testing - Write Better Code By Writing Unit Tests - How To Generate Code Coverage Reports In Xcode With Slather - How To Enable Code Coverage In Xcode - How to Mock and Stub a System Class in Swift: Part 1 - How to Mock and Stub a System Class in Swift: Part 2 - How to Mock and Stub a System Class in Swift: Part 3 - How to Unit Test Private Methods in Swift - To mock or not to mock - Does stubbing give you an empty feeling – am I stubbing too much? - Data independence is key to robust architecture and non-fragile unit tests - Seed data for your unit tests - How to mock an Apple built-in class - Advanced Dependency Injection - Unit Testing and TDD Terminology - How to Make Your Unit Tests Run Faster

F (Navdeep Singh) - How to run tests in Rx Swift
FlawlessApp Blog. ShihTing Huang - The complete guide to Network Unit Testing in Swift
FlawlessApp Blog. ShihTing Huang - Cracking the Tests for Core Data
FlawlessApp Blog. ShihTing Huang - Applying Unit Tests to MVVM with Swift
FlawlessApp Blog. Leandro Pérez - Memory Leaks in Swift (Testing for Leaks)

G - Using SwiftyMocky to generate mocks and simplify unit testing in Swift


Humble iOS Developer - Testing with Moya 101 - How to unit test your Realm database layer


iOS Unit Testing by Ron Lisle - TDD in Swift Playgrounds


Joe Susnick - How to test a Nib
John Reid (Quality Coding) - How to Make Specialized Test Assertions in Swift
John Reid (Quality Coding) - I’m Pretty Sure Most of Us Are Wrong about XCTestCase tearDown...
John Reid (Quality Coding) - Design Pattern for Tests that Do Real Networking
John Reid (Quality Coding) - How Does Swift Support Stubbing and Mocking?
John Reid (Quality Coding) - How to Design Swift Mock Objects
John Reid (Quality Coding) - Partial Mock: Have You Wished You Could Fake a Return Value in Swift?
John Reid (Quality Coding) - Swift Mock Objects: How to Avoid Fragile Tests
John Reid (Quality Coding) - Mocking Standalone Functions
John Reid (Quality Coding) - Swift Unit Testing Template


Krzysztof Zabłocki - Testing iOS Apps


Marco Santa - Test Doubles In Swift - Common unit testing techniques on iOS
Mike Ash - Writing Unit Tests - Testing callbacks in Swift with XCTest


NSHipster - Unit Testing


Marin Todorov - Testing your Rx Swift code, part 1
Marin Todorov - Testing your Rx Swift code, part 2
Marin Todorov - Testing with Rx Blocking, part 1
Marin Todorov - Testing with Rx Blocking, part 2

O - Issue #15: Testing
Oleg Dreyman - Taking Dependency Injection one step further with Swift


Practical iOS Dev - Four simple rules for architecting iOS unit tests

R - XCTest and Optional Unwrapping - Testing Your RxSwift Code - iOS Unit Testing and UI Testing Tutorial Dominik Hauser - Swift Unit Testing: Mocking Objects Audrey Tam - iOS Unit Testing and UI Testing Tutorial
Rodrigo Cavalcante - Unit Testing UITableView - How to Write Unit Tests in Swift 4
Robert C. Martin - The Cycles Of TDD
Robert C. Martin - The Pragmatics Of TDD - Flexible and Easy Unit Testing of CoreData Persistence Code


Swift 2 Go - How to test with fake data on ios
Swift by Sundell - Unit Testing
Swift by Sundell - Mock-free Unit Tests in Swift
Swift by Sundell - Unit Testing in Playgrounds
Swift by Sundell - Using Unit Tests to Identify and Avoid Memory Leaks
Swift by Sundell - Mocking in Swift
Swift by Sundell - Testing Swift Code That Uses System Singletons in 3 Easy Steps
Swift by Sundell - Time Traveling in Swift with Unit Tests
Swift by Sundell - Reducing Flakiness in Swift Tests
Swift by Sundell - Getting Started with xCode UI Testing in Swift
Swift by Sundell - Avoiding Force Unwrapping in Swift Unit Tests
Swift by Sundell - Making Swift tests easier to debug - How to unit test ViewModel in Swift
Shashikant Jagtap - Network Stubbing options for XCTest and XCUITest in Swift

V - Unit testing Rx Swift application


Yet Another Swift Blog by Vadim Bulavin - Real World Unit Testing in Swift

W - Can unit testing and CoreData become BFFs?

👨🏼‍💻 Checklists & Notes:

iOS Testing Manifesto (by Hesham Salman)
Unit Testing Patterns (by Clint Cabanero)
Testing Notes (by Ivan Kusalic)

📻 Podcasts:

FatalError - Getting Started with Unit Testing
FatalError - Hypothetical Testing Tricks
FatalError - Testing Your Network Layer
Podlodka podcast (RU) - Test-Driven Development
RayWenderlich - Unit Testing with Ellen Shapiro
Inside iOS Dev - Testing in Object-Oriented Applications
Inside iOS Dev - Introduction to Dependency Injection
Swift Unwrapped - Testing Swift

📺 Video Tutorials:

Alexito's World - Testing an operator with TestScheduler, Rx Swift RWDevCon 2016: Xcode UI Testing - Live Tutorial Session
Essential Developer - Building a Swift Quiz App with TDD and Modular Design
Swift Programming Tutorials - Testing Asynchronous Code in Swift 3 Brian Woong - What is Unit Testing, Why We Use It, and Sample Test Cases
Code Pro - iOS Unit Test Mocking Tutorial

📦 Awesome Curated Lists (Testing Tools/Frameworks)

Awesome-iOS Testing - iOS testing tools/frameworks.
Awesome-Swift Testing - Swift testing tools/frameworks.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
swift (7,528
ios (3,487
testing-tools (197
unit-testing (182
tdd (151
swift5 (110
test-driven-development (46
swift-4 (43
testing-framework (36

Find Open Source By Browsing 7,000 Topics Across 59 Categories