Testing is architecture
Testability is one of the clearest indicators of architectural quality. If a system is hard to test, it is usually hard to understand, extend, or operate.
Blog
Notes from more than two decades of .NET engineering
APIs, architecture, testing, tooling and teamwork: practical lessons from real projects, with code you can use. Read the latest posts below or browse by series.
Testability is one of the clearest indicators of architectural quality. If a system is hard to test, it is usually hard to understand, extend, or operate.
Every abstraction has a price, paid in navigation, debugging and CPU time. What a mediator really costs you, why F12 suddenly lands on a record, the file convention that fixes most of it, and how to measure the runtime overhead yourself with BenchmarkDotNet instead of trusting anyone's numbers.
KQL has hundreds of operators and functions. A dozen of them cover almost every incident. The operators, functions and let tricks I reach for most, plus a complete health-check query and the integer-division bug hiding in it.
A fluent OData client makes a remote API feel like a DbContext, right up to the first query the server doesn't support. Lessons from integrating a CRM's OData API — server-side limits, client library bugs, a 10× performance gap and why plain HttpClient won.
Our Scrum Master started as an active facilitator who built tools and ran every meeting, then stepped back sprint by sprint until the team ran itself and the team architect guided the daily. Why that's the best outcome the role can have, and how to get there without a collapse.
A TransactionScope that worked for years suddenly throws after a driver upgrade, or the ambient transaction quietly vanishes after the first await. Why TransactionScope and async don't mix by default, the one option that fixes it, and the other defaults (Serializable, one minute, distributed transactions) worth knowing.
A Redis "timeout awaiting response" almost never means Redis is slow. The StackExchange.Redis timeout message contains everything you need to tell thread pool starvation, large values and an overloaded server apart, if you know how to read it.
A test called CalculateSomething with five asserts tells you one thing when it fails, and you have to run it five times to learn the rest. Naming conventions, test class structure and assertion habits that make a failing unit test explain itself.
User secrets are not encrypted, client secrets expire on a Friday, and the appsettings.json in your Git history still contains last year's password. Where secrets should live during development and in production, and how to stop needing most of them.
A story that asks for a search field describes a solution, not a problem. How we wrote user stories that describe the problem, an extended template for performance and deadlines, and acceptance criteria that are testable, scoped and free of implementation details.
A NuGet package whose version is 1.0.0 forever, or one that jumps whenever somebody remembers to edit the csproj, tells consumers nothing. How GitVersion derives semantic versions from your git history, how to configure it, and how to keep developers from forgetting the one thing it depends on.
A bug report says "placing an order with a voucher fails", and you open five folders to find the code. Why I organize backends around use cases instead of technical layers, what it costs, and how to keep the slices from leaking into each other.