What's the verdict on the value of
testing data access classes and entity beans?
On the one hand, they're pretty straightforward and I can easily imagine an argument against having unit tests that (merely) set up some test data in a database, then call the DA to insert/update/delete, and assert on the resulting state of the database.
On the other hand, though, I have personally come across DAs and entity beans that fail in their simple task, and where a decent unit test would have caught it.
Personally, I write these simple unit tests because of the warm comfy feeling they give me about my code (this feeling is what Beck preaches, iirc).
I'm interested in arguments against?
PS. I don't, however, particularly see value in testing value objects and their accessors (ie that take a bunch of data in the constructor or through setters and hand it back out through getters) -- these should get effectively tested via unit tests for other code that uses them.
[ November 06, 2003: Message edited by: Allan Halme ]