
.NET Rocks! Valuable Testing with Egil Hansen
Oct 9, 2025
Egil Hansen, an author and Microsoft MVP, shares his expertise on creating valuable tests for .NET applications. He emphasizes that effective testing is not just for developers but should withstand changes over time. The discussion highlights the four pillars of a valuable test suite and the tradeoffs between integration and unit testing. Egil also dives into using AI for generating and reviewing tests, cautioning against the maintenance burden of AI-generated tests, and he introduces mutation testing to identify weak spots in test coverage.
AI Snips
Chapters
Books
Transcript
Episode notes
Use Major Versions To Drop Old Targets
- Avoid supporting obsolete target frameworks in libraries and plan breaking changes via major versions.
- Egil plans a BUnit v2 to simplify APIs and drop older framework cruft cleanly.
Four Pillars Of Valuable Tests
- Valuable test suites give confidence by protecting against regressions, resisting refactoring, providing fast feedback, and being maintainable.
- Egil prefers starting with integration tests and only peeling into unit tests when business logic is hard to test through the public surface.
Test The Public Surface, Not Internals
- Keep implementation details out of tests and instead test externally observable behavior where possible.
- Test through the public surface and only add isolated unit tests when internal complexity forces it.



