This course introduces Test-Driven Development (TDD) for Kotlin projects, covering the Red-Green-Refactor workflow, TDD mindset, and setup with JUnit. 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 TDD with Kotlin and JUnit
- Writing a Failing Test for TDD in Kotlin
- Implement the Minimal Sum Function
- Refactoring for Improved Readability and Maintainability in TDD
- Unit 2: Introduction to Generalization in TDD with Kotlin
- Write a Failing Test for the Sum Method in TDD
- Transition to the Green Phase in TDD
- Refactor Unit Tests to Use Parameterized Tests with JUnit
- Unit 3: Introduction to TDD in Kotlin with Practical Examples
- Write a Failing Test for Shopping Cart Calculation
- Calculate Total Cost in Shopping Cart
- Creating a Failing Test for Shopping Cart Total Calculation
- Implement the Minimal CalculateTotal Method
- Refactoring Cart Implementation in Kotlin
- Crafting Test Cases for Cart Total Calculation
- Calculate the Total Cost in Shopping Cart
- Refactor Using Kotlin's sumOf Method
- Unit 4: Introduction to Testing Environment Setup with Kotlin
- Refactor and Explore JUnit Testing Environment
- Writing JUnit Test Cases for User Class in Kotlin
- Refactor UserTest to Use @BeforeEach for User Instance Creation
- Group and Nest Email Related Tests
- Testing Invalid Email Exception Handling
- Email Validation Parameterized Testing in Kotlin
- Unit 5: Introduction to Managing Dependencies in TDD with Kotlin
- Testing Dependency Injection with UserManager in the Red Phase
- Implementing UserManager Class Methods
- Refactoring UserManager Test for Clarity
- Creating a Logging Feature with Test-Driven Development in Kotlin
- Implement Logging Behavior in UserManager's addUser Method
- Refactoring UserManager for Clarity and Maintainability
- Unit 6: Introduction to the AAA Pattern in Kotlin TDD
- Refactor Test Suite Using the AAA Pattern