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 and Test Doubles in C++ with Google Test
- Understanding EmailService and Unit Testing
- Enhancing DummyLogger with Severity Parameter in C++
- Email Service Test Bug Fixing
- Creating Test Dummies for Email Service
- Implementing Test Doubles with NewsletterService
- Unit 2: Using Stubs in C++ with Google Test and Google Mock for Test-Driven Development
- Weather Alert Service Task
- Weather Alert Service Implementation
- Replace Weather Service Stub with Google Mock in WeatherAlertService Tests
- Weather Alert Service Testing and Mocking
- Weather Alert System Testing Using Stubs
- Refactor Weather Alert Service to Use Condition Enum
- Unit 3: Integrating Spies in C++ Testing with Google Mock for Test-Driven Development
- Verify NotificationService Send Method Invocation
- Handling Urgent Notifications in NotificationService
- Setting Up Spies for Notification Service Testing in C++
- Testing Notification Service with Google Mock
- Unit 4: Integrating Mocks in C++ Testing with Google Mock for Test-Driven Development
- Mocking Dependencies in C++ Unit Tests
- Verifying Price Conversion Logic with Mocked Exchange Rate Service
- Verify ConvertPrice Method in PricingService for Negative Price Handling
- Custom Mock Implementations Using GoogleMock in C++
- Writing and Testing the CalculateBulkPrices Function in PricingService Class
- Unit 5: Integrating Fakes in C++ Testing with Google Test and Google Mock for Test-Driven Development
- User Registration Implementation Using In-Memory Repository
- Ensuring Unique Email Registration in UserService
- Update User Name in UserService Using Test-Driven Development
- Handling Non-Existent User Update in UserService
- Implementing and Testing DeactivateUser Method in UserService
- Implementing Exception Handling for Non-Existent User Deactivation