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 Kotlin
- Email Service Validation with TDD
- Implementing LogSeverity in EmailService
- Debugging and Fixing Unit Tests in EmailService
- Creating Dummies for Dependencies in EmailService
- Implementing Test Doubles with Interfaces in NewsletterService
- Unit 2: Introduction to Stubs in Testing with Kotlin
- Weather Alert Service Simulation Task
- Weather Alert Service Implementation and Testing
- Replacing Stub with Mockito Mock in WeatherAlertService
- Handling Storm Alerts in WeatherAlertService
- Weather Alert System Testing with Stubs in Kotlin
- Refactor WeatherData with Condition Enum in Kotlin
- Unit 3: Integrating Spies in Test-Driven Development with Kotlin
- Verify Interaction with Notification Service
- Handling Urgent Notifications in NotificationService
- Setting Up Spies for NotificationService Priority Testing
- Testing NotificationService with Mockito in Kotlin
- Unit 4: Integrating Mocks in Test-Driven Development with Kotlin
- Using Mocks in Unit Tests to Isolate Dependencies in Kotlin
- Mocking Exchange Rate Service in Kotlin
- Verify Exception Handling for Negative Price Conversion in PricingService
- Creating Custom Mocks with Mockito in Kotlin
- Writing Tests for calculateBulkPrices Method in PricingService Class
- Unit 5: Introduction to Fakes in TDD with Kotlin
- Implement User Registration Logic Using In-Memory Repository in Kotlin
- Preventing Duplicate Email Registration in User Service
- Update User Name Functionality in UserService
- Handling Non-Existent User Updates in UserService
- Implementing User Deactivation in Kotlin
- Test-Driven Development: Implement User Deactivation