<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Object Mentor Blog: Testing Will Challenge Your Conventions</title>
    <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>Testing Will Challenge Your Conventions</title>
      <description>&lt;p&gt;If you are doing test-first development, you are likely to find your old coding conventions are no longer valid.  There are a few changes you will need to make to your coding standards and practices.&lt;/p&gt;


	&lt;p&gt;1. Interfaces suddenly seem like a really good idea when you have to start introducing test doubles of various flavors (mocks, etc).  You will find yourself creating interfaces in places where you probably would not have created them before.  You&amp;#8217;ve always known that you shouldn&amp;#8217;t depend or derive from concrete classes, and now you are feeling the pain of non-trivial concrete classes. You are forced, more or less, to comply with the Dependency Inversion Principle. Abstraction becomes a way of life.&lt;/p&gt;


	&lt;p&gt;2. Singletons and static methods no longer seem like a great way to do work (esp in C++) because you can&amp;#8217;t easily isolate a module that makes use of them.  The exception is when a static method is totally self-contained and testable, and does not use resources like a database, file system, etc. Only the very trivial can be static. Test doubles matter that much. Suddenly substitutability is a primary measure of code goodness.&lt;/p&gt;


	&lt;p&gt;3. Private makes less sense than it used to.  You can&amp;#8217;t test anything that&amp;#8217;s private.  You need to have ways to sense that your tests are working as intended, and you have to be able to test any method that is interesting. That means less private and more accessors.  Get used to living in a more public world.  If you need to hide something from users, don&amp;#8217;t include it in the interface or abstract base class. &amp;#8220;Implements&amp;#8221;/&amp;#8221;public inheritance&amp;#8221; is the new &amp;#8220;private&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;4. You need to be able to pass a class everything it might need at construction time, so that you can pack it a stubbed logger and a faked database access  module. Otherwise, you will not have the isolation you need to write good unit tests. Calling a concrete class constructor inside the body of a method now makes you cringe, because you realize you&amp;#8217;ve missed an opportunity for abstraction, and limited the isolation of your method.   The fat constructor argument list is a concession to the need for isolation and testing with mocks (and fakes, and stubs).&lt;/p&gt;


	&lt;p&gt;5. Smaller methods are the norm. It is hard to test a two-hundred line method.  It&amp;#8217;s far harder than testing a many smaller, equivalent methods. Whatever is easier to test is easier to write. Large is bad. This has always been so, since optimizers love simple functions, but now it&amp;#8217;s real to you as well.&lt;/p&gt;


	&lt;p&gt;6. You hate inheriting code without tests, because you don&amp;#8217;t want to reverse-engineer what the other programmer was thinking.  In fact, you find yourself looking at tests before you look at code, because you know the tests are better than comments. Testing becomes a kind of &amp;#8220;code clarity&amp;#8221; mechanism.  The profound bit is that code is more clear if it is more testable, even if you have to &amp;#8220;pollute&amp;#8221; the class to make it testable by moving variables and methods out of the private space or by creating interfaces, or by using fat constructor argument lists.  Testability is the new legibility.&lt;/p&gt;


	&lt;p&gt;7. Hard-to-use class interfaces are now hard for you to use, not just hard for other people. You have to write the tests, so you have to use the class. Usability determines how much you will like your own code, not cleverness.&lt;/p&gt;


	&lt;p&gt;8. Performance management by old wives tales is dead.  You will build for testability, and then use measurement tools to improve performance.  This is what the wizened greybeards have been telling us for a lot of years, and with &lt;span class="caps"&gt;TDD&lt;/span&gt; you start listening.  You stop avoiding trivial issues like copying &lt;span class="caps"&gt;PODS&lt;/span&gt; and virtual dispatches.  You pay attention to more important issues.  With optimization, &lt;span class="caps"&gt;YAGNI&lt;/span&gt; applies until it doesn&amp;#8217;t, and when it doesn&amp;#8217;t you need to know why and where.&lt;/p&gt;


	&lt;p&gt;9. You care deeply how long it takes to run the tests because you need to be able to run all of the tests all the time, after only a few lines of code are written, and after each refactoring.  If it&amp;#8217;s taking more than 20 or 30 seconds to run all your unit tests, you start looking for ways to speed it up.  You must maintain test performance, because it is key to productivity.&lt;/p&gt;


	&lt;p&gt;10. Dependency hurts.  You can&amp;#8217;t afford &amp;#8216;god classes&amp;#8217; and &amp;#8216;global hubs&amp;#8217;.  If test setup becomes a chore, you immediately start reaching for the axe.  You have to keep your modules isolated better than ever before.  Of course, you should have done this all along, but you never felt it this keenly.&lt;/p&gt;


	&lt;p&gt;11. &amp;#8220;Clever&amp;#8221; is dead. Clever is hard to refactor. Clever is hard to isolate, hard to internalize, hard to phrase in tests.  One point of &amp;#8220;obvious&amp;#8221; is worth two hundred points of &amp;#8220;clever&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;12. Your &lt;span class="caps"&gt;IDE&lt;/span&gt; is good to the extent that it allows you to do quick write/build/test cycles.  You need to do several per minute.&lt;/p&gt;


	&lt;p&gt;For the most part, &lt;span class="caps"&gt;TDD&lt;/span&gt; forces you to start doing the things you always should have done, though it signals a change in values that should be reflected in your coding standards.&lt;/p&gt;


	&lt;p&gt;Maybe you should get a highlighter and mark each section of your coding standard  or architectural document that encourages any practice that in turn discourages testability.  The world has changed, values have shifted,  and your style guide needs to change if it is to remain relevant.&lt;/p&gt;</description>
      <pubDate>Tue, 17 Jul 2007 22:28:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:b84c2373-e256-429f-a7c2-2e16528c9d81</guid>
      <author>tottinger</author>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions</link>
      <category>Tim's Tepid Torrent</category>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by http://directboattransport.com/</title>
      <description>&lt;p&gt;This post is exactly what I am talking about lots of people getting together and writing about subjects they enjoy! Thank you and maybe when you get time you can check out.&lt;/p&gt;</description>
      <pubDate>Thu, 09 Feb 2012 00:44:10 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:96e63252-f41c-4465-8618-6c50c9101137</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-202570</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by Andrew Reynolds</title>
      <description>&lt;p&gt;It&amp;#8217;s my time off from work and I figured I&amp;#8217;d stay indoors for a change. I was just perusing through a few internet sites that interest me and I came across this site. The Andrew Reynolds website that I also discovered was definitely informational. I had a greattime reviewing their blog posts and appraisals. Just the same, I believe that this webpage here is just exceptional. Many Thanks for allowing me to spend time on this blog. I will definitely anticipate coming back when I have yet another rest day at home.&lt;/p&gt;</description>
      <pubDate>Sat, 28 Jan 2012 04:28:18 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:3ca7a3d0-91de-4077-bc6d-222d9c6e1eb3</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-199679</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by loopband kopen</title>
      <description>&lt;p&gt;Great blogs I am Appreciating it very much! Looking Forward to Another Great article.
