Overview
Explore practical mocking techniques in Swift for efficient unit testing in this 27-minute conference talk from try! Swift Tokyo 2016. Discover how to create simple, maintainable mocks without relying on OCMock, focusing on key parts of your codebase. Learn about asynchronous tests, dependency injection, and best practices for mocking, including strategies for NSUserDefaults and time-dependent code. Gain insights into controlling complexity and the future of mocking in Swift from LinkedIn software engineer Veronica Ray, as she shares her expertise on writing fast, reliable tests that don't interfere with production data.
Syllabus
Intro
Asynchronous tests
Mock frameworks
Mocks take time
Why Mocks
Why Tests
Dependency Injection
Why use Dependency Injection
stub API
time machine
Mocking
Best Practices
NSUserDefaults
Time Traveler
Controlling Complexity
Future of Mocking
Taught by
try! Swift Conference