(clj 4) Learning about when, maps and closures

It's been more than two months since I did any Clojure - for the obvious reasons. Luckily I did take notes as I proceeded with chapter 3 of "Clojure for the Brave and True". So the plan is to process these notes into a blog post, which means this post will cover the sections "Data Structures" and "Functions" of that third chapter. Leaving me ready to proceed with the rest of the chapter, i.e. "Pulling It All Together" and the summary and exercises.

Why is there a when?

The part about control flow is actually before the part about and and or which I talked about in my previous post, but according to my notes I returned to it. I don't remember why to be honest.

The book provides the following example of when:

(when true
    (println "Success!")
    "abra cadabra")
; => Success!
; => "abra cadabra"

Read more…

It's time to retire our test case management tools

Recently the topic of test case management tools popped up a few times in my surroundings. In almost all cases I'd recommend against using these kinds of tools and I found myself able to give a few reasons, but also found that my thoughts lacked the clarity I'd like them to have. Hence this blog post, to force myself to think more deeply and communicate more clearly.

Before I go into that, there are a few things this blog post is not about. I won't be really going into what effect test cases have on test execution, or rather if test cases are a good tool to use when doing actual testing. Personally I don't think they are and I wrote about my inability to use them in this post from July 2013. For some deeper thoughts on this, I recommend James Bach's and Aaron Hodder's article "Test cases are not testing: Towards a culture of test performance".

What I do want to cover in this post is managing test cases. Having a collection of test cases stored somewhere to re-use across releases and reporting their pass/fail numbers. Both are important use cases for a test case management tool and both are in my opinion a bad idea.

Read more…