Wednesday, February 22, 2006

Boost

For a little while I've had this idea to create an open source library for utilities used for test driving. It seems that I'm not alone in this and recently the Boost library was made available. You can download the JAR (boost/boost) from the latest build.

For an even more eXtreme view, ContractualJ. Includes: all constructors are declared private and throw java.lang.UnsupportedOperationException, unless they are implicit constructors of anonymous classes and all contracts (interfaces) declare one (and only one) operation, unless they are composite interfaces, in which case, they make an effort to approach "Perfect Symbiosis of Contractual Operations" (to be defined). The only reference I found via Google was "How many bad ideas at once?" - an uninteresting post with some interesting discussion.

3 comments:

Rob said...

Hi Andrew,

I wish I had seen this earlier. One afternoon a couple months ago after a long pub lunch I sat down and implemented a generic ValueObject using reflection to automagically implement equals, toString, hashCode, compareTo and some auditing fields.

This would have saved some effort.. But I must admit it was pretty fun to implement after a few beers at the pub!

Does Boost provide any functionality other than the java.lang.Object methods? It may be worth the switch/refactor.

Rob.

Andrew said...

Yes it does. Here's a quick list:
* It lets you test drive Data objects. * It has the beginnings of Immutability testing.
* It also has a number of ways to remove nulls from your code.
* Reflection utilities for test driving properties of classes.
* Time utilities.
* Test driving JVM entry point.

Andrew said...

Hopefully I'll get a chance to add Spring wiring tests.