Watchdogs have been longtime staples of the embedded systems space. But they are also quite useful for distributed services where it is advantageous to attempt automatic recovery from transient errors. When it comes to watchdog implementations, the stakes are understandably…
Async in the wild: WCF
WCF (client) is open source. An interesting side effect of this development is the opportunity for async enthusiasts to pore over some production-ready async code. Since WCF was released even before .NET 3.5, it has several clever patterns for sensibly…
Useful proxies
The proxy design pattern is widely used in remote communication scenarios, e.g. DCOM or WCF. But it has just as many uses closer to home. For example, perhaps you need the ability to read and write files in a directory,…
Blogging on logging
Everyone loves a log. A trace log can provide insight into the goings-on of a running system. An audit log gives you an important “paper trail” tracking who did what and when. An error log might be an important aid…
One box to rule them all?
If your distributed system supports some form of scale minimization, you may feel a temptation to solve a variety of semi-related problems with the same “one box.” It’s more efficient to reuse code, after all. Unfortunately, it is also easy…
Orchestrating race conditions
Many a programmer has struggled with unit tests and those pesky race conditions that are seemingly immune to them. Is it even possible to verify concurrency correctness using TDD? I am going to tell you that it is — sometimes.…
Scale minimization
Long ago, I wrote about high-level testing and alluded to scale minimization as a useful technique in doing so. In this post, I’ll explore this idea a bit more. What is scale minimization? You may have heard it referred to…
Wake up!
In Effective Unit Testing: A guide for Java developers, author Lasse Koskela writes about the scourge of the sleeping snail — slow tests littered with calls to Thread.sleep. His suggested alternative is perfectly sound and practical: turn nondeterministic waiting into…
From sync to async: SQL
Previously I discussed some common sync scenarios using network and file I/O and how they can be migrated to modern async patterns. Today I have an addendum about asynchronous programming with SQL connections. Let me start by saying that async…
Gratuitous complications: unit test fault injection
Sometimes things don’t need to be complicated. I would go so far to say most of the time things don’t need to be complicated. In the words of Uncle Bob Martin, “it is the software engineer’s job to make tough…