.NET Rocks!

Valuable Testing with Egil Hansen

Oct 9, 2025
Egil Hansen, developer and Microsoft MVP who created BUnit, talks testing strategy and tooling. He outlines four pillars of valuable tests. He compares integration vs unit approaches and favors externally observable behavior. He discusses custom fakes over mocks, using interfaces at system edges, mutation testing with Stryker, and how LLMs can write or review tests.
Ask episode
AI Snips
Chapters
Books
Transcript
Episode notes
INSIGHT

Four Pillars Of Valuable Tests

  • Valuable tests give confidence to deploy by protecting against regressions and resisting refactors.
  • Egil highlights four pillars: regression protection, refactor resistance, fast feedback, and maintainability.
ADVICE

Start With Integration Tests

  • Start with integration tests and peel into unit tests only when business logic is hard to test through public APIs.
  • Use integration testing by default and isolate units when needed for faster feedback.
ADVICE

Avoid Implementation Details In Tests

  • Keep implementation details out of tests and focus on externally observable behavior.
  • Test through the public surface so refactors of internals don't break valuable tests.
Get the Snipd Podcast app to discover more snips from this episode
Get the app