Author: Dominic Fox

Narrative-style testing with Bildungsroman

Bildungsroman, n. A novel whose principal subject is the moral, psychological, and intellectual development of a usually youthful main character. Narrative is a framework we developed at TIM Group in order to make it easier to write acceptance-level tests in Java. An example Narrative test looks like this: @Test public […]

Read More

Idempotency and its friends

We had a discussion recently about “idempotency” – about what it meant, and whether it was an appropriate term to use given its unfamiliarity outside of mathematics and computer science. The following is a short note I circulated with the intention of clarifying the term with a few examples. Potencies […]

Read More

Making It Easy with Lofty

One of the exciting new features of Scala 2.10 is Dynamic types, which enable you to write code like this: scala> import scala.language.dynamics import scala.language.dynamics scala> class StraightToConsole extends Dynamic {   |  def applyDynamic(name: String)(args: Any*) = println(name + “: ” + args)    | } defined class StraightToConsole scala> var […]

Read More

Mocking the proud

A mocking framework such as JMock provides a way of specifying and checking the interactions between an object under test and its collaborators, without having a full implementation of those collaborators to hand. However some prideful classes don’t like being mocked! Initially, when all we have is an interface specifying […]

Read More