<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-34908752.post3316661595647211693..comments</id><updated>2008-10-21T15:51:21.083+01:00</updated><category term='jmock'/><category term='pictures'/><category term='growing object-oriented software'/><category term='news projects'/><category term='specification'/><category term='publications'/><category term='junit4'/><category term='news'/><category term='explanation'/><category term='talk'/><category term='process'/><category term='testability'/><category term='history'/><category term='mocks in action'/><category term='design'/><category term='eclipse'/><category term='book'/><category term='listening to the tests'/><category term='training'/><category term='domain-specific-language'/><category term='ide'/><category term='by the way'/><category term='tip'/><title type='text'>Comments on Mock Objects: "Stop Designing for Testability"</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://www.mockobjects.com/feeds/3316661595647211693/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default'/><link rel='alternate' type='text/html' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html'/><author><name>Steve Freeman</name><uri>http://www.blogger.com/profile/14771999065792016571</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>8</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-34908752.post-2473890548125025608</id><published>2008-10-21T15:51:00.000+01:00</published><updated>2008-10-21T15:51:00.000+01:00</updated><title type='text'>@Anonymous&lt;br&gt;&lt;br&gt;I think you're missing the point...</title><content type='html'>@Anonymous&lt;BR/&gt;&lt;BR/&gt;I think you're missing the point here. With DI, the intention is that the called code should not be making decisions about the implementation of significant neighbouring objects. It should focus on doing one thing well, otherwise it starts to cross domains and loses coherence. I've seen so much lucky-dip code like this that has to be taken apart to be reused.&lt;BR/&gt;&lt;BR/&gt;In your example, the Business Object should just receive an appropriate DAO. Any details about file systems or databases are not a matter of the logic of the business.&lt;BR/&gt;&lt;BR/&gt;It looks like you've been following the material from TypeMock. We simply disagree with their view for new code. We've been doing this for many years now, generally with good results.&lt;BR/&gt;&lt;BR/&gt;Next time, please consider signing your posting.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/2473890548125025608'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/2473890548125025608'/><link rel='alternate' type='text/html' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html?showComment=1224600660000#c2473890548125025608' title=''/><author><name>Steve Freeman</name><uri>http://www.blogger.com/profile/14771999065792016571</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html' ref='tag:blogger.com,1999:blog-34908752.post-3316661595647211693' source='http://www.blogger.com/feeds/34908752/posts/default/3316661595647211693' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1489300399'/></entry><entry><id>tag:blogger.com,1999:blog-34908752.post-3964069577727316042</id><published>2008-10-20T16:17:00.000+01:00</published><updated>2008-10-20T16:17:00.000+01:00</updated><title type='text'>Dependency Injection means that you instansiate th...</title><content type='html'>Dependency Injection means that you instansiate the object in the calling code and pass it to the code that needs it. This means two things..&lt;BR/&gt;&lt;BR/&gt;1) The calling code needs to know how to instanciate the dependancy and this may involve intricate business logic.&lt;BR/&gt;&lt;BR/&gt;2) The called code cannot make decisions about what object to use as it's simply passed in.&lt;BR/&gt;&lt;BR/&gt;An example is a Biz object calling a DAO. The DAO will most likley create a connection object and a command object. The specifics of these objects may be based on the availability of a persistent storage device (if the database is not available use the local file system). This decision affects both the command and the connection object. With the DI pattern, all four objects will need to be created and passed in whether they are needed or not!&lt;BR/&gt;&lt;BR/&gt;It is simply not correct to have to instansite all these objects simply to be able to prevent the called code from accessing the physical layer below when all we need to do is ensure that the method is called.&lt;BR/&gt;&lt;BR/&gt;If you want to be forced to write good code then use FX Cop - that's what it's for. A Mocking Framework is designed to test your code not force you to write somebody elses code.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/3964069577727316042'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/3964069577727316042'/><link rel='alternate' type='text/html' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html?showComment=1224515820000#c3964069577727316042' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html' ref='tag:blogger.com,1999:blog-34908752.post-3316661595647211693' source='http://www.blogger.com/feeds/34908752/posts/default/3316661595647211693' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2001325049'/></entry><entry><id>tag:blogger.com,1999:blog-34908752.post-7057284700222190655</id><published>2007-12-03T22:04:00.000Z</published><updated>2007-12-03T22:04:00.000Z</updated><title type='text'>As we keep saying, we don't expose internals, we m...</title><content type='html'>As we keep saying, we don't expose internals, we make dependencies explicit.We also find that taking testability into account pushes us towards what we think (IOHO) are better OO designs. Your mileage (whoever you are) may vary.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/7057284700222190655'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/7057284700222190655'/><link rel='alternate' type='text/html' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html?showComment=1196719440000#c7057284700222190655' title=''/><author><name>Steve Freeman</name><uri>http://www.blogger.com/profile/14771999065792016571</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html' ref='tag:blogger.com,1999:blog-34908752.post-3316661595647211693' source='http://www.blogger.com/feeds/34908752/posts/default/3316661595647211693' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1489300399'/></entry><entry><id>tag:blogger.com,1999:blog-34908752.post-8549218176375034378</id><published>2007-12-03T21:25:00.000Z</published><updated>2007-12-03T21:25:00.000Z</updated><title type='text'>exposing the implementation internals of a class t...</title><content type='html'>exposing the implementation internals of a class to consumers is BROKEN OOD. &lt;BR/&gt;&lt;BR/&gt;I don't care that the reason is to enable "testability."&lt;BR/&gt;&lt;BR/&gt;Simple as that.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/8549218176375034378'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/8549218176375034378'/><link rel='alternate' type='text/html' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html?showComment=1196717100000#c8549218176375034378' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html' ref='tag:blogger.com,1999:blog-34908752.post-3316661595647211693' source='http://www.blogger.com/feeds/34908752/posts/default/3316661595647211693' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-2135846698'/></entry><entry><id>tag:blogger.com,1999:blog-34908752.post-7060027009545750954</id><published>2007-05-06T10:42:00.000+01:00</published><updated>2007-05-06T10:42:00.000+01:00</updated><title type='text'>Thanks for commenting. I'd be curious to see what ...</title><content type='html'>Thanks for commenting. I'd be curious to see what your domain objects look like, whether it would be simpler just to use the real thing. It would be great if you could send me or post some examples.&lt;BR/&gt;&lt;BR/&gt;On the counter side, I've been working with a team who have some reasonably convoluted domain code. We could have shortcut the process with something like TypeMock, but (to me) the result of breaking things up with interfaces has produced a much clearer design.&lt;BR/&gt;&lt;BR/&gt;It looks like we really needed an extended bake-out, rather than both sides asserting their experience :)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/7060027009545750954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/7060027009545750954'/><link rel='alternate' type='text/html' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html?showComment=1178444520000#c7060027009545750954' title=''/><author><name>Steve Freeman</name><uri>http://www.blogger.com/profile/14771999065792016571</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html' ref='tag:blogger.com,1999:blog-34908752.post-3316661595647211693' source='http://www.blogger.com/feeds/34908752/posts/default/3316661595647211693' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1489300399'/></entry><entry><id>tag:blogger.com,1999:blog-34908752.post-3067158837698418200</id><published>2007-05-05T23:43:00.000+01:00</published><updated>2007-05-05T23:43:00.000+01:00</updated><title type='text'>This is atopic I find fascinating. I've kind of gi...</title><content type='html'>This is atopic I find fascinating. I've kind of given up on designing for testability as I found it complicated my designs in ways that weren't helpful.&lt;BR/&gt;&lt;BR/&gt;So although I agree with this...&lt;BR/&gt;&lt;BR/&gt; Reaching in to an object and manipulating its internals ties the test to the implementation and makes it brittle—which is the usual objection made against interaction testing&lt;BR/&gt;&lt;BR/&gt;..I have also found that TypeMock is useful. We quite often want to mock out domain classes (e.g. Customer/Order). I don't want to implement interfaces or include virtual methods in them just to allow mocking and in those cases I find TypeMock really helps.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/3067158837698418200'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/3067158837698418200'/><link rel='alternate' type='text/html' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html?showComment=1178404980000#c3067158837698418200' title=''/><author><name>Colin Jack</name><uri>http://www.blogger.com/profile/01403166737046938219</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html' ref='tag:blogger.com,1999:blog-34908752.post-3316661595647211693' source='http://www.blogger.com/feeds/34908752/posts/default/3316661595647211693' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1577156092'/></entry><entry><id>tag:blogger.com,1999:blog-34908752.post-2377570044248281074</id><published>2007-03-02T11:38:00.000Z</published><updated>2007-03-02T11:38:00.000Z</updated><title type='text'>Oops. Apologies and corrections.&lt;br&gt;&lt;br&gt;I guess I ...</title><content type='html'>Oops. Apologies and corrections.&lt;BR/&gt;&lt;BR/&gt;I guess I should also say that I was just teasing about the "legacy languages" bit. My favourite languages are older still.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/2377570044248281074'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/2377570044248281074'/><link rel='alternate' type='text/html' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html?showComment=1172835480000#c2377570044248281074' title=''/><author><name>Steve Freeman</name><uri>http://www.blogger.com/profile/14771999065792016571</uri><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html' ref='tag:blogger.com,1999:blog-34908752.post-3316661595647211693' source='http://www.blogger.com/feeds/34908752/posts/default/3316661595647211693' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1489300399'/></entry><entry><id>tag:blogger.com,1999:blog-34908752.post-9081244793154058190</id><published>2007-03-02T10:50:00.000Z</published><updated>2007-03-02T10:50:00.000Z</updated><title type='text'>Thanks for the support, but one small clarificatio...</title><content type='html'>Thanks for the support, but one small clarification: I'm not the developer of RhinoMocks - that would be Oren Eini (Ayende.com).&lt;BR/&gt;&lt;BR/&gt;Cheers!&lt;BR/&gt;&lt;BR/&gt;Roy Osherove&lt;BR/&gt;www.ISerializable.com</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/9081244793154058190'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/34908752/3316661595647211693/comments/default/9081244793154058190'/><link rel='alternate' type='text/html' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html?showComment=1172832600000#c9081244793154058190' title=''/><author><name>Anonymous</name><email>noreply@blogger.com</email><gd:image xmlns:gd='http://schemas.google.com/g/2005' rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://www.mockobjects.com/2007/03/stop-designing-for-testability.html' ref='tag:blogger.com,1999:blog-34908752.post-3316661595647211693' source='http://www.blogger.com/feeds/34908752/posts/default/3316661595647211693' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-233862429'/></entry></feed>
