How to apply unit test on DAOs in java
I don't know how to apply unit tests on data access layer. I am always
doubt that the data access layer whether should be tested. In my company,
we set a stable database to store unit test data and test data access
layer by running data access objects and check the data they get from the
stable database. In order to pass the unit tests, data in the stable
database can not be modified anymore.
I think it is a bad solution. But I don't know the solution to replace it.
I know a little about mock objects and I think that the mock object can
not perform tests on sql statements and resultset mappings. (correct?)
Could you tell me how to test DAOs?
I'd like to apply TDD to my project. How to test driven DAO developement?
regards
No comments:
Post a Comment