A Java “DSL“ for Simple Unit Test Data Creation

I’m a person that usually writes tests before the implementation. In the context of my backup application project this has turned out to really slow me down. But it’s not just a problem of my personal projects. It also affects my professional work. 

Here’s the issue: for some tests you need test data and generating that test data can be a tedious task, depending on the complexity. This has caused me to procrastinate on my backup app. So, one evening, after having thought about this during a workout, I grabbed my laptop, sat down in my comfy bed and wrote a “DSL” that makes creating the data much simpler. Not only is it easier to create the data now, allowing me to continue at a faster pace, it’s also much more readable and the test setup doesn’t clutter the test case anymore. This is a very important aspect of a test. What good does it to have one if, after some time, you have to update it and don’t understand what it does anymore?

Read More »

Bad Coding Habit: Append Needless Words to Classes

This is a short opinion piece about a very good talk I’ve been watching recently. It was presented by Kevlin Henney and is about seven ineffective coding habits of many programmers. Not only is his style very engaging and entertaining, it also contains seven informational things a coder might want to think about. While I generally agree with all of it, there’s one instance where I can see why it is done – if that’s the actual reason is a question for another day. I’m talking about appending the word Exception to classes that are exceptions.Read More »