<?xml version="1.0" encoding="utf-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Unit Testing</title>
	<atom:link href="http://www.thejohnsonblog.com/2008/03/14/unit-testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thejohnsonblog.com/2008/03/14/unit-testing/</link>
	<description>Ramblings of a Computer Geek and his Wife...</description>
	<lastBuildDate>Fri, 03 Feb 2012 18:38:23 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: EJ</title>
		<link>http://www.thejohnsonblog.com/2008/03/14/unit-testing/comment-page-1/#comment-65660</link>
		<dc:creator>EJ</dc:creator>
		<pubDate>Tue, 15 Apr 2008 03:06:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.thejohnsonblog.com/2008/03/14/unit-testing/#comment-65660</guid>
		<description>I have heard some stories before about the need for rolling your own for pretty much everything.  Having dealt with a few commercial 3rd party packages/libraries, it&#039;s easy to understand this approach.

Did/do any of the 3rd party companies take up the offer to authenticate/test their software up to Defense levels?  It seems like that sort of thing could be a heck of a selling point for a software company to have (just guessing, it would cost a forture obviously)</description>
		<content:encoded><![CDATA[<p>I have heard some stories before about the need for rolling your own for pretty much everything.  Having dealt with a few commercial 3rd party packages/libraries, it&#8217;s easy to understand this approach.</p>
<p>Did/do any of the 3rd party companies take up the offer to authenticate/test their software up to Defense levels?  It seems like that sort of thing could be a heck of a selling point for a software company to have (just guessing, it would cost a forture obviously)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JohnG</title>
		<link>http://www.thejohnsonblog.com/2008/03/14/unit-testing/comment-page-1/#comment-65658</link>
		<dc:creator>JohnG</dc:creator>
		<pubDate>Mon, 14 Apr 2008 18:20:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.thejohnsonblog.com/2008/03/14/unit-testing/#comment-65658</guid>
		<description>I don&#039;t think this will help you much, but it&#039;s perspective might make you feel better.

When you test software for a real-time embedded-system like avionics for an airplane or torpedo, they take safety quite serious and it is a big issue, which proportionally relates to repeatable testing and documentation of such. And all our code was signed off by both the developer and the lead engineer responsible for it, audited by both internal QA and government GAO weenies.

The problem we would run into is using commercially provided compilers was compiler bugs and usage of code libraries in our RTES. There were two lines of thought.

1) Put the vendor compiler company on the hook contractually for authenticating the testing and integrity of their compilers and libraries. Most would only do this for many truckloads of money, in large denominations; or they just laughed at us.

2) Pick a compiler version and stick with it for all your testing, even if new version are available. Upgrading meant re-running all our tests. 
Only use the most basic mature compiler libraries i.e. math. Then write much more efficient dedicated code to replace calls to the commercial libraries. If you need a queue, write an efficient custom queue with minimal functions/methods/procedures. The equivalent library generic queue instantiation might be orders of magnitude larger and slower, and contain numerous unused methods which would never be used in our application, but still had to be tested if present. We could often cut the memory and or speed of applications by 25% upwards of 80+%. Plus we now had complete control of the source code. We only had to test what we used, not the entire vendor library. Then test it; and test it; and test it; until you want a new job.

And this is why aerospace projects cost so much (one of the reasons at least). But that&#039;s better than the airplanes falling out of the sky.
Did you know in French, an Airbus avionics s/w bug is pronounced &quot;pilot error&quot;!
In an Arian rocket, the French is &quot;special feature&quot;. In English it translates to &quot;floating point overflow&quot; that should have been caught in testing.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think this will help you much, but it&#8217;s perspective might make you feel better.</p>
<p>When you test software for a real-time embedded-system like avionics for an airplane or torpedo, they take safety quite serious and it is a big issue, which proportionally relates to repeatable testing and documentation of such. And all our code was signed off by both the developer and the lead engineer responsible for it, audited by both internal QA and government GAO weenies.</p>
<p>The problem we would run into is using commercially provided compilers was compiler bugs and usage of code libraries in our RTES. There were two lines of thought.</p>
<p>1) Put the vendor compiler company on the hook contractually for authenticating the testing and integrity of their compilers and libraries. Most would only do this for many truckloads of money, in large denominations; or they just laughed at us.</p>
<p>2) Pick a compiler version and stick with it for all your testing, even if new version are available. Upgrading meant re-running all our tests.<br />
Only use the most basic mature compiler libraries i.e. math. Then write much more efficient dedicated code to replace calls to the commercial libraries. If you need a queue, write an efficient custom queue with minimal functions/methods/procedures. The equivalent library generic queue instantiation might be orders of magnitude larger and slower, and contain numerous unused methods which would never be used in our application, but still had to be tested if present. We could often cut the memory and or speed of applications by 25% upwards of 80+%. Plus we now had complete control of the source code. We only had to test what we used, not the entire vendor library. Then test it; and test it; and test it; until you want a new job.</p>
<p>And this is why aerospace projects cost so much (one of the reasons at least). But that&#8217;s better than the airplanes falling out of the sky.<br />
Did you know in French, an Airbus avionics s/w bug is pronounced &#8220;pilot error&#8221;!<br />
In an Arian rocket, the French is &#8220;special feature&#8221;. In English it translates to &#8220;floating point overflow&#8221; that should have been caught in testing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EJ</title>
		<link>http://www.thejohnsonblog.com/2008/03/14/unit-testing/comment-page-1/#comment-65471</link>
		<dc:creator>EJ</dc:creator>
		<pubDate>Sat, 15 Mar 2008 16:19:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.thejohnsonblog.com/2008/03/14/unit-testing/#comment-65471</guid>
		<description>I like that David, I&#039;ll keep that in mind for future similar cases.  This particular instance is made quite a bit more tricky with the fact that the TimeUnit is also a private class and not exposed to other assemblies, but something could still be done as you suggest.

