WriteAsync .NET

Testing, coding, in that order.

Log once, throw many

In my list of unsavory exception practices, I mentioned logging overload as a common issue. It often arises in code like this: We can see that some of the individual actions have exception logging, but so does the entire outer…

By Brian Rogers | 21 October, 2015 | diagnostics | No Comments |
Read more

The testable adapter anti-pattern

Let’s say you’re writing a module to deal with Windows optional features. Following the guidance of the Ports/Adapters/Simulators design approach, you come up with a port IFeatures and an adapter WindowsFeatures. “I must make my adapter testable!” you exclaim, and…

By Brian Rogers | 14 October, 2015 | design, tdd | 1 Comment |
Read more

Find bugs for (almost) free

Want to find bugs in your code for (almost) free? Try static code analysis — a useful technique, though often maligned by developers for noise and “false positives”. If you need an appeal to authority to be convinced, see how…

By Brian Rogers | 7 October, 2015 | native | No Comments |
Read more

EventSource and rich payload data

Long ago, I wrote about EventSource, the simple and modern ETW-based tracing solution for .NET 4.5+. Much to the diagnosticians’ delight, EventSource continues to evolve in .NET 4.6. Check out Vance Morrison’s post describing the useful new “rich payload data”…

By Brian Rogers | 30 September, 2015 | diagnostics | No Comments |
Read more

The crumbling bridge to innovation

Technical debt is well-trodden ground in modern discussions of design and development. So-called “software rot” can damage team productivity and make every bug fix and feature addition all the more painful. Less often mentioned are the consequences of the same

By Brian Rogers | 23 September, 2015 | design | 2 Comments |
Read more

Dictionary and memory usage

Consider this code using Dictionary<TKey, TValue>: One might assume that the capacity (actually bucket count in this case) and memory usage will stabilize after repeatedly filling then clearing the collection. Unfortunately, this is not the case. Here is the output…

By Brian Rogers | 16 September, 2015 | design, diagnostics | No Comments |
Read more

Once is not enough

In the olden days of boxed software products, the “full test pass” was a borderline sacred ritual performed near the end of a release. Ostensibly, its purpose was to make sure all the product features worked as intended — for…

By Brian Rogers | 9 September, 2015 | distributed, testing | No Comments |
Read more

Oversubscribe now!

For small chunks of compute-bound work that must be offloaded to the background, you can choose from several APIs and patterns in .NET. In code written before .NET 4.0, you would probably use ThreadPool.QueueUserWorkItem. In modern day apps, you might…

By Brian Rogers | 2 September, 2015 | async, concurrency | No Comments |
Read more

Destroy all* test environments

Test environments are a liability. Sometimes they’re so good, they’re bad. Though most of the time they’re just bad. So what then, do we just test in production exclusively? Obviously it’s not that simple and there is a more nuanced…

By Brian Rogers | 26 August, 2015 | testing | No Comments |
Read more

Easier to test => better

Rick Mugridge presented a paper “Test Driven Development and the Scientific Method” at the 2003 Agile Development Conference. There he speaks of theory simplicity and draws a parallel between Occam’s razor and the (positive) pressure of TDD to “choose the…

By Brian Rogers | 19 August, 2015 | design, tdd | 1 Comment |
Read more
  • « Previous
  • Next »
Copyright ©2025 WriteAsync .NET | Theme by: Theme Horse | Powered by: WordPress