Last one or two weeks I spend on reading a blog www.petrikainulainen.net.
I focused over testing. I'd like to find solutions of my problem with
testing a dao which use advanced pl/sql queries. Unfortunately I didn't.
However I get to know other valuable notices about testing. I will list
here the most important for me:
1) Test are benefit especially during maintenance (they describe, how application work) and during changing one of component,
2) Clean code in tests are the same important as in application code,
3) Tests, which are low quality, are unnecessary and you should change it or remove.
4) Don't test framework code. If you don't trust it, you shouldn't use it.
5) Separate unit tests and integration tests. You can do it in maven.
6) Don't do unit tests for dao, do integration tests.
7) Use determined data for test, then you won't have false-positive.
8) To prepare data to test you can use memory db and DbUnit to prepare data.
9) One test should test one logic thing. When it is tested many logic things, nobody now what's goes wrong when test failed.
10)
Never accept habit do tests after project deployment. It is almost
certain that it won't be time to do that and much more of cases you will
forget.
There is one thing that I didn't
find solution. How can I test my advanced queries build and executed
from Java? Queries uses some specific command for oracle database so I
can't use to test them other database. However maybe I should test them
from database side, not from Java side, but how to test mappings?
No comments:
Post a Comment