Implementing the Singleton Pattern

Saturday, July 15 2017 smart-code

The Singleton design pattern is one of the most well known from the famous book by the Gang of Four, but it’s well overused and often poorly implemented. Let’s discuss why that is and how the singleton pattern can be properly implemented (hint: it’s easier than you think). In a follow-up post, we’ll discuss why you almost never want to do this.

Read more »

Custom Inspection Patterns in Resharper

Saturday, July 08 2017 visual-studio

I’m converting my Niche CommandLine library across to use Fluent Assertions. This means updating well over a hundred unit tests to use the new style. Fortunately, Resharper makes this a non-tedious task.

Read more »

Getting Started with FsCheck

Saturday, July 01 2017 testing

Can we just ignore the fact that the Getting Started post is my third in the series on FsCheck? This is what happens when I just start blogging about interesting things without planning out the series of posts in advance.

Read more »

Shrinking and Equality Testing with FsCheck

Saturday, June 24 2017 testing

In last week’s Property Testing with FsCheck, we saw how to write a couple of simple tests to check that an implementation of .Equals() was correct. We didn’t see what happens when the test fails, nor what we can do to make that failure easier to understand.

Read more »

Property Testing with FsCheck

Sunday, June 18 2017 testing

I’ve been writing some property tests with FsCheck and to say that the process has been bittersweet is a bit of an understatement. The good news is that writing property tests has successfully uncovered bugs. The bad news is that writing property tests has successfully uncovered bugs.

Read more »