Very cool, thanks.</description>
		<content:encoded><![CDATA[<p>I like that David, I&#8217;ll keep that in mind for future similar cases.  This particular instance is made quite a bit more tricky with the fact that the TimeUnit is also a private class and not exposed to other assemblies, but something could still be done as you suggest.</p>
<p>Very cool, thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Rasch</title>
		<link>http://www.thejohnsonblog.com/2008/03/14/unit-testing/comment-page-1/#comment-65465</link>
		<dc:creator>David Rasch</dc:creator>
		<pubDate>Sat, 15 Mar 2008 02:58:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.thejohnsonblog.com/2008/03/14/unit-testing/#comment-65465</guid>
		<description>Seems like the perfect place for using some techniques common in Mock-ing for unit tests.  Can you not:
1. make the dictionary protected
2. extend the class and trigger the use of the derived class for your test (this second part can be super easy or more tricky, but hacks in this area can generally be avoided too with &quot;contexts&quot; to determine what type of object to create in some situations.  
3. in your extended class, have a public accessor for said dictionary?

(you may even be able to promote it to public in your derived class, don&#039;t remember enough C# to weigh in)

-David</description>
		<content:encoded><![CDATA[<p>Seems like the perfect place for using some techniques common in Mock-ing for unit tests.  Can you not:<br />
1. make the dictionary protected<br />
2. extend the class and trigger the use of the derived class for your test (this second part can be super easy or more tricky, but hacks in this area can generally be avoided too with &#8220;contexts&#8221; to determine what type of object to create in some situations.<br />
3. in your extended class, have a public accessor for said dictionary?</p>
<p>(you may even be able to promote it to public in your derived class, don&#8217;t remember enough C# to weigh in)</p>
<p>-David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EJ</title>
		<link>http://www.thejohnsonblog.com/2008/03/14/unit-testing/comment-page-1/#comment-65461</link>
		<dc:creator>EJ</dc:creator>
		<pubDate>Fri, 14 Mar 2008 18:48:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.thejohnsonblog.com/2008/03/14/unit-testing/#comment-65461</guid>
		<description>Hmmm, I didn&#039;t know about InternalsVisibleToAttribute.  I don&#039;t think I like that though, it feels way too much like a Friend Class (which I guess is what I&#039;m ultimately trying to do) but isn&#039;t compiled out.  I&#039;ll have to remember that one.

Using a Partial Class is something I didn&#039;t think about.  I wonder if on your Partial Class declaration if you can use the Conditional attribute to completely not include the partial portion.... I need to try that.</description>
		<content:encoded><![CDATA[<p>Hmmm, I didn&#8217;t know about InternalsVisibleToAttribute.  I don&#8217;t think I like that though, it feels way too much like a Friend Class (which I guess is what I&#8217;m ultimately trying to do) but isn&#8217;t compiled out.  I&#8217;ll have to remember that one.</p>
<p>Using a Partial Class is something I didn&#8217;t think about.  I wonder if on your Partial Class declaration if you can use the Conditional attribute to completely not include the partial portion&#8230;. I need to try that.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Troy Fury</title>
		<link>http://www.thejohnsonblog.com/2008/03/14/unit-testing/comment-page-1/#comment-65460</link>
		<dc:creator>Troy Fury</dc:creator>
		<pubDate>Fri, 14 Mar 2008 18:41:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.thejohnsonblog.com/2008/03/14/unit-testing/#comment-65460</guid>
		<description>What about this little gem?

System.Runtime.CompilerServices.InternalsVisibleToAttribute

You could allow your NUNIT dlls access to non-public types using this attribute.  Your example probably wouldn&#039;t work though (i.e., making a private field public to your unit tests dll.  I think the attribute only applies to entire types).  

You could hide NUNIT code in a partial class with #if NUNIT around it, too, if that does anything for ya.  Or hide code specific to exposing things to your NUNIT dlls.

Otherwise, I like the ConditionalAttribute idea.</description>
		<content:encoded><![CDATA[<p>What about this little gem?</p>
<p>System.Runtime.CompilerServices.InternalsVisibleToAttribute</p>
<p>You could allow your NUNIT dlls access to non-public types using this attribute.  Your example probably wouldn&#8217;t work though (i.e., making a private field public to your unit tests dll.  I think the attribute only applies to entire types).  </p>
<p>You could hide NUNIT code in a partial class with #if NUNIT around it, too, if that does anything for ya.  Or hide code specific to exposing things to your NUNIT dlls.</p>
<p>Otherwise, I like the ConditionalAttribute idea.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EJ</title>
		<link>http://www.thejohnsonblog.com/2008/03/14/unit-testing/comment-page-1/#comment-65459</link>
		<dc:creator>EJ</dc:creator>
		<pubDate>Fri, 14 Mar 2008 17:52:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.thejohnsonblog.com/2008/03/14/unit-testing/#comment-65459</guid>
		<description>Man, wordpress sure mangled that to hell.  Sigh.</description>
		<content:encoded><![CDATA[<p>Man, wordpress sure mangled that to hell.  Sigh.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

