As a Software Engineer consultant in Zuhlke, I have an opportunity to work on various projects in various stages of development. Recently I have joined another existing project and I have found out again that we use Map<String, Object> too much, instead of mapping the objects to classes and benefit from all the goods of static typing. I think I have never before appreciated how powerful static typing is, and how much the lack of it can hurt (maybe that’s why I prefer to use Java over JavaScript?). The main reason for us to use maps is jdbi – we execute the SQL, we get back List<Map<String, Object>>. But mapping it to objects is too much effort so instead we keep working with maps. But what if mapping could be trivial and painless?

Recently I gave a presentation called “Bad Practices of Testing”. It shows the most common mistakes done while writing tests, describes problems they cause and shows how to do it better. Slides are done using github markdown so you can read it online here: https://github.com/Jarcionek/Bad-Practices-of-Testing

You have probably heard about modulo bias using random number generator. If you read Effective Java by Joshua Bloch this problem is described in Item 47. But did you ever think why there is a problem with simple code like this Math.abs(rnd.nextInt()) % n ? Why the distribution of elements is not equal and by how much is it exactly biased? Here is the mathematical explanation:

Recently when reviewing my code before opening a pull request, I have noticed a few methods that I felt were untested. I have run all tests with coverage and indeed 7 methods in the class were not covered. The class was a data object and all these 7 methods were mostly getters and setters so the following questions arose:

Recently I have been giving internal presentation in Gamesys about how to do Test Driven Development. A simple exercise is available in my github repository. Extra thanks to Mani Sarkar for his input in preparing this exercise.

Last year at King’s College London I have been doing a module called Software Engineering Group Project. I did not use git at that time, but as it is the biggest C++ project I have been working on, I decided to show our work now.Read the rest of this entry →