.NET Rocks!

Valuable Testing with Egil Hansen

9 snips
Oct 9, 2025
Egil Hansen, a Microsoft MVP and creator of BUnit, dives into the world of app testing. He emphasizes the importance of creating valuable, durable tests that withstand changes. Egil discusses the balance between end-to-end and integration tests, and how to keep tests resistant to refactoring. He favors custom fakes over generic mocks for clarity, explores the potential of AI in generating and reviewing tests, and shares insights on mutation testing to uncover missing scenarios. With practical advice, he guides developers toward efficient testing practices.
Ask episode
AI Snips
Chapters
Books
Transcript
Episode notes
INSIGHT

Four Pillars Of Valuable Tests

  • Valuable tests deliver regression protection, resistance to refactoring, fast feedback, and maintainability as core pillars.
  • Egil recommends starting with integration tests and peeling into unit tests when business logic is hard to exercise through the public surface.
ADVICE

Start With Integration Tests

  • Start with integration tests to catch regressions across external dependencies and business logic.
  • Extract units for isolated, faster feedback only when integration testing becomes painful.
ADVICE

Avoid Implementation Details In Tests

  • Keep implementation details out of tests and test through the public, externally observable surface.
  • Encapsulate repetitive test setup in helper methods to avoid mass test changes when refactoring.
Get the Snipd Podcast app to discover more snips from this episode
Get the app