Jentsch Berlin

Scala Kata Session

This time we at Scala Usergroup Berlin toke a more practical approach than just talking. Together we tackled the kata FooBarQix from CodingDojo.org. FooBarQix is an extension of the classical BizzBuzz. It’s a simulates how code evolves when more and more features are added.

During the introduction I proposed a simple TDD cycle for this session:

  1. write a useful test, that tests only one feature and fails for the right reasons
  2. implement only as much is needed to make the test green
  3. optional, if and only if a pattern repeats three times: refactor your code.
  4. go back to step 1

The Scala Center provides simple templates to start new projects. With a simple sbt new scala/scalatest-example.g8 everybody was able to start quickly.

It was fun to see how the group applied different approaches to solve the Kata. This was the first time I saw property based testing used in this Kata.

That in turn started a discussion what to do if your code you want to test and the tests them self become nearly identical.