From: Steve F. <st...@m3...> - 2005-05-30 11:16:32
|
Dmitri Colebatch wrote: > Thanks for the feedback, criticism always welcome. I hope you don't > mind me asking a few points though. of course. >>- the jdbc API is all interfaces, so I'd still suggest using jmock >>because it's easier to work with > I'm not sure how this would change the structure of the test. I'd > still be doing much the same as I am now yeah? yes, but I suspect you'd find the tests easier to work with. And, you can use less rigid constraints than just equals(), such as stringContains(). > Yeah fair call, I've extracted the method out into a method object to > facilitate this, thanks for the heads up. As an excuse I'm going to > state that I've just returned from a month long holiday (o: good start. > Yep, know what you're saying. But I also wanted to do something > test-driven, and was stuck trying to think of where I should put a > test that made me write the code. then start much, much smaller and work your way up. Try writing little helper objects test-driven. That's part of the MO approach, use mocks to identify helper objects which you fill in later. >>- What's all this mock container and aspect weaving about? If you want >> [...] > I have no idea (o: I just copied that from http://www.mockejb.org, > most of the setup method is from there. again. Start small and work your way up. If the tests have to be that complex, I'd rather find a fast container and run it in there. >>- Also consider a domain layer to manage persistence. This can be >>mocked out when testing the domain application code, and its real DB >>implementation tested separately. > Yeah, fighting that battle elsewhere (o: good luck. Again, you might consider one of the O/R mapping frameworks. Just make sure you don't let the mapping code leak out into the domain code. S. |