Property-based Tests for Coin Changer

November 27, 2016

While trying to better understand property-based testing, I was looking with a colleague for an example small enough to demonstrate the technique. The problem was that most small examples were too trivial, so that the property-based tests degenerated into simple reimplementations of the code under test. We eventually found a good example in the Coin Changer kata.

A coin changer should, for a given amount and a set of coin denominations, return the smallest number of coins that represents the given amount. For example, an amount of 42 cents in Euro denominations of #{200 100 50 20 10 5 2 1} should return '(20 20 2).

Read on →

The DRY Principle

August 26, 2016

One of the first sessions I joined at SoCraTes 2016 was on the DRY principle in software design and when to apply it and -- maybe more importantly -- when not to. DRY stands for "Don't Repeat Yourself", which is an important guideline when we want to write maintainable code or documentation. Having stuff duplicated comes with two problems:

  • we have to make changes to more than one place (or risk inconsistencies);
  • to do so, we have to first find all those places.
Read on →

The Framework Dilemma

August 7, 2016

Software development to me is creative and innovative work that rapidly changes the world we live in. This is a great part of what I love about it. At least in enterprise application development, however, software itself is rarely the source of innovation. It is merely an enabler for the business to change and innovate.

One of many interesting insights I took from a seminar with Tom and Kai Gilb was owed to Tom's casual remark that the business domain is the most enduring aspect of our software. After all, many business domains predate software development by hundreds if not thousands of years.

Read on →