由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - unit testing of hibernate applications?
相关主题
test菜鸟问题
seam的examples里面的配置问题:感觉README里面少东西了,parameters to main????
现在hibernate这种流行框架help "java.lang.NoSuchMethodError"
Which POJO generator is better?Help with Tomcat for Eclipse v1.03
搞不懂为什么hibernate为什么这么流行?Help! J2ee online test?
JDBC还有人要Gmail吗?
hibernate question? session and hibernate.cfg.xmla garbage collection question
问题请教Java GUI Testing
相关话题的讨论汇总
话题: db话题: testing话题: data话题: unit话题: test
进入Java版参与讨论
1 (共1页)
c******n
发帖数: 4965
1
our previous developers just use our one and only single QA db, and assume
that the content is so and so, but over time, the content changes, so the
test cases all gradually fail..
what is your strategy in this case?
g*****g
发帖数: 34805
2
Use an embeded DB for testing purpose, clean and populate test data for
each test case.

【在 c******n 的大作中提到】
: our previous developers just use our one and only single QA db, and assume
: that the content is so and so, but over time, the content changes, so the
: test cases all gradually fail..
: what is your strategy in this case?

c******n
发帖数: 4965
3
but since the data is a HUGE (probably 300 nodes ) object graph,
probably inserting just one entry in a table would require us to put in
all the associated objects , constrained by foreign keys.
essentially we'd have to keep the entire DB dump for every release of the
test code.
true, this db dump can be very small, for derby or something

【在 g*****g 的大作中提到】
: Use an embeded DB for testing purpose, clean and populate test data for
: each test case.

g*****g
发帖数: 34805
4
Populate just enough data for testing purpose, you don't need to
maintain the test data between tests, that's what a unit test
is supposed to be. If that's not feasible, you are looking into
external DB depnedency and integration test instead.

【在 c******n 的大作中提到】
: but since the data is a HUGE (probably 300 nodes ) object graph,
: probably inserting just one entry in a table would require us to put in
: all the associated objects , constrained by foreign keys.
: essentially we'd have to keep the entire DB dump for every release of the
: test code.
: true, this db dump can be very small, for derby or something

c******n
发帖数: 4965
5
actually sometimes we need to go back to a previous version (back out some
changes), then if you don't keep the data source (a db dump ) in svn, when
you back out later changes, the old tests will fail

【在 g*****g 的大作中提到】
: Populate just enough data for testing purpose, you don't need to
: maintain the test data between tests, that's what a unit test
: is supposed to be. If that's not feasible, you are looking into
: external DB depnedency and integration test instead.

g*****g
发帖数: 34805
6
That's why you keep the schema and the data with the tests.
Different tests can use different schema and data if you wish.

【在 c******n 的大作中提到】
: actually sometimes we need to go back to a previous version (back out some
: changes), then if you don't keep the data source (a db dump ) in svn, when
: you back out later changes, the old tests will fail

S****h
发帖数: 558
7
There is a tool called dbunit. It can export the data (maybe also schema)
from database as xml and repopulate the database. Probably it can stand
for some schema change. http://www.dbunit.org/. It might be useful for you.

【在 c******n 的大作中提到】
: our previous developers just use our one and only single QA db, and assume
: that the content is so and so, but over time, the content changes, so the
: test cases all gradually fail..
: what is your strategy in this case?

c******n
发帖数: 4965
8
pretty neat, thanks!

【在 S****h 的大作中提到】
: There is a tool called dbunit. It can export the data (maybe also schema)
: from database as xml and repopulate the database. Probably it can stand
: for some schema change. http://www.dbunit.org/. It might be useful for you.

r*****s
发帖数: 985
9
理论上是个好办法,
实践上
maintaining the seed data is a headache,
especially with multiple types of dbs.
adding another db, like derby, becomes
a burden to both devs and dba, what made
it worse was that derby differs from other
dbs like mysql in some behaviors
(transaction? i forgot) and thus the unit tests
thread with the embedded db were evetually
abandoned.

【在 g*****g 的大作中提到】
: Use an embeded DB for testing purpose, clean and populate test data for
: each test case.

1 (共1页)
进入Java版参与讨论
相关主题
Java GUI Testing搞不懂为什么hibernate为什么这么流行?
how can I test own local IP addressJDBC
我是不是得了某种综合症?hibernate question? session and hibernate.cfg.xml
什么是functionality test?问题请教
test菜鸟问题
seam的examples里面的配置问题:感觉README里面少东西了,parameters to main????
现在hibernate这种流行框架help "java.lang.NoSuchMethodError"
Which POJO generator is better?Help with Tomcat for Eclipse v1.03
相关话题的讨论汇总
话题: db话题: testing话题: data话题: unit话题: test