This course introduces Test-Driven Development (TDD) for C++ projects, covering the Red-Green-Refactor workflow, TDD mindset, and setup with Google Test. Learn best practices like SOLID principles and dependency injection, and explore TDD's impact on code quality and speed compared to traditional approaches.
Overview
Syllabus
- Unit 1: Introduction to Test Driven Development in C++ Using Google Test
- Writing a Test for a Non-existent Function in TDD
- Implementing the Sum Function for Test-Driven Development
- Refactoring the Sum Function in C++
- Unit 2: Introduction to Generalization in TDD Using C++ with Google Test
- Write a Failing Test for the Sum Function
- Transition to TDD Green Phase with Sum Method
- Refactor Unit Tests for Sum Function to Use Google Test Parameterized Tests
- Unit 3: Test-Driven Development in C++: Building a Shopping Cart with Google Test
- Test-Driven Development: Writing a Failing Test for CalculateTotal Method
- Implementing CalculateTotal for Shopping Cart
- Create a Failing Test for the CalculateTotal Function
- Implement Minimal Functionality for CalculateTotal to Pass Tests
- Refactor CartItem in Cart Implementation
- Crafting a New Test Case for CalculateTotal in C++
- Calculate Total Cost in Shopping Cart
- Refactor Cart Total Calculation Using std::accumulate
- Unit 4: Introduction to Testing Environment Setup in C++ Using Google Test
- Setting Up and Exploring Your Testing Environment in C++
- Verify User Creation with Unit Tests
- Refactor User Tests to Use Constructor Setup
- Grouping Related Tests Using Nested Classes in C++
- Write a Test to Validate Invalid Email Exception
- Writing Async Tests for User Fetch Functionality
- Unit 5: Introduction to Managing Dependencies in TDD Using C++ with Google Test and Google Mock
- UserManager Dependency Injection and TDD Exercise
- Implementing a UserManager Class in C++
- Refactoring User Management Tests in C++
- Capturing UserManager Logging Behavior Using TDD
- Implement UserManager with Logging Functionality
- Refactor UserManager for Improved Code Quality
- Unit 6: Introduction to the AAA Pattern in TDD Using C++ and Google Test
- Refactor Tests Using AAA Pattern in TaskList