Unit Tests Before New Technology Adoption

One of the most frustrating things with legacy applications is the difficulty of harnessing them into test frameworks. Often they’re tightly coupled and it’s difficult to deal with. Usually if you’re just going in for a single bug fix it isn’t worth the effort of trying to put a unit test in.

From now on one of the items on my own mental checklist will be how to we test this new technology we’re adopting. If writing unit tests in applications using it are hard, difficult, or nigh well impossible, then there’s really no point in adopting it. If it’s really that great it should be testable. In other words things like Hibernate, Spring, and Drools are easy to test. Struts is a bit more painful because of inheritance and the web layer, but at least StrutsTestCase exists to ease the pain. Anything harder to test than that, EJBs for instance, don’t merit consideration.