From: Steve F. <st...@m3...> - 2002-03-15 23:44:10
|
From: "Brian Denny" <br...@dl...> > but Version C is the only one of the three that really specifies what i am > trying to test. if i am writing a function to update a bunch of objects in > a database, what i care about is that the objects got updated correctly. i > don't care HOW they got updated. Version A and B both test that the update > happened a certain way. > > maybe this whole dilemma is the fault of JDBC, because it provides 2 > different *interfaces* for accomplishing the same functionality...? but on > the other hand, it would be nice to be able to write test code that would > pass even if i decided to re-implement my update() by making a raw socket > connection to the SQL server... it seems to me that, at some point, you have to exercise your jdbc code. When you come to do that, I hope you find mocks useful. If version C is what you want to achieve, then maybe you need some intermediate objects to buffer that which, in turn, can be mocked up? Steve |