15 years of insights
from a TDD
practitioner
Dennis Doomen
@ddoomen | Principal Consultant | Microsoft MVP
About Me
• Coding Architect
• .NET/C#
• Bit of TS/JS/React/Vue
• 28 years of experience
• Author of Fluent Assertions,
LiquidProjections, ChillBDD, Reflectify
• www.dennisdoomen.com
• BlueSky, Twitter, Mastodon, LinkedIn
What is this all about?
Test Driven Development can…
• …allow you to test things in isolation
• …help you design your code properly
• …give you and others confidence
• …be used as documentation
• …keep you out of the debugger hell.
@ddoomen | Principal Consultant | Microsoft MVP
The pragmatic
approach to TDD
Design
responsibilities
Write first test
Generate stubs
Fail (for the
right reason)
Implement
Ensure test
succeeds
Alternative
scenarios
Repeat twice
Refactor
@ddoomen | Principal Consultant | Microsoft MVP
Rules & Heuristics
Treat tests as
specifications
@ddoomen | Principal Consultant | Microsoft MVP
Coverage is a
means, not an end
@ddoomen | Principal Consultant | Microsoft MVP
Start by reviewing
the tests
@ddoomen | Principal Consultant | Microsoft MVP
Use grey box
testing
@ddoomen | Principal Consultant | Microsoft MVP
Use multiple levels
of testing
@ddoomen | Principal Consultant | Microsoft MVP
Exploratory
Testing
Browser
Testing
HTTP & API
Tests
Component &
Integration Tests
Unit Tests
Execution
Time
and
flakiness
Simplicity
&
Ease
of
debugging
@ddoomen | Principal Consultant | Microsoft MVP
Choose the
right scope
Sync folder
structures
@ddoomen | Principal Consultant | Microsoft MVP
Use concise fact-
based naming
@ddoomen | Principal Consultant | Microsoft MVP
Emphasize the
cause and effect
@ddoomen | Principal Consultant | Microsoft MVP
Show the
important stuff
@ddoomen | Principal Consultant | Microsoft MVP
Hide the
unimportant stuff
@ddoomen | Principal Consultant | Microsoft MVP
Example
Stay way from
fixture classes
@ddoomen | Principal Consultant | Microsoft MVP
Have clear
assertions
@ddoomen | Principal Consultant | Microsoft MVP
Don’t test
implementation
details
@ddoomen | Principal Consultant | Microsoft MVP
Don’t overuse
mocking
@ddoomen | Principal Consultant | Microsoft MVP
Service Service
Service Service
Service
Centralized
Service
Can use mocking
Can use
mocking
Can use mocking
Can use
mocking
Avoid
mocking
Avoid
mocking
Avoid
mocking
It’s okay to use a
real database
@ddoomen | Principal Consultant | Microsoft MVP
Characteristics Test Suite
Application
Legacy Code Base
Linux Test Container
SQL Server
Don’t give people
an excuse to not
run the tests
@ddoomen | Principal Consultant | Microsoft MVP
Don’t accept
flakiness
@ddoomen | Principal Consultant | Microsoft MVP
Introduce
characterization
tests
@ddoomen | Principal Consultant | Microsoft MVP
Characteristics Test Suite
Application
Legacy Code Base
Production Backup
Find me at
twitter: ddoomen
mastodon: @ddoomen.mastodon.social
bluesky: @ddoomen.bsky.social
email: dennis.doomen@avivasolutions.nl
slack: fluentassertions.slack.com
Bonus Content

15 Years of Insights from a TDD Practitioner (NDC Oslo)