Why Doing Nothing May Crash Your Program
Please note, that what is describe in this article may at some times be a very simple version of how things really work. Also, please forgive me for generalizing a little bit. Visual Basic 6...
View ArticleFull statement coverage
When I read Ron Jeffries Soduko articles, I was wondering why he was writing such sloppy unit tests. He didn’t seem to test even half of the code he wrote. A short email conversation later I had...
View ArticleRefactoring vs performance optimization
The thought popped up into my mind a while ago, that there is actually a striking similarity between refactoring and performance optimization. Both of them… are meant to make the program better....
View ArticleScope control
Again, the book Test-Driven Development: By Example by Kent Beck provides me with an eye-opening experience. It explains how test-driven development is useful for scope control when developing....
View ArticleException Handling Policy – Throwing Exceptions
This is the first post in a series of four on exception handling. The series will cover what I think is a good and sound strategy for handling exceptions and errors in your application. It is written...
View ArticleException Handling Policy – Using Assertions
This is the second part in a series of four on exception handling and it focuses on an area related to exceptions — assertions. A quick summary of posts in this series: Throwing Exceptions Using...
View ArticleException Handling Policy – Catching Exceptions
This is the third installment in my series on sensible exception handling and will cover when and how to catch exceptions. To quickly summarize, the series looks as follows: Throwing Exceptions Using...
View ArticleException Handling Policy – Logging Exceptions
This is the last part of my series on exception handling which will deal with logging exceptions and other noteworthy events. A summary of the series: Throwing Exceptions Using Assertions Catching...
View ArticleTwo kinds of interfaces
An interface is a point of interaction between two systems and they are used extensively within the Java world. While the mechanics of interfaces always are the same, the semantics may differ. There...
View ArticlePrivate static methods might be a smell
I was extracting smaller methods out of existing big ones, in a class I was working on. Some of these extracted methods became “utility methods”: they would perform some operation on the parameters...
View ArticleWhat I learned from Kent Beck
This is a summary of what learned from a “Mastering TDD” course with Kent Beck. Given he is the creator of JUnit, I guess his thoughts on unit testing are worth considering. In some cases I might have...
View ArticleName classes for content, not usage
To make a class as universally usable as possible, name it after its content, not its intended usage. After all, the usage might change, and you may find a new area of use for the class which you...
View ArticleSeparate class for each id type
The code I’ve been looking at recently has quite some problems with managing various ids. The ids in the system are confusing on many levels, both syntactically and semantically. To begin with, there...
View Article