Category Archives: Test

Testing principals

TDD with Venkat

Time for some education again. This time it’s Test Driven Development with Venkat Subramaniam (@venkat_s) Disclaimer: This is my own notes and my interpretation of things, NOT the teacher’s. I recommend you to take this course if you have the opportunity. Table of Contents Influences of TDD on Agility and Sustainability Circles of feedback Development speed Cost… Read More »

Features of Java generics

Java generics is a great feature introduced in Java 5, but it’s not that type safe that you would assume. The following example was found in our test code. dto.setFailingTask(new ArrayList(Arrays.asList(“Task1”, “Task2”)); where the setter looks like the following: public void setFailingTask(List<Task> aTasks) { tasks = aTasks; } So what’s going on here? The first… Read More »

Mock the Clock with an Aspect

Recently I have had problems with unit-tests that are time dependent. There are tests that test for time-out and similar time related issues. I felt that this mus be solvable by mocking the system clock. But I had problems doing it because I don’t want to change the whole implementation. The best is if it… Read More »

FizzBuzz kata with Akka

I recently was on a seminar about Akka with @DanielSawano and @DanielDeogun. They told us about how it works and there lessons learned when using it in a real business case (you can hear about it at Jfocus 3-5 February 2014 in Stockholm). So I thought let’s test it with a simple kata. So I… Read More »

TDD with Jasmine

Today I was asked if I could make the definition files that we must send to the Swedish tax agency. This files have a specific format that we can get our description on from there website. I though this was a perfect situation to test TDD with JavaScript using Jasmine.

Goodbye Hello World

It’s time to say goodbye to the old standard hello world program. Not because it don’t work, but because it is the wrong approach. I think it’s time to welcome Hello Test instead.

Mocking your server

Have you ever felt the the way of testing the client, especially error tests, can be hard and error prone due to modifications of the real server? That can be omitted by creating a simple server that mocks the real one and is easy to use directly in your unit test. I did so in a project that I… Read More »