Good luck to the Author! all the best.&lt;/p&gt;</description>
      <pubDate>Sat, 21 Jan 2012 15:25:58 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:85d70d5d-cf32-4161-a211-99fdf47d9f33</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-198783</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by medicine forum</title>
      <description>&lt;p&gt;Very significant article for us ,I think the representation of this article is actually superb one. This is my first visit to your site
&lt;a href="http://www.drugdiscussions.com/" rel="nofollow"&gt;medicine forum&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Thu, 19 Jan 2012 09:13:38 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:1d115f83-8c01-44ad-94ca-6cbddeecf432</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-198604</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by drug forum</title>
      <description>&lt;p&gt;&lt;a href="http://www.drugdiscussions.com/" rel="nofollow"&gt;drug forum&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Thanks for your post, I like this post very much.&lt;/p&gt;</description>
      <pubDate>Wed, 18 Jan 2012 16:45:29 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:4ea3e0e5-bb42-4177-ac13-9177750310da</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-198522</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by Home Care</title>
      <description>&lt;p&gt;Testing is always a good thing. It&amp;#8217;s always good to challenge yourself and always be improving.&lt;/p&gt;</description>
      <pubDate>Mon, 09 Jan 2012 14:07:56 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:e35aa141-cda5-4939-86a1-138645517597</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-196402</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by psychometric test</title>
      <description>&lt;p&gt;You&amp;#8217;ll find nothing is more favorable in our existence than endless education. This is exactly why I constantly seek for more facts on the internet. As a writer, I often have to research diverse things. Right now, I&amp;#8217;m examining psychometric test. Then again, I came upon this page and I decided to post a message. I stumbled onto this page long before but I did not remember it. At this time, I&amp;#8217;m unquestionably gonna bookmark it for future reference.&lt;/p&gt;</description>
      <pubDate>Sat, 07 Jan 2012 03:28:10 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:ce577a43-eb0f-44ea-8d27-fe51fc5a52af</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-195846</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by online recruitment software</title>
      <description>&lt;p&gt;I was chatting with a friend on the telephone regarding online recruitment software and I was in front of the computer as well, then I found your internet site. Omg! I was impressed while reading things in your site.&lt;/p&gt;</description>
      <pubDate>Sat, 07 Jan 2012 01:48:57 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:c49d319d-eb76-42f8-a296-0247a060864a</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-195766</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by property to let reading</title>
      <description>&lt;p&gt;I was researching for some articles online about property to let reading when my educator instructed me to consider this web page. I at once realized why she was energized to share it to me.&lt;/p&gt;</description>
      <pubDate>Fri, 06 Jan 2012 23:28:49 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:a14a48bf-ffc4-4614-b26c-2d6ad9324d41</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-195722</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by glass fused tanks</title>
      <description>&lt;p&gt;Great write-up, I&#8217;m regular visitor of one&#8217;s website, maintain up the nice operate, and It is going to be a regular visitor for a lengthy time.&lt;/p&gt;</description>
      <pubDate>Fri, 06 Jan 2012 07:34:07 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:1e162d98-640b-486d-8944-7c2e6daf0f1c</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-195308</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by oakley frogskins</title>
      <description>&lt;p&gt;Read a lot of similar articles, but only found this article to my taste, thank you&lt;/p&gt;</description>
      <pubDate>Tue, 03 Jan 2012 23:42:49 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:f07f0f75-ac7e-4750-b08f-1b7ecd7f7c8e</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-194610</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by [url=http://www.1lgs.com/]seo company Los Angeles[/url]</title>
      <description>&lt;p&gt;Browsing the net seems to be one of my most preferred interests. Since I also fancy reading, I consistently have a terrific time reading short articles on the internet. Some scoops that I fancy to study have to do with SEO options on seo company Los Angeles. Internet marketing is just one focus of attention that I would enjoy to grasp. Anyway, Many Thanks for allowing me to post here. I truly relish it.&lt;/p&gt;</description>
      <pubDate>Tue, 03 Jan 2012 04:44:49 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:7749f773-4e4b-4193-acc2-1cd41249fdf2</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-194484</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by bamboo toys</title>
      <description>&lt;p&gt;Some of these are pretty cool. If would respect the list more if it weren&#8217;t so mac centric however. Nice list either way&#8230;&lt;/p&gt;</description>
      <pubDate>Mon, 02 Jan 2012 22:51:55 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:c9b99f70-1541-4b5e-bf91-282e03d3a6a7</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-194349</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by swivel chair</title>
      <description>&lt;p&gt;I seriously like looking through content rich pieces which help me determine the stuff that I prefer similar to the review about swivel chair    . I&#8217;m fortunate that I found a complete explanation of this product in your web page. It&#8217;s great to think about that you dished out insights in an innovative way.&lt;/p&gt;</description>
      <pubDate>Sun, 01 Jan 2012 23:45:43 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:4bb25e2d-e70e-4caa-9bf8-acd10f9303fe</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-194089</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by Andrew Reynolds Cash on Demand</title>
      <description>&lt;p&gt;I was finding more on virtual marketing and approaches when I found this web-site about Andrew Reynolds Cash on Demand. I was quite pleased with this marketing mogul so I made a choice to learn more on him. In any case, I chanced upon this web-site in the process and elected to post a review first. Thank you for allowing me to share my ideas here. Kudos!&lt;/p&gt;</description>
      <pubDate>Sun, 01 Jan 2012 23:43:58 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:109fe1a6-e34e-4289-9a0b-1ce7d2ac5ee7</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-194087</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by water filter melbourne</title>
      <description>&lt;p&gt;Fantastic post and comments have some gold nuggets in them also!&lt;/p&gt;</description>
      <pubDate>Fri, 30 Dec 2011 15:14:46 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:0c2e81cb-40d5-4a48-b732-81fe5935e93f</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-193760</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by beads</title>
      <description>&lt;p&gt;Excellent post! Thanks for sharing your experiences!&lt;/p&gt;</description>
      <pubDate>Fri, 30 Dec 2011 15:10:40 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:774fc49a-c230-46a6-9203-edf23e8197f6</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-193758</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by beads</title>
      <description>&lt;p&gt;Excellent post! Thanks for sharing your experiences!&lt;/p&gt;</description>
      <pubDate>Fri, 30 Dec 2011 15:06:41 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:a4d75375-fec0-4ab1-b04d-8d49378a7c51</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-193757</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by trampolines</title>
      <description>&lt;p&gt;During my days off, I seek out solace in reviewing editorials on anything at all that I feel like reading. A few days ago, I was skimming a story on trampolines. It really supported me acquire more awareness on the subject. At any rate, I also like posting comments and sharing my prospect so I came to a decision to put an opinion here. Thanks for letting me part my viewpoint and I hope to see editorials from this blog site soon enough.&lt;/p&gt;</description>
      <pubDate>Fri, 30 Dec 2011 00:56:05 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:8476ce12-a4a7-4727-8b38-d4bb90464cb0</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-193604</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by Training in web development</title>
      <description>&lt;p&gt;Nice post posted by the author.And this post is use full for those users who wanted to do a carer in Software testing.&lt;/p&gt;</description>
      <pubDate>Thu, 29 Dec 2011 06:44:21 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:7f52e703-472b-4125-b4e1-53c403a56074</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-193224</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by Roofer</title>
      <description>&lt;p&gt;Some really good tips here, great infomation, this was a really good read, will be looking out for more of your articles in the future,.All the best and thanks&lt;/p&gt;</description>
      <pubDate>Tue, 27 Dec 2011 04:36:39 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:69afe00c-bd85-4a71-9f25-40196904b5a7</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-192575</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by buy info</title>
      <description>&lt;p&gt;That is great ever experience and great way to get all the needed info.&lt;/p&gt;</description>
      <pubDate>Mon, 26 Dec 2011 18:53:25 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:fb27822f-61a5-4f5b-832f-18e921c3d2e2</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-192250</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by [url=http://ftnashville.com/nashville-personal-trainer-get-rid-of-the-fat-on-your-stomach-arms-and-legs]Nashville Personal Trainer[/url]</title>
      <description>&lt;p&gt;I appreciate you. I read your blog. These tips are really awesome. These tips are very helpful. Thanks for sharing very nice post.&lt;/p&gt;</description>
      <pubDate>Mon, 26 Dec 2011 07:35:42 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:160b333f-711a-46e0-aa4d-b1ed8171869d</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-192226</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by http://ftnashville.com/nashville-personal-trainer-get-rid-of-the-fat-on-your-stomach-arms-and-legs</title>
      <description>&lt;p&gt;I read your blog. These tips are really awesome. These tips are very helpful. Thanks for sharing very nice post.&lt;/p&gt;</description>
      <pubDate>Mon, 26 Dec 2011 07:32:45 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:42a08b44-1fa2-407b-897b-dab7874dcd00</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-192225</link>
    </item>
    <item>
      <title>"Testing Will Challenge Your Conventions" by Nashville Personal Trainer</title>
      <description>&lt;p&gt;I read your blog. These tips are really awesome. These tips are very helpful. Thanks for sharing very nice post.
&lt;a href="http://ftnashville.com/nashville-personal-trainer-get-rid-of-the-fat-on-your-stomach-arms-and-legs" rel="nofollow"&gt;Nashville Personal Trainer&lt;/a&gt;&lt;/p&gt;</description>
      <pubDate>Mon, 26 Dec 2011 07:31:30 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:fdf6cf75-dc1e-4205-9cd7-b98f89fce646</guid>
      <link>http://blog.objectmentor.com/articles/2007/07/17/testing-will-challenge-your-conventions#comment-192224</link>
    </item>
  </channel>
</rss>

