Thoughts and questions on Pragmatic Unit Testing

2 points stroke me when reading this “Pragmatic Unit Testing” book : – in order to easily test some class, they suggest to open the required methods by making them protected. I had first to check that protected included package readability (it does) but still I think it’s going a bit too far : if [...]

fun with enums

i stumbled upon a very nasty corner-case using enums. i wont call it a puzzler, but you may want to try to predict the output of the following:  Java |  copy |? public enum Person { PETER, PAUL, MARY;  private Food favFood;  Food getFavFood() { return this.favFood; }  static void setPreference(final Person p, final Food f) { p.favFood = [...]

Design hint : introduce Null Object

I’m currently reading Refactoring from Martin Fowler. Overall, it’s an interesting book from which much could be said but tonight I would like to speak only of the “introduce Null object” hint provided in it. The basic idea is pretty simple, instead of checking for null return from various call, just provide a “null object”. [...]

gitready

If you share my interest in git, you may find gitready.com a very useful resource. unfortunately, the lack of good eclipse integration still keeps me away from using it in every day work.