<?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: Latching and mocking in concurrent tests</title>
	<atom:link href="http://blog.xebia.com/2009/11/03/latching-and-mocking-in-concurrent-tests/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xebia.com/2009/11/03/latching-and-mocking-in-concurrent-tests/</link>
	<description></description>
	<lastBuildDate>Thu, 11 Mar 2010 16:23:01 +0100</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Iwein Fuld</title>
		<link>http://blog.xebia.com/2009/11/03/latching-and-mocking-in-concurrent-tests/comment-page-1/#comment-93046</link>
		<dc:creator>Iwein Fuld</dc:creator>
		<pubDate>Thu, 12 Nov 2009 12:11:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/?p=3359#comment-93046</guid>
		<description>I&#039;m not a mock fanboy, but neither am I allergic to them like Uncle Bob. 

Byteman seems like a very interesting tool to test the concurrent nature of your program, whereas my trick merely allows you to deal with concurrency in a functional test. I&#039;d say usually a trick like this is enough, but if you&#039;re chasing after concurrency bugs it pays off to look a little further.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not a mock fanboy, but neither am I allergic to them like Uncle Bob. </p>
<p>Byteman seems like a very interesting tool to test the concurrent nature of your program, whereas my trick merely allows you to deal with concurrency in a functional test. I&#8217;d say usually a trick like this is enough, but if you&#8217;re chasing after concurrency bugs it pays off to look a little further.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Dinn</title>
		<link>http://blog.xebia.com/2009/11/03/latching-and-mocking-in-concurrent-tests/comment-page-1/#comment-93023</link>
		<dc:creator>Andrew Dinn</dc:creator>
		<pubDate>Thu, 05 Nov 2009 09:18:12 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/?p=3359#comment-93023</guid>
		<description>You might also take a look at &lt;a&gt;Byteman&lt;/a&gt;, a bytecode injection tool which was developed to address testing of multi-threaded apps. It makes this sort of thing trivial to achieve and avoids the need for mocking.

Take a look at my paper in this year&#039;s &lt;a HREF=&quot;http://jazoon.com/en/conference/presentations/tl/7460&quot; rel=&quot;nofollow&quot;&gt;Jazoon&lt;/a&gt; for an example of how to inject a synchronization point into a multi-threaded program, thereby exposing a concurrency bug. It requires a few lines of Byteman rule code and, more importantly, no edits to the original program. Countdowns are also provided as standard built-in operations. They can be used in Byteman conditions to decide whether or not to execute injected actions. Combined with a rendezvous action this can be used to ensure that threads synch up at the NTH call.</description>
		<content:encoded><![CDATA[<p>You might also take a look at <a>Byteman</a>, a bytecode injection tool which was developed to address testing of multi-threaded apps. It makes this sort of thing trivial to achieve and avoids the need for mocking.</p>
<p>Take a look at my paper in this year&#8217;s <a HREF="http://jazoon.com/en/conference/presentations/tl/7460" rel="nofollow">Jazoon</a> for an example of how to inject a synchronization point into a multi-threaded program, thereby exposing a concurrency bug. It requires a few lines of Byteman rule code and, more importantly, no edits to the original program. Countdowns are also provided as standard built-in operations. They can be used in Byteman conditions to decide whether or not to execute injected actions. Combined with a rendezvous action this can be used to ensure that threads synch up at the NTH call.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andrew Phillips</title>
		<link>http://blog.xebia.com/2009/11/03/latching-and-mocking-in-concurrent-tests/comment-page-1/#comment-93011</link>
		<dc:creator>Andrew Phillips</dc:creator>
		<pubDate>Tue, 03 Nov 2009 22:31:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/?p=3359#comment-93011</guid>
		<description>Another interesting - if somewhat old - option for concurrent testing is &lt;a href=&quot;http://www.cs.umd.edu/projects/PL/multithreadedtc/overview.html&quot; target=&quot;_new&quot; rel=&quot;nofollow&quot;&gt;Multithreaded TC&lt;/a&gt;; there have also been some recent efforts to &lt;a href=&quot;http://code.google.com/p/multithreadedtc-junit4/&quot; target=&quot;_new&quot; rel=&quot;nofollow&quot;&gt;integrate it&lt;/a&gt; with JUnit 4.
That said, I haven&#039;t found a nice way to get it to do what your example does - provide a latch or delay &lt;em&gt;within&lt;/em&gt; the flow of the code under test (in your example, in a mock). MTC is great in coordinating test threads but otherwise assumes that the code under test &quot;naturally&quot; blocks, e.g. when doing a take from a blocking queue.</description>
		<content:encoded><![CDATA[<p>Another interesting &#8211; if somewhat old &#8211; option for concurrent testing is <a href="http://www.cs.umd.edu/projects/PL/multithreadedtc/overview.html" target="_new" rel="nofollow">Multithreaded TC</a>; there have also been some recent efforts to <a href="http://code.google.com/p/multithreadedtc-junit4/" target="_new" rel="nofollow">integrate it</a> with JUnit 4.<br />
That said, I haven&#8217;t found a nice way to get it to do what your example does &#8211; provide a latch or delay <em>within</em> the flow of the code under test (in your example, in a mock). MTC is great in coordinating test threads but otherwise assumes that the code under test &#8220;naturally&#8221; blocks, e.g. when doing a take from a blocking queue.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://blog.xebia.com/2009/11/03/latching-and-mocking-in-concurrent-tests/comment-page-1/#comment-93010</link>
		<dc:creator>David</dc:creator>
		<pubDate>Tue, 03 Nov 2009 20:16:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.xebia.com/?p=3359#comment-93010</guid>
		<description>Latches are definitely useful in many situations. May I point you to a, in my opinion, related blog entry by Uncle Bob: http://blog.objectmentor.com/articles/2009/10/28/manual-mocking-resisting-the-invasion-of-dots-and-parentheses
Personally I tend to lean toward using mocks, but I don&#039;t think there&#039;s any right way. As always, it&#039;s about using the right tool for the right job.</description>
		<content:encoded><![CDATA[<p>Latches are definitely useful in many situations. May I point you to a, in my opinion, related blog entry by Uncle Bob: <a href="http://blog.objectmentor.com/articles/2009/10/28/manual-mocking-resisting-the-invasion-of-dots-and-parentheses" rel="nofollow">http://blog.objectmentor.com/articles/2009/10/28/manual-mocking-resisting-the-invasion-of-dots-and-parentheses</a><br />
Personally I tend to lean toward using mocks, but I don&#8217;t think there&#8217;s any right way. As always, it&#8217;s about using the right tool for the right job.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
