|
From: Marcelo de M. S. <cel...@gm...> - 2006-12-19 00:07:01
|
Hi Luke, thanks for the comprehensive explanation, >As far as building the client completely independently of the server, I would encourage you to integrate early and often. It's far too easy >to have these two pieces fall out of sync, or have unexpected needs arise during actual usage. A set of APIs that make sense in theory >often don't make nearly as much sense in practice. Hmmm, I thought this would be the greatest benefit as it would allow me to really focus on one thing at a time and then adjust the little inconsistencies later - isn't that what test-driven all about? (Design first, implement later, in this case implement the server-side later) Marcelo. On 12/18/06, Luke Bayes <lb...@gm...> wrote: > > Hey Marcelo, > > If you're using the XUL UI, you can ask it to create a Mock directly in > the interface and that should get it to generate the class under test, the > mock that extends it and a test case that uses the mock instead of the > class. > > We generally use mocks for our service layer and have them return faux / > expected results. > > The idea is basically, that you have a Service class and a ServiceMock > class that extends it. You can override each of the methods that call out to > the network and create a faux result set - hopefully one that makes sense. > > As far as building the client completely independently of the server, I > would encourage you to integrate early and often. It's far too easy to have > these two pieces fall out of sync, or have unexpected needs arise during > actual usage. A set of APIs that make sense in theory often don't make > nearly as much sense in practice. > > The primary benefit of mocking the service layer is that when someone on > one team or another breaks on half of the application (client or server), > the other team isn't held up waiting for a patch. > > As far as specific examples go, I'm not sure if there are any out there > right now - basically, you just extend the class under test, call the new > subclass ClassNameMock and use it in your TestCases... There are a couple of > good reasons to do this and many people name this object differently based > on it's purpose ( mock vs. stub<http://www.martinfowler.com/articles/mocksArentStubs.html>), > but I generally just name them 'mock' and get on with the task at hand. > > Please let me know if you need more clarification, and I'll see what we > can do. > > > Thanks, > > > Luke Bayes > www.asunit.org > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > > _______________________________________________ > Asunit-users mailing list > Asu...@li... > https://lists.sourceforge.net/lists/listinfo/asunit-users > > > |