Discover the pivotal role of test doubles in modern software testing. This introductory session will guide you through the essentials of dummies, stubs, spies, mocks, and fakes. Learn how these powerful tools help you isolate units under test, control behavior, and build reliable, fast, and maintainable tests. Step into the world of test doubles and elevate your software development skills.
Overview
Syllabus
- Unit 1: Introduction to Dependencies in Testing with Swift
- Understanding EmailService with Dummies in TDD
- Enhancing DummyLogger with Severity Parameter in EmailService
- Fixing Test Suite for EmailService in Swift
- Enhancing EmailService with Dummy Dependencies in Swift
- Enhancing NewsletterService with Dummy Dependencies in Swift
- Unit 2: Implementing Stubs in Swift with XCTest for Test Driven Development
- Using Stubs to Test Weather Alert Service in Swift
- Using Stubs to Test Weather Alert Service in Swift
- Using Stubs to Test Storm Warnings in Weather Alert Service
- Using Stubs to Test Weather Alert Service in Swift
- Refactoring Weather Alert Service to Use MockWeatherService in Swift
- Unit 3: Integrating Spies into Test-Driven Development with Swift and XCTest
- Verifying Notification Sending with Spies in Swift
- Verifying and Handling Urgent Notifications in Swift
- Verifying and Handling Medium-Priority Notifications in Swift
- Verifying Multiple User Notifications with Spies in Swift
- Unit 4: Implementing Mocks in Test-Driven Development with Swift and XCTest
- Mocking ExchangeRateService in PricingService Tests
- Mocking ExchangeRateService to Avoid Unnecessary Calls in PricingService Tests
- Mocking ExchangeRateService to Handle Negative Amounts in PricingService Tests
- Mocking ExchangeRateService to Handle Different Exchange Rates in PricingService Tests
- Mocking ExchangeRateService to Calculate Bulk Prices in PricingService Tests
- Unit 5: Implementing Fakes in Test-Driven Development with Swift and XCTest
- Implementing User Registration with Fake Repository in Swift
- Implementing Duplicate Email Check in User Registration with Fake Repository in Swift
- Implementing User Name Update with Fake Repository in Swift
- Implementing Error Handling for Non-Existent User Name Update in Swift
- Implementing Error Handling for Non-Existent User Deactivation in Swift
- Implementing Error Handling for Non-Existent User Deactivation in Swift