Tired of inconsistent methods for quality assurance

I am not sure if quality assurance is the right term for what I’m trying to describe. As soon as you start something a little bit larger than the proof of concept project, you realise that something is wrong. The way you (I) handle potential errors is problematic in a couple of ways:

Code that ensures that certain conditions are satisfied in your classes is cluttering your class methods. These are secondary concerns in terms of what your class is supposed to do, and having to read code that ensures that constraints on method parameters are satisfied is not nice.

The defensive code is not written in the same way all the time, you do not focus on consistency of this code as much as you do for other parts of the code, or at least that is what I intend to do. This leads to a feeling of guilt, since I know that that aspect of my code is not as good as it should have been.

There are options to handle this problem in a consistent way, and JML is one of them. The reason I got interested in JML is that openEHR has significant parts of it implemented in Eiffel, and Eiffel has quite interesting features for providing what I’m looking for and more. Design By Contract is the paradigm which is supported by Eiffel in a strong and convenient way. JML looks promising, you can find papers, more than one implementation, Eclipse plugins etc… Unfortunately, I am bounded by some requirements like java 5 (generics is nice) and Eclipse (almost de facto now). Apparently none of the existing projects support this combination fully, and this is not good news.

I’ll be taking a look at AOP next, but I have to say I would have been much happier if java5 was supported by JML tools.