From Zero to Hero: Test-Driven Development in C#

Master the craft of Test-Driven Development from the basics to the most advanced concepts

About This Course

Test-Driven Development (or TDD for short) is one of the most essential software development practices. It is a practice based on the simple idea that instead of writing our code first and then later writing tests for it, we write our tests first, and then we write code that makes those tests pass. This approach has many advantages, from productivity gains to ensuring that our work doesn't get out of scope to ultimately writing better, focused code with cleaner interfaces and looser coupling. TDD can change the way we think about building software. In this course, Gui Ferreira will teach you everything you need to know to practice TDD, from the most basic concepts to some very advanced ones and make it part of your software development lifecycle.

Course Curriculum

5h 40m 9 sections
Welcome
01:37 Free preview
What will you learn in this course?
03:43 Free preview
Who is the course for and prerequisites
01:58 Free preview
What is TDD?
02:43
Benefits and drawbacks of TDD
07:11
"Test-First" vs "Test-After"
02:21
How to define a Unit in Unit Testing
03:23
Red-Green-Refactor cycle
03:12
The 3 Rules of TDD
02:42
Incrementalism
02:33
Section recap
00:24
The example we will work on
02:16
Creating a Testing List
05:56
Writing the first Tests
29:58
Using Tests as Documentation
07:21
Section recap
00:49
The example we will work on
01:14
Writing application level tests
06:56
What is a Test Double?
02:53
Building Dummies
02:40
Building Stubs
04:00
Building Spies
02:59
Building Mocks
09:49
Building Fakes
03:42
Fixtures, Setup, and Teardown
06:05
How to TDD on Integration Testing
03:39
Test-driving a Storage Adapter
25:08
Test-driving a REST API
19:48
Section recap
00:36
The example we will work on
00:29
Detroit vs London school
01:05
What is the Detroit School style?
01:42
What is the London School style?
02:11
Practicing TDD in a London School style
27:36
Section Recap
00:31
Naming Tests
02:35
How to organize tests
01:54
Applying Act-Arrange-Assert
02:29
Using 1 Assertion per test
02:35
Start from the end
03:10
Improving test readability
04:20
How to solve bugs with TDD
03:36
What are TDD Driving Patterns
00:47
Driving Patterns: Fake It
05:53
Driving Patterns: Triangulation
07:05
Driving Patterns: Obvious Implementation
03:00
The Four Rules to Simple Design
02:21
Anti-patterns and how to avoid them
06:45
Section recap
00:44
TDD in Agile software development and DevOps
07:39
How BDD and ATDD relate to TDD
05:09
How TDD relates to the Testing Pyramid
05:00
TDD and Source Control
05:59
Pair Programming when doing TDD
03:05
Defining Team testing policies
04:32
The value of Code Coverage when doing TDD
01:46
Using Mutation Testing to improve TDD skills
04:51
Handling Objections and Challenges to TDD Adoption
03:27
Section recap
00:48
The example we will work on
02:15
What is Legacy Code
01:36
How to use Approval Testing
10:44
Refactoring to Support Testing
26:53
Test-driving new Behaviour
06:34
Section recap
00:28
Conclusion
01:01

Meet Your Instructor

Gui Ferreira

Gui Ferreira

Guilherme Ferreira, also known as Gui, is a Minimalist Software Craftsman, passionate about simplicity and continuous learning. Gui is a Microsoft MVP for Developer Technologies, a Tech Speaker, a YouTuber, and a .NET content creator. With over 15 years of experience in software development, Gui went from Startups to Tech Giants. Along his journey, he got to know several hats, including Software Engineer, Architect, CTO, and Developer Advocate, gathering a diverse and invaluable skill set.

View all courses by Gui Ferreira

What's New

Getting Started: Building .NET Applications on AWS
course

Getting Started: Building .NET Applications on AWS

Learn how to build and deploy .NET applications on AWS using CDK, Lambda, DynamoDB, S3, and more.

Learn More
What's new in C# 14
blog

What's new in C# 14

This guide covers every new C# 14 feature, explains its benefits, and provides practical code examples to help you navigate how you can use them.

Learn More
Let's Build It: AI Chatbot with RAG in .NET Using Your Data
course

Let's Build It: AI Chatbot with RAG in .NET Using Your Data

Build a Retrieval-Augmented Generation (RAG) chatbot that can answer questions using your data.

Learn More
From Zero to Hero: SignalR in .NET
course

From Zero to Hero: SignalR in .NET

Enable enterprise-grade real-time communication for your web apps with SignalR.

Learn More
Deep Dive: Solution Architecture
course

Deep Dive: Solution Architecture

Master solution architecture and turn business needs into scalable, maintainable systems.

Learn More
Migrating: ASP.NET Web APIs to ASP.NET Core
course

Migrating: ASP.NET Web APIs to ASP.NET Core

A step-by-step process to migrate ASP.NET Web APIs from .NET Framework to ASP.NET Core.

Learn More
Getting Started: Caching in .NET
course

Getting Started: Caching in .NET

Let's make the hardest thing in programming easy for .NET software engineers.

Learn More
From Zero to Hero: Testing with xUnit in C#
course

From Zero to Hero: Testing with xUnit in C#

Learn how to test any codebase in .NET with the latest version of xUnit, the industry-standard testing library.

Learn More
Create a ChatGPT Console AI Chatbot in C#
blog

Create a ChatGPT Console AI Chatbot in C#

This walkthrough is your hands-on entry point to create a basic C# console application that talks to ChatGPT using the OpenAI API.

Learn More