Talk: Functional Mocking

Abstract

Mocking is an infamous technique from object-oriented programming. The goal is to be able to test stateful systems in small pieces by simulating the behaviour of certain objects. The problem with mocking is that it usually requires heavyweight frameworks and clutters test code. There are countless rants on that topic, but this talk isn't one. Instead, we'll explore the functional approach in Haskell: Designing a small language supporting the desired behaviour, and then writing interpreters which can execute its semantics in various ways. Testing I/O code was never easier.

Recording

Events

  • Lambda Days, Kraków, Poland, February 26th, 2015 Recording Slides Link
  • Regensburg Haskell Meetup, Regensburg, Germany, March 16th, 2015 Slides Link
  • Oslo Socially Functional Programmers, Oslo, Norway, June 23rd, 2015 Slides Link

Demo code

View on GitHub Gist