<?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-4863981320393275450.post8435596589147186423..comments</id><updated>2008-07-27T21:34:10.265+03:00</updated><category term='teamwork'/><category term='Visual Studio'/><category term='SharePoint Saturday'/><category term='funny'/><category term='bugs'/><category term='HowTo'/><category term='Ivonna'/><category term='Lint'/><category term='Berlin'/><category term='dotnetPro'/><category term='MSTest'/><category term='Uncle Bob Martin'/><category term='Roy Osherove'/><category term='Microsoft SharePoint'/><category term='KCDC 2010'/><category term='LIDNUG'/><category term='TDD'/><category term='Other'/><category term='Test Lint'/><category term='AAA'/><category term='Isolator++'/><category term='developer'/><category term='Events'/><category term='Typemock Academy'/><category term='See# Party'/><category term='NUnit'/><category term='dotnet Cologne 2010'/><category term='Nova CodeCamp'/><category term='Test Driven Development'/><category term='event sponsorship'/><category term='CRM'/><category term='QA'/><category term='Andreas Aschauer'/><category term='unit testing ASP.NET'/><category term='Design'/><category term='linkedIn'/><category term='Basics'/><category term='Extensions'/><category term='Challenge'/><category term='Webcast'/><category term='legacy code'/><category term='Britt King'/><category term='Poll'/><category term='beta'/><category term='DDFranken2010'/><category term='TeamMate'/><category term='brownfield projects'/><category term='Advanced'/><category term='tutorials'/><category term='build'/><category term='Agile'/><category term='clean code'/><category term='IDD'/><category term='unit testing'/><category term='asp.net'/><category term='testing'/><category term='Methodology'/><category term='&quot;Dror B Helper&quot;'/><category term='.NET'/><category term='Summer Sale'/><category term='Twitter'/><category term='slides'/><category term='Codecamp'/><category term='SilverLight'/><category term='Code Camp'/><category term='Intellitest'/><category term='Philosophy'/><category term='Visual Basic.NET'/><category term='&quot;online session&quot;'/><category term='CThru'/><category term='Microsoft Steve Ballmer'/><category term='SharePoint&#x9;Unit testunit testing'/><category term='Programming'/><category term='C++'/><category term='Community Day'/><category term='Support'/><category term='beginners'/><category term='Multi Threading'/><category term='ty'/><category term='Unit test'/><category term='Software'/><category term='typemock'/><category term='Advanced Developers Conference'/><category term='NDC 2010'/><category term='Office (VSTO)'/><category term='Facebook'/><category term='NWATechFest'/><category term='Isolation'/><category term='user groups'/><category term='Licensing'/><category term='Google Wave'/><category term='OpenXML'/><category term='Webinar'/><category term='SharePoint'/><category term='ALT.NET'/><category term='Richard Fennell'/><category term='videos'/><category term='Isolator'/><category term='VB'/><category term='Cool Tools'/><category term='Announcements'/><category term='Racer'/><category term='Told You So'/><category term='C#'/><category term='Tech Days'/><category term='devLink'/><category term='WCF'/><category term='Stefan Leiser'/><category term='Releases'/><category term='Linux'/><category term='WPF'/><category term='Concurrent'/><category term='Tips and Tricks'/><category term='gil zilberfeld'/><title type='text'>Comments on The Typemock Insider Blog: Is the visibility of tested methods important?</title><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://blog.typemock.com/feeds/8435596589147186423/comments/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default'/><link rel='alternate' type='text/html' href='http://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html'/><author><name>Sarit Rosenthal-Aviram</name><uri>http://www.blogger.com/profile/04647991154558467187</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>6</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-4863981320393275450.post-6012249154266132951</id><published>2008-07-27T21:34:00.000+03:00</published><updated>2008-07-27T21:34:00.000+03:00</updated><title type='text'>Now we are getting more to the point ;)&lt;br&gt;&lt;br&gt;Per...</title><content type='html'>Now we are getting more to the point ;)&lt;BR/&gt;&lt;BR/&gt;Personally I'd like to look at my test and immediately see that here I mocked a private (protected, internal) method. I, however, wouldn't want my test to break if I ever make this method public. So, I'd vote for the syntax that is valid for both public and non-public methods.&lt;BR/&gt;&lt;BR/&gt;Let's say that's my fraction of a vote, since I rarely do such things.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/6012249154266132951'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/6012249154266132951'/><link rel='alternate' type='text/html' href='http://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html?showComment=1217183640000#c6012249154266132951' title=''/><author><name>ulu</name><uri>http://www.blogger.com/profile/09205790793910716812</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://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html' ref='tag:blogger.com,1999:blog-4863981320393275450.post-8435596589147186423' source='http://www.blogger.com/feeds/4863981320393275450/posts/default/8435596589147186423' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-889150387'/></entry><entry><id>tag:blogger.com,1999:blog-4863981320393275450.post-2167354559870345617</id><published>2008-07-27T11:40:00.000+03:00</published><updated>2008-07-27T11:40:00.000+03:00</updated><title type='text'>Just to make things clear.&lt;br&gt;In any case the Isol...</title><content type='html'>Just to make things clear.&lt;BR/&gt;In any case the Isolator will support handling of all types of methods, including private,protected and internal methods.&lt;BR/&gt;&lt;BR/&gt;The real debate we are having is whether or not the programmer should explicitly state that he going to Mock/test a private method or not. Some of us think that since tempering with privates although needed,is somewhat out of main stream, we would like those reading the test to be clear about that (therefore the need for the NonPublic statement)</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/2167354559870345617'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/2167354559870345617'/><link rel='alternate' type='text/html' href='http://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html?showComment=1217148000000#c2167354559870345617' title=''/><author><name>Lior Friedman</name><uri>http://www.blogger.com/profile/09488722485273801828</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://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html' ref='tag:blogger.com,1999:blog-4863981320393275450.post-8435596589147186423' source='http://www.blogger.com/feeds/4863981320393275450/posts/default/8435596589147186423' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-322317141'/></entry><entry><id>tag:blogger.com,1999:blog-4863981320393275450.post-899090379297311248</id><published>2008-07-27T03:47:00.000+03:00</published><updated>2008-07-27T03:47:00.000+03:00</updated><title type='text'>Hi ulu,&lt;br&gt;&lt;br&gt;I'll have to say that neither Syste...</title><content type='html'>Hi ulu,&lt;BR/&gt;&lt;BR/&gt;I'll have to say that neither System.Web or System.Windows.Forms are good examples of frameworks or extensibility (too many private and internal things that prevent you from replacing behavior/functionality that is announced as replaceable).&lt;BR/&gt;&lt;BR/&gt;That being said, what I love about Isolator is that it doesn’t constrain my design (and bypassing validation, like Eli mentioned, is just one of the things I want to keep private) and allows me to make public only what I want and, at the same time, allows me to unit test (I call unit testing every method on its own for its all code paths) everything.&lt;BR/&gt;&lt;BR/&gt;Let me remind you that protected and internal members although not being public are not fully private. And I do like to test them.&lt;BR/&gt;&lt;BR/&gt;In conclusion, I like the way MSTest (only really tried VS2005 so far) exposes non public members and how Isolator handles it. And I wouldn’t like to loose it.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/899090379297311248'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/899090379297311248'/><link rel='alternate' type='text/html' href='http://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html?showComment=1217119620000#c899090379297311248' title=''/><author><name>Paulo Morgado</name><uri>http://paulomorgado.net/</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://img1.blogblog.com/img/blank.gif'/></author><thr:in-reply-to xmlns:thr='http://purl.org/syndication/thread/1.0' href='http://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html' ref='tag:blogger.com,1999:blog-4863981320393275450.post-8435596589147186423' source='http://www.blogger.com/feeds/4863981320393275450/posts/default/8435596589147186423' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-532192746'/></entry><entry><id>tag:blogger.com,1999:blog-4863981320393275450.post-4582243097737369192</id><published>2008-07-26T23:02:00.000+03:00</published><updated>2008-07-26T23:02:00.000+03:00</updated><title type='text'>Well, I forgot to add that everything I had said a...</title><content type='html'>Well, I forgot to add that everything I had said applies to isolating private methods as well.&lt;BR/&gt;&lt;BR/&gt;If a method has some semantic meaning (not just duplicated piece of code refactored), I usually want to test it isolated from the others, and when testing other parts, I don't want it to be tested along, so I stub it out. Such a meaningful method deserves to be publicly available, unless there are serious reasons to keep it private. So, for me, these things are closely related, testing, isolating, and making them public.&lt;BR/&gt;The noisy API can be a problem indeed, but there are ways to deal with that.&lt;BR/&gt;&lt;BR/&gt;That said, it's always nice to have options. Especially when it comes to legacy code, like your example &lt;BR/&gt;with HttpContext.&lt;BR/&gt;&lt;BR/&gt;Should it be harder to stub the privates? It refers to a popular opinion that certain restrictions of certain mock frameworks lead to a better design. While I do like the design decisions that are forced by such frameworks, I strongly believe that this is largely a matter of personal preference, and these decisions should not be made blindly, much less by framework restrictions. There are times when I need guidance, but I'd rather read a blog or two than blindly put myself in a restricted situation.&lt;BR/&gt;&lt;BR/&gt;This is also a matter of personal preference, of course.&lt;BR/&gt;&lt;BR/&gt;The bottom line is, I don't think that stubbing out private members is a good idea, but I'm happy that such an option exists.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/4582243097737369192'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/4582243097737369192'/><link rel='alternate' type='text/html' href='http://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html?showComment=1217102520000#c4582243097737369192' title=''/><author><name>ulu</name><uri>http://www.blogger.com/profile/09205790793910716812</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://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html' ref='tag:blogger.com,1999:blog-4863981320393275450.post-8435596589147186423' source='http://www.blogger.com/feeds/4863981320393275450/posts/default/8435596589147186423' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-889150387'/></entry><entry><id>tag:blogger.com,1999:blog-4863981320393275450.post-6730827079991592751</id><published>2008-07-26T14:11:00.000+03:00</published><updated>2008-07-26T14:11:00.000+03:00</updated><title type='text'>Although this is not what I was talking about, the...</title><content type='html'>Although this is not what I was talking about, the issue that you brought up is a known issue.&lt;BR/&gt;Some folks saying that you should make them public, while others (including mstest and mbunit) having ways to simply activate these methods that you have decided to be private.&lt;BR/&gt;&lt;BR/&gt;That said, having too many public methods has a price too - hard to learn, discover and prone to usage errors (you don't have to check for valid inputs to private methods, but do have to for public ones)&lt;BR/&gt;&lt;BR/&gt;But I was really talking about the visibility of &lt;B&gt;ISOLATING&lt;/B&gt; (stubbing out), not a way to use the code, but a way to isolate it.  &lt;BR/&gt;&lt;BR/&gt;Here there is a balance between having many API's (harder to learn) that will make the developer conscious and explicit of what they are isolating (and brittle when these change) to having one API (easier to learn) but implicit of the visibility of the methods the are insolating (perhaps loosing some flexability as you pointed out).</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/6730827079991592751'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/6730827079991592751'/><link rel='alternate' type='text/html' href='http://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html?showComment=1217070660000#c6730827079991592751' title=''/><author><name>Eli Lopian</name><uri>http://www.blogger.com/profile/12286680060833640916</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://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html' ref='tag:blogger.com,1999:blog-4863981320393275450.post-8435596589147186423' source='http://www.blogger.com/feeds/4863981320393275450/posts/default/8435596589147186423' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-1421418830'/></entry><entry><id>tag:blogger.com,1999:blog-4863981320393275450.post-876430534514633821</id><published>2008-07-25T20:24:00.000+03:00</published><updated>2008-07-25T20:24:00.000+03:00</updated><title type='text'>http://blog.typemock.com/2008/07/is-visibility-of-...</title><content type='html'>http://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html&lt;BR/&gt;Folks usually recommend moving such methods to another class and making them public; I'd say, either make them public unless you have really solid reasons not to. In which case, you don't want to test them. A public method is still another way of using your code, which makes your customers happier. &lt;BR/&gt;&lt;BR/&gt;For example, in Ivonna, I've got a couple of utility methods not related to testing at all, but I wanted to test them separately, so I made them public. Would be great if someone finds them useful, and they are harmless enough so they can't be really misused.&lt;BR/&gt;&lt;BR/&gt;On the other hand, I've spent countless hours of Reflectoring over System.Web in search of suitable public classes and methods in order to make Ivonna work (I'm quite proud that I don't use a single private member in it). That's because somebody has decided that the framework should be used in some particular way, and blocked all unexpected entries. It's like putting something in a cage instead of letting it run in the wild.</content><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/876430534514633821'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/4863981320393275450/8435596589147186423/comments/default/876430534514633821'/><link rel='alternate' type='text/html' href='http://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html?showComment=1217006640000#c876430534514633821' title=''/><author><name>ulu</name><uri>http://www.blogger.com/profile/09205790793910716812</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://blog.typemock.com/2008/07/is-visibility-of-tested-methods.html' ref='tag:blogger.com,1999:blog-4863981320393275450.post-8435596589147186423' source='http://www.blogger.com/feeds/4863981320393275450/posts/default/8435596589147186423' type='text/html'/><gd:extendedProperty xmlns:gd='http://schemas.google.com/g/2005' name='blogger.itemClass' value='pid-889150387'/></entry></feed>
