<?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: Multithreaded Testing</title>
	<atom:link href="http://blog.carbonfive.com/2008/05/testing/multithreaded-testing/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.carbonfive.com/2008/05/testing/multithreaded-testing</link>
	<description></description>
	<lastBuildDate>Fri, 12 Mar 2010 00:31:40 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Anthony Williams</title>
		<link>http://blog.carbonfive.com/2008/05/testing/multithreaded-testing/comment-page-1#comment-148</link>
		<dc:creator>Anthony Williams</dc:creator>
		<pubDate>Fri, 24 Oct 2008 14:41:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog/?p=29#comment-148</guid>
		<description>I forget who it was who said &quot;testing can&#039;t prove a system correct; it can only demonstrate that it isn&#039;t&quot;.

Testing is all about getting confidence that your code is correct. As you say, this technique can find bugs, and so when it then ceases to find bugs in a given bit of code even as you increase the load it gives you confidence that your code is working.

However, I&#039;ve been doing lots of multi-threaded work in C++ recently, and I&#039;m painfully aware that multi-threaded synchronization is one aspect that is particularly hard to test: you need to carefully think through the synchronization requirements before coding.</description>
		<content:encoded><![CDATA[<p>I forget who it was who said &#8220;testing can&#8217;t prove a system correct; it can only demonstrate that it isn&#8217;t&#8221;.</p>
<p>Testing is all about getting confidence that your code is correct. As you say, this technique can find bugs, and so when it then ceases to find bugs in a given bit of code even as you increase the load it gives you confidence that your code is working.</p>
<p>However, I&#8217;ve been doing lots of multi-threaded work in C++ recently, and I&#8217;m painfully aware that multi-threaded synchronization is one aspect that is particularly hard to test: you need to carefully think through the synchronization requirements before coding.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: christian</title>
		<link>http://blog.carbonfive.com/2008/05/testing/multithreaded-testing/comment-page-1#comment-147</link>
		<dc:creator>christian</dc:creator>
		<pubDate>Thu, 23 Oct 2008 15:49:09 +0000</pubDate>
		<guid isPermaLink="false">http://blog/?p=29#comment-147</guid>
		<description>I&#039;m not sure when I last saw a software engineering &quot;silver bullet&quot;; perhaps never.

This style of testing should be used sparingly and only to assert behavior that can&#039;t be tested some other, more deterministic way.  I do think it can be very effective, and while there is always a chance the &quot;bad behavior&quot; doesn&#039;t surface for small sets, that chance rapidly nears zero once you increase the sample and thread sizes.  For example, for the project where this technique was first employed, we consistently saw issues with sample sets as small as 10 with 2 threads.  When we were close a solution, we cranked the sample set to 1k and 5k with 50-100 threads to see if it would break under extreme load.  With that data size and load, we were confident that we&#039;d found the right solution.

There may be scenarios where multi-cpu configurations expose some unexpected behavior, but in the example and sample code, there are no such scenarios.  There is no shared state between invocations and you can run as many concurrent threads as the VM can handle, on any number of CPUs without issue.  It&#039;s a rather simple solution to fairly common real world problem.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not sure when I last saw a software engineering &#8220;silver bullet&#8221;; perhaps never.</p>
<p>This style of testing should be used sparingly and only to assert behavior that can&#8217;t be tested some other, more deterministic way.  I do think it can be very effective, and while there is always a chance the &#8220;bad behavior&#8221; doesn&#8217;t surface for small sets, that chance rapidly nears zero once you increase the sample and thread sizes.  For example, for the project where this technique was first employed, we consistently saw issues with sample sets as small as 10 with 2 threads.  When we were close a solution, we cranked the sample set to 1k and 5k with 50-100 threads to see if it would break under extreme load.  With that data size and load, we were confident that we&#8217;d found the right solution.</p>
<p>There may be scenarios where multi-cpu configurations expose some unexpected behavior, but in the example and sample code, there are no such scenarios.  There is no shared state between invocations and you can run as many concurrent threads as the VM can handle, on any number of CPUs without issue.  It&#8217;s a rather simple solution to fairly common real world problem.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anthony Williams</title>
		<link>http://blog.carbonfive.com/2008/05/testing/multithreaded-testing/comment-page-1#comment-146</link>
		<dc:creator>Anthony Williams</dc:creator>
		<pubDate>Thu, 23 Oct 2008 10:43:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog/?p=29#comment-146</guid>
		<description>Though this technique is certainly useful, and something that I&#039;ve applied myself, it is worth noting that this is not a flawless technique. What it does is throw a load of threads at a problem and see whether anything bad happens. However, if there is a race condition that is especially timing-sensitive, this sort of testing still won&#039;t necessarily find it: it may well happen that the bad timing just didn&#039;t happen. You can bet that race conditions that don&#039;t happen in testing *will* happen on your customer&#039;s system.

Also, there is the issue of visibility. On single CPU systems, or dual-core systems that share a cache between cores, threads may see changes to data made by other threads even when suitable synchronization is not being used. If the application is then run on a true multi-processor system, such latent bugs may be exposed.

So: this is a worthwhile tool to have, but it&#039;s not a silver-bullet.</description>
		<content:encoded><![CDATA[<p>Though this technique is certainly useful, and something that I&#8217;ve applied myself, it is worth noting that this is not a flawless technique. What it does is throw a load of threads at a problem and see whether anything bad happens. However, if there is a race condition that is especially timing-sensitive, this sort of testing still won&#8217;t necessarily find it: it may well happen that the bad timing just didn&#8217;t happen. You can bet that race conditions that don&#8217;t happen in testing *will* happen on your customer&#8217;s system.</p>
<p>Also, there is the issue of visibility. On single CPU systems, or dual-core systems that share a cache between cores, threads may see changes to data made by other threads even when suitable synchronization is not being used. If the application is then run on a true multi-processor system, such latent bugs may be exposed.</p>
<p>So: this is a worthwhile tool to have, but it&#8217;s not a silver-bullet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asgeir S. Nilsen</title>
		<link>http://blog.carbonfive.com/2008/05/testing/multithreaded-testing/comment-page-1#comment-68</link>
		<dc:creator>Asgeir S. Nilsen</dc:creator>
		<pubDate>Mon, 08 Sep 2008 07:31:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog/?p=29#comment-68</guid>
		<description>You could also look into using a latch or a cyclic barrier.  Java Concurrency in Practice&#039;s chapter on testing describes these quite thorougly.</description>
		<content:encoded><![CDATA[<p>You could also look into using a latch or a cyclic barrier.  Java Concurrency in Practice&#8217;s chapter on testing describes these quite thorougly.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Rudman</title>
		<link>http://blog.carbonfive.com/2008/05/testing/multithreaded-testing/comment-page-1#comment-63</link>
		<dc:creator>Dan Rudman</dc:creator>
		<pubDate>Fri, 05 Sep 2008 15:43:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog/?p=29#comment-63</guid>
		<description>(it should be noted that the previous comment was for threads across multiple VMs, but doesn&#039;t really speak to testing in a multithreaded environment, which this article does a pretty good job of doing).</description>
		<content:encoded><![CDATA[<p>(it should be noted that the previous comment was for threads across multiple VMs, but doesn&#8217;t really speak to testing in a multithreaded environment, which this article does a pretty good job of doing).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan Rudman</title>
		<link>http://blog.carbonfive.com/2008/05/testing/multithreaded-testing/comment-page-1#comment-62</link>
		<dc:creator>Dan Rudman</dc:creator>
		<pubDate>Fri, 05 Sep 2008 15:41:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog/?p=29#comment-62</guid>
		<description>OR... Terracotta and fuhgetaboutit.</description>
		<content:encoded><![CDATA[<p>OR&#8230; Terracotta and fuhgetaboutit.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
