<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Being Scott Densmore : Test Infection</title><link>http://blogs.msdn.com/scottdensmore/archive/tags/Test+Infection/default.aspx</link><description>Tags: Test Infection</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Visual Studio Team Developer - Undocumented feature in Unit Testing</title><link>http://blogs.msdn.com/scottdensmore/archive/2005/04/29/413485.aspx</link><pubDate>Fri, 29 Apr 2005 19:25:58 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:413485</guid><dc:creator>scottdensmore</dc:creator><slash:comments>4</slash:comments><comments>http://blogs.msdn.com/scottdensmore/comments/413485.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scottdensmore/commentrss.aspx?PostID=413485</wfw:commentRss><description>&lt;p&gt;During my whirl-wind tour of Whidbey I am taking the ride using VSTD (there is a joke ther somewhere &amp;lt;STD&amp;gt;).&amp;nbsp; Coming from NUnit / TDD.net and VS 2003, I was used to dealing with configuration through the configuration file myassembly.dll.config.&amp;nbsp; Now that I am using the tests from VS and looking at the new System.Configuration goo (tech term), I thought this feature was gone because I could not find any documentation.&amp;nbsp; Boy, was I wrong.&lt;/p&gt;
&lt;p&gt;All you have to do is create an App.config file, rename it to your assembly name .dll.conig and set the file to always be copied (click file and then look at the properties window, there is a drop down for that option), and by magic, the test runner uses this file.&lt;/p&gt;
&lt;p&gt;Hope this helps someone out there.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Now playing:&lt;/strong&gt; &lt;a href="http://phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults?artistTerm=King Crimson"&gt;King Crimson&lt;/a&gt; - &lt;a href="http://phobos.apple.com/WebObjects/MZSearch.woa/wa/advancedSearchResults?songTerm=Fallen Angel&amp;amp;artistTerm=King Crimson"&gt;Fallen Angel&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=413485" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scottdensmore/archive/tags/Test+Infection/default.aspx">Test Infection</category><category domain="http://blogs.msdn.com/scottdensmore/archive/tags/Visual+Studio/default.aspx">Visual Studio</category></item><item><title>"You Big Dummy"</title><link>http://blogs.msdn.com/scottdensmore/archive/2005/01/06/347830.aspx</link><pubDate>Thu, 06 Jan 2005 19:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:347830</guid><dc:creator>scottdensmore</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/scottdensmore/comments/347830.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scottdensmore/commentrss.aspx?PostID=347830</wfw:commentRss><description>&lt;p&gt;Why is it that I like to make things hard on myself?&amp;nbsp; I was doing some refactoring a class method ["Introduce Parameter Object"] and decided that I would just change the signature, rename the method, blah blah blah in one shot, why not, I was already there.&amp;nbsp; I can just hear Fred Sanford saying "You Big Dummy", go slow, one thing at a time, follow the steps.&amp;nbsp; &lt;/p&gt;&lt;p&gt;Actually it wasn't Fred, it was &lt;a href="http://oneagilecoder.agilestl.com/"&gt;Brian&lt;/a&gt;, and he promptly went over to my bookshelf, grabbed my &lt;a href="http://www.amazon.com/exec/obidos/tg/detail/-/0201485672/qid=1105038197/sr=8-1/ref=pd_csp_1/104-6101380-5855914?v=glance&amp;amp;s=books&amp;amp;n=507846"&gt;Refactoring&lt;/a&gt; book and hit me in the head with it.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=347830" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scottdensmore/archive/tags/Test+Infection/default.aspx">Test Infection</category><category domain="http://blogs.msdn.com/scottdensmore/archive/tags/Refactoring/default.aspx">Refactoring</category></item><item><title>You Get What You Pay For</title><link>http://blogs.msdn.com/scottdensmore/archive/2004/11/18/265733.aspx</link><pubDate>Thu, 18 Nov 2004 16:32:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:265733</guid><dc:creator>scottdensmore</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/scottdensmore/comments/265733.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scottdensmore/commentrss.aspx?PostID=265733</wfw:commentRss><description>&lt;p&gt;&lt;a href="http://dotnetjunkies.com/weblog/oneagilecoder"&gt;Brian Button&lt;/a&gt; was looking at some code today and saw this as&amp;nbsp;a test...&lt;/p&gt; &lt;p&gt;adRolesProvider = null;&lt;br /&gt;Assert.IsNull(adRolesProvider);&lt;/p&gt; &lt;p&gt;Enough said.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;UPDATE:&lt;br /&gt;&lt;/strong&gt;Just to be clear... Brian didn't write the test... just found it.&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=265733" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scottdensmore/archive/tags/Test+Infection/default.aspx">Test Infection</category></item><item><title>ReSharper .85 is out</title><link>http://blogs.msdn.com/scottdensmore/archive/2004/06/09/151978.aspx</link><pubDate>Thu, 10 Jun 2004 02:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:151978</guid><dc:creator>scottdensmore</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/scottdensmore/comments/151978.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scottdensmore/commentrss.aspx?PostID=151978</wfw:commentRss><description>&lt;div class="Section1"&gt; &lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;&lt;span style='font-size:12.0pt'&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;.84 was a huge performance improvement. I am hoping that this will even be better.&amp;nbsp; My question of the day&amp;hellip; will I miss this in Whidbey?&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=151978" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scottdensmore/archive/tags/Test+Infection/default.aspx">Test Infection</category></item><item><title>Resharper</title><link>http://blogs.msdn.com/scottdensmore/archive/2004/06/02/146787.aspx</link><pubDate>Wed, 02 Jun 2004 21:58:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:146787</guid><dc:creator>scottdensmore</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/scottdensmore/comments/146787.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scottdensmore/commentrss.aspx?PostID=146787</wfw:commentRss><description>&lt;div class="Section1"&gt; &lt;p class="MsoNormal"&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt; font-family:Arial'&gt;I have been using &lt;a href="http://www.jetbrains.com/resharper"&gt;Resharper&lt;/a&gt; for a while and until now I have stopped using it, but with version .83 I am very excited.&lt;span style='mso-spacerun:yes'&gt;&amp;nbsp;&lt;/span&gt; Extract method is here&amp;hellip; and it works.&lt;span style='mso-spacerun:yes'&gt;&amp;nbsp;&lt;/span&gt; I am still a little upset with the loading of the solution and it seems to take a while to parse, but that aside, I am in love.&lt;span style='mso-spacerun:yes'&gt;&amp;nbsp;&lt;/span&gt; I am so happy that they thought of developers like me who use the keyboard and gave me shortcuts for everything.. Now, if they would integrate unit testing into the IDE I would be thrilled&amp;hellip; I could have Team System today. With the project we are on toady, having rename is worth any price, because it not only changes it in the code, but in the comments as well.&lt;span style='mso-spacerun:yes'&gt;&amp;nbsp;&lt;/span&gt; I think everyone should try this out if they are looking for Whidbey features today.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt; font-family:Arial'&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p class="MsoNormal"&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt; font-family:Arial'&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=146787" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scottdensmore/archive/tags/Test+Infection/default.aspx">Test Infection</category></item><item><title>Can I Get a Tester?</title><link>http://blogs.msdn.com/scottdensmore/archive/2004/06/01/145836.aspx</link><pubDate>Wed, 02 Jun 2004 03:30:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:145836</guid><dc:creator>scottdensmore</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/scottdensmore/comments/145836.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scottdensmore/commentrss.aspx?PostID=145836</wfw:commentRss><description>&lt;div class="Section1"&gt; &lt;p&gt;&lt;font size="3" face="Times New Roman"&gt;&lt;span style='font-size:12.0pt'&gt;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;What makes a good tester?&amp;nbsp; I have pondered this question for a while.&amp;nbsp; I love testers because the make my code so much better, and I think they are extremely fascinating creatures&lt;/span&gt;&lt;/font&gt; &lt;font size="2" face="Wingdings"&gt;&lt;span style='font-size: 10.0pt;font-family:Wingdings'&gt;J&lt;/span&gt;&lt;/font&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;.&amp;nbsp; In a current project that we are working on, we have invoked the power of Unit Testing and some parts of Test Driven Development.&amp;nbsp; We have about ~100 - 150 Unit Tests per assembly, and each assembly is akin to framework code.&amp;nbsp; So now that we have these Unit Tests, the test cases that I see coming back from the testers seem just like our Unit Tests.&amp;nbsp; I have never given this much thought before, but by doing unit testing have we raised the bar for testers?&amp;nbsp; No longer can they just test all my public API&amp;rsquo;s with random data, because the unit tests cover 90% of that.&amp;nbsp; So what do testers have to do now?&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;I am definitely not a tester, but as a developer it is in my best interest to see the test guys that I work with succeed, so I thought I would give some interesting pointers to things I have found that might be useful in this space. The writings from &lt;a href="http://c2.com/cgi/wiki?BrianMarick"&gt;Brian Marick&lt;/a&gt;, &lt;a href="http://www.pettichord.com/"&gt;Bret Pettichord&lt;/a&gt; and &lt;a href="http://lisa.crispin.home.att.net/"&gt;Lisa Crispin&lt;/a&gt; I find very interesting. Bret&amp;rsquo;s article &lt;a href="http://www.stickyminds.com/sitewide.asp?Function=edetail&amp;amp;ObjectType=COL&amp;amp;ObjectId=6217&amp;amp;tth=DYN&amp;amp;tt=siteemail&amp;amp;iDyn=2"&gt;Where are the Testers in XP?&lt;/a&gt; I think answers most of my questions.&amp;nbsp; I would love to here thoughts from other testers out there on this topic so as&amp;nbsp; a developer I can learn more. &amp;ldquo;Can I get a witness?&amp;rdquo;&lt;/span&gt;&lt;/font&gt; &lt;font size="2" face="Wingdings"&gt;&lt;span style='font-size:10.0pt;font-family:Wingdings'&gt;J&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=145836" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scottdensmore/archive/tags/Test+Infection/default.aspx">Test Infection</category></item><item><title>Why Singletons are Evil</title><link>http://blogs.msdn.com/scottdensmore/archive/2004/05/25/140827.aspx</link><pubDate>Tue, 25 May 2004 07:18:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:140827</guid><dc:creator>scottdensmore</dc:creator><slash:comments>44</slash:comments><comments>http://blogs.msdn.com/scottdensmore/comments/140827.aspx</comments><wfw:commentRss>http://blogs.msdn.com/scottdensmore/commentrss.aspx?PostID=140827</wfw:commentRss><description>&lt;div class="Section1"&gt; &lt;p&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;While I did not write this, I totally agree with it.&amp;nbsp;&lt;a href="http://www.agilesolutionsgroup.com/"&gt;Brian Button&lt;/a&gt; is probably one of the most talented people I know, and I am sure he would love your feedback.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2'&gt;&lt;![if !supportLists]&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;&lt;span style='mso-list:Ignore'&gt;1)&lt;font size="1" face="Times New Roman"&gt;&lt;span style='font:7.0pt "Times New Roman"'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt; &lt;![endif]&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Singletons frequently are used to provide a global access point for some service.&lt;br /&gt; True, they do this, but at what cost? They provide a well-known point of access to some service in your application so that you don't have to pass around a reference to that service. How is that different from a global variable? (remember, globals are bad, right???) What ends up happening is that the dependencies in your design are hidden inside the code, and not visible by examining the interfaces of your classes and methods. You have to inspect the code to understand exactly what other objects your class uses. This is less clear than it could be. The urge to create something as a global to avoid passing it around is a smell in your design; it is not a feature of globals/singletons. If you examine your design more closely, you can almost always come up with a design that it is better and does not have to pass around tramp data to every object and method.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2'&gt;&lt;![if !supportLists]&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;&lt;span style='mso-list:Ignore'&gt;2)&lt;font size="1" face="Times New Roman"&gt;&lt;span style='font:7.0pt "Times New Roman"'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt; &lt;![endif]&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Singletons allow you to limit creation of your objects.&lt;br /&gt; This is true, but now you are mixing two different responsibilities into the same class, which is a violation of the &lt;a href="http://c2.com/cgi/wiki?SingleResponsibilityPrinciple"&gt;Single Responsibility Principle&lt;/a&gt;. A class should not care whether or not it is a singleton. It should be concerned with its business responsibilities only. If you want to limit the ability to instantiate some class, create a factory or builder object that encapsulates creation, and in there, limit creation as you wish. Now the responsibilities of creation are partitioned away from the responsibilities of the business entity.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2'&gt;&lt;![if !supportLists]&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;&lt;span style='mso-list:Ignore'&gt;3)&lt;font size="1" face="Times New Roman"&gt;&lt;span style='font:7.0pt "Times New Roman"'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt; &lt;![endif]&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Singletons promote tight coupling between classes&lt;br /&gt; One of the underlying properties that makes code testable is that it is loosely coupled to its surroundings. This property allows you to substitute alternate implementations for collaborators during testing to achieve specific testing goals (think mock objects). Singletons tightly couple you to the exact type of the singleton object, removing the opportunity to use polymorphism to substitute an alternative. A better alternative, as discussed in the first point above, is to alter your design to allow you to pass references to objects to your classes and methods, which will reduce the coupling issues described above.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p style='margin-left:.5in;text-indent:-.25in;mso-list:l0 level1 lfo2'&gt;&lt;![if !supportLists]&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;&lt;span style='mso-list:Ignore'&gt;4)&lt;font size="1" face="Times New Roman"&gt;&lt;span style='font:7.0pt "Times New Roman"'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt; &lt;![endif]&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;Singletons carry state with them that last as long as the program lasts&lt;br /&gt; Persistent state is the enemy of unit testing. One of the things that makes unit testing effective is that each test has to be independent of all the others. If this is not true, then the order in which the tests run affects the outcome of the tests. This can lead to cases where tests fail when they shouldn't, and even worse, it can lead to tests that pass just because of the order in which they were run. This can hide bugs and is evil. Avoiding static variables is a good way to prevent state from being carried from test to test. Singletons, by their very nature, depend on an instance that is held in a static variable. This is an invitation for test-dependence. Avoid this by passing references to objects to your classes and methods.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;p&gt;&lt;font size="2" face="Arial"&gt;&lt;span style='font-size:10.0pt;font-family:Arial'&gt;I hope this explains a little more fully my opinion of the singleton pattern. I have a small collection of links I found through Google of others, including Jim Hyslop and Herb Sutter, who share this opinion. Let me know if you'd like them.&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;/div&gt;&lt;div&gt;&lt;p&gt;[Now Playing: Metallica - Disposable Heroes (08:17)]&lt;/p&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=140827" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/scottdensmore/archive/tags/Test+Infection/default.aspx">Test Infection</category></item></channel></rss>