I have written in the past that I am not a big fan of testing. I have to change my tune a little bit. Building a library without testing would be insane. Building an application with just a little bit of testing is still ok in my book. My point? You always need testing of some kind, even if it is just a couple of tests. I find that I usually test validation and business logic the most in applications. I leave testing the front end to a human (because tweaking JSP's is hard to properly test) and the persistence layer is normally tested when you test the business logic. My friends tell me this is called integration testing. I call it "enough".
Until recently, I have never really been involved with writing a framework or library, so I didn't really have anything to base my opinions on when it came to that genre of code. I have been updating Jaxor to allow associating an entity with a list of entities with a single method call. Basically I am trying to make it easier to persist relationships. So, after making the changes that satisfy all of my initial tests, I wrote some more tests and they started failing. I fixed a couple of the problems that surfaced and wrote some more tests. It is very exciting to find a bug and know that it will not be coming back, because I have a test to prove that it is fixed. Testing is indispensable while building a library.
Posted by carl at August 23, 2004 12:11 AM
Comments