<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><language>en-us</language><copyright>Copyright 2006</copyright><managingEditor>palrich@gmail.com</managingEditor><webMaster>palrich@gmail.com</webMaster><lastBuildDate>Sun, 05 Feb 2012 08:19:43 +0000</lastBuildDate><pubDate>Sun, 05 Feb 2012 08:19:43 +0000</pubDate><ttl>60</ttl><generator>WeirdLooking.com</generator><link>http://www.weirdlooking.com/</link><description>WeirdLooking.com: Michael Barton's Blog</description><title>WeirdLooking.com: Michael Barton's Blog</title><image><url>http://www.weirdlooking.com/images/feed.png</url><title>WeirdLooking.com: Michael Barton's Blog</title><link>http://www.weirdlooking.com/</link></image><item><title>glass box unit testing can bite me</title><dc:creator>Michael Barton</dc:creator><link>http://www.weirdlooking.com/blog/glass-box-unit-testing-can-bite-me</link><guid>http://www.weirdlooking.com/blog/glass-box-unit-testing-can-bite-me</guid><pubDate>Thu, 24 Apr 2008 09:32:37 +0000</pubDate><description>I&amp;rsquo;ve seen unit tests where everything touched by the code is mocked out, and the mocks are intelligent in such a way that the tests fail if the mocked methods aren&amp;rsquo;t all called with correct arguments.&amp;nbsp; It winds up being nearly a line for line check of the implementation of the code, and is about the most horrible thing I think I&amp;rsquo;ve ever heard of.&lt;br /&gt;&lt;br /&gt;I have basically the same problem with tests against private methods.&lt;br /&gt;&lt;br /&gt;Changing implementation details without changing behavior called &amp;ldquo;refactoring&amp;rdquo; and is one of the selling points of unit tests.&amp;nbsp; If a class behaves exactly the same today as it did yesterday, its unit tests shouldn&amp;rsquo;t suddenly &lt;span style=&quot;font-style: italic;&quot;&gt;fail&lt;/span&gt;, even if someone was mucking around inside it.&lt;br /&gt;&lt;br /&gt;If you just want to make sure nobody changes the code, why not get a checksum of the file?&amp;nbsp; It&amp;rsquo;ll be a lot less work and have about the same effect.&amp;nbsp; Ta freakin&amp;#39; da.&lt;br /&gt;&lt;br /&gt;And I&amp;rsquo;m not saying that there aren&amp;rsquo;t exceptions, just that they &lt;span style=&quot;font-style: italic;&quot;&gt;are&lt;/span&gt; exceptions.</description><category>programming</category><category>unit tests</category><comments>http://www.weirdlooking.com/blog/glass-box-unit-testing-can-bite-me#comments</comments><wfw:comment>http://www.weirdlooking.com/comments/102</wfw:comment><wfw:commentRss>http://www.weirdlooking.com/rss/comments/102</wfw:commentRss><slash:comments>1</slash:comments></item></channel></rss>
