<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technoetic</title>
	<atom:link href="http://blog.technoetic.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.technoetic.com</link>
	<description></description>
	<lastBuildDate>Wed, 28 Jul 2010 10:55:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>QuickFIX/J Message Representation Plugins</title>
		<link>http://blog.technoetic.com/2010/03/28/quickfixj-message-representation-plugins/</link>
		<comments>http://blog.technoetic.com/2010/03/28/quickfixj-message-representation-plugins/#comments</comments>
		<pubDate>Sun, 28 Mar 2010 14:53:40 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[QuickFIX/J]]></category>

		<guid isPermaLink="false">http://blog.technoetic.com/?p=141</guid>
		<description><![CDATA[Although I haven&#8217;t had much time to work on QuickFIX/J since handing off the project leadership to Smart Trade, I still have many ideas about how the library could be improved. One feature I&#8217;d like to see added to QuickFIX/J is message representation plugin support. The current implementation of QuickFIX/J uses the message representation defined [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://blog.technoetic.com/wp-content/uploads/2010/03/quickfixj.png" alt="QuickFIX/J" style="float: left; margin-right: 16px"/> Although I haven&#8217;t had much time to work on <a href="http://www.quickfixj.org/">QuickFIX/J</a> since handing off the project leadership to <a href="http://www.smart-trade.net">Smart Trade</a>, I still have many ideas about how the library could be improved. One feature I&#8217;d like to see added to QuickFIX/J is message representation plugin support.</p>
<p>The current implementation of QuickFIX/J uses the message representation defined by QuickFIX JNI implementation (no longer supported by the QuickFIX C++ project). The representation is not idiomatic Java and this not only makes it&#8217;s more difficult for Java programmers to work with but also increases the challenges when processing QuickFIX/J messages using other Java tools. Since compatibility with previous versions of QuickFIX/J is desirable, the existing message presentation would continue as one of the supported plugins. Another simple, but useful representation would be a java.util.Map where groups are represented as lists of nested maps. This would not be a particularly high performance representation but would be much easier to use than the current representation. For higher performance, it may be possible to pull data directly from the message byte buffer when it&#8217;s requested. The point is that plugin support would allow QuickFIX/J to support various ease-of-use versus performance trade offs.<br />
<span id="more-141"></span><br />
It&#8217;s also possible that we could support application-defined POJO&#8217;s as the message payload. Instead of the FIX message being parsed into QuickFIX/J objects and then copied into an application object (a common practice), the message would be demarshalled directly into the application object. This could be supported through a combination of external configuration, Java annotations or convention. The application-specific object would then be passed to the application with no further conversion required. A similar approach could be used for message publication where application-specific object data is used to build the output FIX message byte buffer.</p>
<p>A notional example might be:</p>
<pre class="brush: java;">
import static MessageName.*;
import static FieldName.*;
import static GroupName.*;
. . .

@Message(name=NewOrderSingle)
public class Order {

   // Convention
   public void setPrice(BigDecimal price) {
      . . .
   }

   // Automatic conversion between int and BigDecimal for FIX 4.0 ...
   @Field(name=OrderQty)
   public void setQuantity(BigDecimal price) {
      . . .
   }

   @Field(tag=MyUserDefinedTag)
   public void setMyValue(string value) {
      . . .
   }

   @Group(name=NoPartyIds)
   public void setParties(List&lt;tradeparty&gt; parties) {
      . . .
   }
}
</pre>
<p>One nice side-effect of this approach is that only messages that are interesting to the application are mapped in this way. This eliminates the current need for large message JARs mostly full of messages that are never needed.</p>
<p>The message representation plugins would be packaged as a JAR containing a message demarshaller, a message marshaller, a metadata provider and supporting classes. QuickFIX/J currently performs message framing on incoming data stream and places detected messages in byte buffers. This code would be reused from the existing code base and the byte buffer would be passed to the message demarshaller. At this point, the demarshaller is only required to decode the FIX header and trailer fields since these are required by the FIX session engine. The FIX body fields are only decoded as needed, ideally just before the message is passed to the FIX application. This could be a big performance win for FIX routing application that don&#8217;t process the FIX message body.</p>
<p>The message metadata would be used for message validation and, internally, for message parsing and formatting. However, the metadata would not be required to be in any specific format. Although the QuickFIX/J data dictionaries would still be supported, other plugins could use the FIX Repository or a proprietary message metadata format.</p>
<p>This is only one of many areas where I believe we could improve QuickFIX/J usability and performance. The nice thing about this feature is that it would have minimal, if any, impact on existing applications. Comments?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technoetic.com/2010/03/28/quickfixj-message-representation-plugins/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multithread Testing Challenges in Java</title>
		<link>http://blog.technoetic.com/2008/09/05/multithread-testing/</link>
		<comments>http://blog.technoetic.com/2008/09/05/multithread-testing/#comments</comments>
		<pubDate>Fri, 05 Sep 2008 12:28:36 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Software Dev.]]></category>

		<guid isPermaLink="false">http://blog.technoetic.com/2008/09/05/multithread-testing-challenges-in-java/</guid>
		<description><![CDATA[Christian at the Carbon Five Community recently published an interesting blog article on Multithreaded Testing. Christian showed how to use Java 5 built-in concurrency features to create a nice, clean multithreaded test for an article dispatcher. It&#8217;s a good example of using the Java concurrency features, but I wondered about the effectiveness of the test. [...]]]></description>
			<content:encoded><![CDATA[<p>Christian at the Carbon Five Community recently published an interesting blog article on <a href="http://blog.carbonfive.com/2008/05/testing/multithreaded-testing">Multithreaded Testing</a>. Christian showed how to use Java 5 built-in concurrency features to create a nice, clean multithreaded test for an article dispatcher. It&#8217;s a good example of using the Java concurrency features, but I wondered about the effectiveness of the test. </p>
<p>The implementation of Article class was not thread safe. This was acceptable because of the assumption that the ORM library would be creating the Article instances in the requestor&#8217;s thread. However, those types of assumptions can be dangerous over the long term. Let&#8217;s pretend that the performance of the ArticleService was not good and a developer was given the task to increase its performance. To simulate this scenario, I created an implementation of the ArticleService that stored Article instances in memory (as if they were cached or if a framework like Terracotta were being used). The Article class should be thread safe for this implementation, but it wasn&#8217;t modified. We hope the test case will fail with the incorrect code. However, the test succeeded almost every time on my dual core workstation. Why was that?<br />
<span id="more-127"></span><br />
The primary reason the test passed was that it was too fast. Christian warns us about the slow speed of his testing technique, but the technique is not slow. The original code being tested accessed a relational database so it was slow for that reason, not because of the testing technique. With my ArticleService implementation, the test executed in 15-30 milliseconds. My theory is that the short execution time results is what caused the test to pass almost every time. The Hotspot JIT is probably not able to compile and reorder instructions and it&#8217;s possible the threads all ran on the same CPU core. When the test did fail it seemed to be when the machine was under a little more load and the execution time was 40 ms or greater. In another experiment, I increased the size of the Article collection to 250 to 2500 and the test failed every time. For a test like this, it might be useful to measure the execute time in the test and signal an error if it runs too fast. Of course, if we didn&#8217;t know the test effectiveness was a function of execution speed we&#8217;d never think of adding the timing check.</p>
<p>In general, we should be very skeptical about multithread test cases. Just because they pass doesn&#8217;t necessarily mean our code is correct. A nondeterministic test that passes 99% of the time will give us false confidence. How can we be sure that our test is worthy of our confidence? Other than advanced tools like <a href="http://www.alphaworks.ibm.com/tech/contest">ConTest</a> or code reviews by engineers who are experts in the Java Memory Model and multithreading, I&#8217;m not sure. It&#8217;s a difficult problem with no easy answers.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technoetic.com/2008/09/05/multithread-testing/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Unexpected Multithreading in Java</title>
		<link>http://blog.technoetic.com/2008/09/02/unintentional-mt/</link>
		<comments>http://blog.technoetic.com/2008/09/02/unintentional-mt/#comments</comments>
		<pubDate>Mon, 01 Sep 2008 23:05:41 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Software Dev.]]></category>

		<guid isPermaLink="false">http://blog.technoetic.com/2008/09/02/unintentional-mt/</guid>
		<description><![CDATA[Multiple processor and multicore computing platforms are becoming very common and most programmers are aware that special Java programming techniques are required in these environments. A popular technique is to ensure that your code always executes in a single thread. It&#8217;s a reasonable strategy but it&#8217;s very easy to unintentionally violate that constraint. Consider this [...]]]></description>
			<content:encoded><![CDATA[<p>Multiple processor and multicore computing platforms are becoming very common and most programmers are aware that special Java programming techniques are required in these environments. A popular technique is to ensure that your code always executes in a single thread. It&#8217;s a reasonable strategy but it&#8217;s very easy to unintentionally violate that constraint.</p>
<p>Consider this scenario. Let&#8217;s say you have created an InvoiceProcessor class that maintains a count of how many invoices have been processed. The class uses this count for logging purposes. Let&#8217;s also say the server is implemented using a Spring IOC container and a single-threaded JMS message listener container. The architect designed it this way to eliminate the need for the programmers to worry about concurrency issues. Or so he thought.<br />
<span id="more-121"></span> </p>
<p>Your invoice process might look something like the following&#8230;</p>
<pre class="brush: java;">
public class InvoiceProcessor {
    private int invoiceCount;

    public void process(Invoice invoice) {
       // ...
       invoiceCount++;
    }

    // ...

    public int getInvoiceCount() {
       return invoiceCount;
    }
}
</pre>
<p>One day a developer decides that it would be cool to use JMX to monitor the invoice count. With Spring, they just add some JMX annotations to the InvoiceProcessor and them make some simple modifications to their Spring configuration to detect their annotated MBeans. They fire up JConsole and are are delighted to see their invoice count displayed there. They can even see a graph of the invoice counts over time. Very cool. However, their delight soon fades. While testing, they notice the counts in JConsole don&#8217;t match the number of invoices in their test case. What happened? They&#8217;ve been bitten by <em>unexpected multithreading</em>.</p>
<p>Remote JMX access has created multithread access to the InvoiceProcessor. There are no memory barriers around access to the count field so there&#8217;s no way to know if the value returned by the JMX remoting thread is anywhere close to the value seen in the thread that processes invoices. Making the count field volatile is a potential solution in this scenario.</p>
<p>Although this example is hypothetical, I&#8217;ve actually seen a bug like this in previous versions of Hibernate&#8217;s JMX support. In general, be aware that remote JMX access will require any instrumented classes to be thread safe. </p>
<p>Of course, there are other ways to be bitten by unexpected multithreading. For example, you might use the InvoiceProcessor in a Swing GUI and display the count in a monitoring panel. Now the count field is being accessed from both the AWT event dispatching thread and the request processing thread. Or you might decide to schedule a Quartz job to reset the count every day at midnight. This is easily done in the Spring configuration file, but once again, your code now must now be thread safe. Other possible sources of unexpected multithreading are Java shutdown hooks or object finalizers since they run in their own threads. If you know of other common sources of unexpected multithreading, share them in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technoetic.com/2008/09/02/unintentional-mt/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>2GX: Groovy and Grails Experience</title>
		<link>http://blog.technoetic.com/2008/02/25/2gx-groovy-and-grails-experience/</link>
		<comments>http://blog.technoetic.com/2008/02/25/2gx-groovy-and-grails-experience/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 23:38:18 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Software Dev.]]></category>

		<guid isPermaLink="false">http://blog.technoetic.com/2008/02/25/2gx-groovy-and-grails-experience/</guid>
		<description><![CDATA[This weekend I attended the Groovy and Grails Experience (2GX) conference. I had done some Groovy scripting and had played with Grails a little. However, this was a good chance to dive into some more advanced topics like Groovy metaprogramming and Grail&#8217;s GORM. My favorite talk was Glen Smith&#8217;s overview of Grails plugins for Rich [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I attended the Groovy and Grails Experience (2GX) conference. I had done some Groovy scripting and had played with Grails a little. However, this was a good chance to dive into some more advanced topics like Groovy metaprogramming and Grail&#8217;s GORM.</p>
<p>My favorite talk was Glen Smith&#8217;s overview of Grails plugins for Rich UI support, search, Ajax and more. It was a very informative and fun presentation.</p>
<p><img src="/wp-content/2gx.jpg" alt="2GX Panel" hspace="8" align="left"/> The speaker&#8217;s panel discussion was one of the best I&#8217;ve seen. One of the most controversial questions was about Groovy, JRuby and the relative impedance mismatch with the Java Platform. Neil Ford of Thoughtworks initially took the position that there was no impedance mismatch with JRuby. Graeme Rocher and others listed numerous examples of where JRuby was less integrated with Java compared to Groovy. Graeme commented that although JRuby can access compiled Java classes, it is much more difficult (impossible?) for Java to use JRuby classes. Groovy classes are Java classes and so they can be used relatively transparently in Java programs. </p>
<p>Speaking from experience, I&#8217;ve tried to use Java libraries (QuickFIX/J) using JRuby and it has proven much more difficult than with Groovy. One issue was insufficient (and somewhat outdated) documentation about how to integrate JRuby with Java classes outside the &#8220;java.*&#8221; packages. This was a few months ago so maybe the documentation has improved. However, with Groovy I was able to use the Java libraries within a few minutes.</p>
<p>I agreed with a point that Neil made that having some competition in the JVM dynamic language arena helps everyone. I highly respect the work the JRuby team is doing although I believe that Groovy is a better and more pragmatic dynamic language choice for Java developers.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technoetic.com/2008/02/25/2gx-groovy-and-grails-experience/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Money:Tech Panel: Open Source and Finance</title>
		<link>http://blog.technoetic.com/2008/02/25/moneytech-panel-open-source-and-finance/</link>
		<comments>http://blog.technoetic.com/2008/02/25/moneytech-panel-open-source-and-finance/#comments</comments>
		<pubDate>Sun, 24 Feb 2008 23:04:43 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Open Source Devel.]]></category>
		<category><![CDATA[Software Dev.]]></category>

		<guid isPermaLink="false">http://blog.technoetic.com/2008/02/25/moneytech-panel-open-source-and-finance/</guid>
		<description><![CDATA[I recently had the opportunity to participate in a panel discussion at the O&#8217;Reilly Money:Tech conference. We discussed the extent that the financial technology community had embraced open source. Other members of the panel were Tim O&#8217;Reilly of O&#8217;Reilly Media, James Altucher who founded StockPickr and Graham Miller of Marketcetera. I was representing free financial [...]]]></description>
			<content:encoded><![CDATA[<p>I recently had the opportunity to participate in a panel discussion at the O&#8217;Reilly Money:Tech conference. We discussed the extent that the financial technology community had embraced open source. Other members of the panel were Tim O&#8217;Reilly of <a href="http://www.oreilly.com/">O&#8217;Reilly Media</a>, James Altucher who founded <a href="http://www.stockpickr.com/">StockPickr</a> and Graham Miller of <a href="http://www.marketcetera.com">Marketcetera</a>. I was representing free financial open source software developers in my role as founder and project lead for the <a href="http://www.quickfixj.org">QuickFIX/J</a> project.</p>
<p>There&#8217;s no question that open source technology is used widely in financial applications, especially for middle components. However, there was also a discussion about how willing the financial companies are to open source their own technology (where &#8220;technology&#8221; might include algorithms and research rather than just software).</p>
<p><img src="/wp-content/moneytech.jpg" alt="Money:Tech Panel" align="right" hspace="8" /> I don&#8217;t believe any company intends to sacrifice a competitive advantage by converting their technology to open source. For that reason, I doubt that we&#8217;ll see financial companies releasing algorithms or proprietary research. However, financial companies are involved in open source in a variety of roles. The user role is probably most common today, but a few financial companies have contributed to open source. One example is the <a href="http://amqp.org/">Advanced Message Queuing Protocol</a> (AMQP) effort started by JP Morgan and others. This technology benefits financial software (and software from other domains) by provides a programming language-independent and vendor-independent wire protocol for message queues. For this technology to be successful it must be widely used. An open source strategy has a clear advantage here.</p>
<p>Another example is the Open Financial Market Platform (<a href="http://www.eclipse.org/ofmp/">OFMP</a>) which has recently become an Eclipse Foundation project. In this case, I&#8217;m not so clear about the benefits to the company contributing the initial code. Maybe someone from the project will comment.</p>
<p>Tim O&#8217;Reilly closed the panel with a suggestion that open source developers consider projects that make it easier to capture and process the vast amounts of unstructured data available on the net. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technoetic.com/2008/02/25/moneytech-panel-open-source-and-finance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using JRuby for Java testing?</title>
		<link>http://blog.technoetic.com/2008/01/09/using-jruby-for-java-testing/</link>
		<comments>http://blog.technoetic.com/2008/01/09/using-jruby-for-java-testing/#comments</comments>
		<pubDate>Wed, 09 Jan 2008 11:23:26 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Software Dev.]]></category>

		<guid isPermaLink="false">http://blog.technoetic.com/2008/01/09/using-jruby-for-java-testing/</guid>
		<description><![CDATA[A recent article on InfoQ (Boost your Java Test with Ruby and JtestR) described a new framework for doing Java testing using JRuby. The article includes the following test case to highlight it&#8217;s features. import java.util.HashMap describe &#34;An empty&#34;, HashMap do before :each do @hash_map = HashMap.new end it &#34;should be able to add an [...]]]></description>
			<content:encoded><![CDATA[<p>A recent article on InfoQ (<a href="http://www.infoq.com/news/2008/01/boost-java-test">Boost your Java Test with Ruby and JtestR</a>) described a new framework for doing Java testing using JRuby. The article includes the following test case to highlight it&#8217;s features.</p>
<pre class="brush: ruby;">
import java.util.HashMap

describe &quot;An empty&quot;, HashMap do
 before :each do
  @hash_map = HashMap.new
 end
 it &quot;should be able to add an entry to it&quot; do
  @hash_map.put &quot;foo&quot;, &quot;bar&quot;
  @hash_map.get(&quot;foo&quot;).should == &quot;bar&quot;
 end
 it &quot;should return a keyset iterator that throws an exception on next&quot; do
  proc do
   @hash_map.key_set.iterator.next
  end.should raise_error(java.util.NoSuchElementException)
 end
end
</pre>
<p>What is the point of this example? Is there really a significant difference between this example and the following JUnit4 test class?<br />
<span id="more-118"></span></p>
<pre class="brush: java;">
import static org.hamcrest.core.Is.is;
import static org.junit.Assert.assertThat;

import java.util.HashMap;
import java.util.NoSuchElementException;

import org.junit.Test;

public class HashMapTest {
    private HashMap&lt;String,String&gt; hashMap =
            new HashMap&lt;String,String&gt;();

    @Test
    public void shouldBeAbleToAddAnEntryToIt() {
        hashMap.put(&quot;foo&quot;, &quot;bar&quot;);
        assertThat(hashMap.get(&quot;foo&quot;), is(&quot;bar&quot;));
    }

    @Test(expected = NoSuchElementException.class)
    public void shouldReturnAKeysetIteratorThatThrowsAnExceptionOnNext() {
        hashMap.keySet().iterator().next();
    }

}
</pre>
<p>Sure, the syntax is a bit different and the Java version is slightly more verbose with it&#8217;s access specifiers and type declarations. However, the Java version runs fast enough that you don&#8217;t need to set up a Ant server to get reasonable performance from your tests (as recommended in the article for JTestR).</p>
<p>I&#8217;m not questioning that scripting can be useful in unit tests. However, I&#8217;d think that Groovy&#8217;s superior Java integration would make it a better choice for this purpose than JRuby. Does anybody know of some compelling, pragmatic examples of the relative benefit of JRuby over Groovy for Java test scripting purposes? </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technoetic.com/2008/01/09/using-jruby-for-java-testing/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>JUnitFactory: First Impressions</title>
		<link>http://blog.technoetic.com/2007/04/08/junitfactory-first-impressions/</link>
		<comments>http://blog.technoetic.com/2007/04/08/junitfactory-first-impressions/#comments</comments>
		<pubDate>Sun, 08 Apr 2007 16:31:04 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Software Dev.]]></category>

		<guid isPermaLink="false">http://blog.technoetic.com/2007/04/08/junitfactory-first-impressions/</guid>
		<description><![CDATA[JUnitFactory is an automated unit test generation service from Agitar Software Labs. This article describes my initial experiences and impressions from using the tool to generate unit tests. Installation You can use JUnitFactory through a web interface or as an Eclipse plugin. I have only used the Eclipse plugin . It was very easy to [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.junitfactory.com/">JUnitFactory</a> is an automated unit test generation service from <a href="http://www.agitar.com/">Agitar Software Labs</a>. This article describes my initial experiences and impressions from using the tool to generate unit tests.</p>
<p><strong>Installation</strong></p>
<p><img src="http://www.junitfactory.com/factory_logo.gif" align="right"/> You can use JUnitFactory through a web interface or as an Eclipse plugin. I have only used the Eclipse plugin . It was very easy to install using the JUnitFactory Eclipse update site (<a href="http://www.junitfactory.com/get-started.jsp">more info</a>). You can also download a file if you prefer manual installation. The JUnitFactory plugin is currently only available for Eclipse, but may be available for other IDEs in the future.</p>
<p><span id="more-117"></span><strong>Generating Tests</strong></p>
<p><em>Warning: Carefully read the <a href="http://www.junitfactory.com/faq.jsp">JUnitFactory FAQ </a>before generating any tests!</em></p>
<p>I decided to generate tests for a specific class I had been modifying. When I ran the test generator, it first required me to set up a user name and password and agree that I&#8217;ve read their legal statements about security and other usage risks.</p>
<p><strong><font color="red">Do not generate tests for company code with this tool unless you have permission to upload your company&#8217;s proprietary source to a nonsecure remote server, possibly to be stored there and used for unspecified purposes. In some companies, you might lose your job for this type of security breach.</font></strong></p>
<p>This wasn&#8217;t a problem for me since I was generating tests for an open source code. I set up an account and then initiated the test generation again. Since I hadn&#8217;t read the FAQ first, I was surprised to see that hundreds of files were being uploaded to their server. JUnitFactory uploads every source and class file in your Eclipse project when it generates tests. In fact, if your project depends on other projects it will also upload all the sources and classes for those projects.</p>
<p>When test generation begins, a JUnitFactory view is displayed in Eclipse and it shows the progress of the test generation. My first impression of the Eclipse plugins are that they are well designed. I didn&#8217;t encounter any bugs when using them. </p>
<p>The test generation completed after a few minutes (the source project was small, about 50-60 classes). The Eclipse view for my test generation results is shown below. </p>
<p><img src="http://blog.technoetic.com/wp-content/junitfactory.png" alt="JUnitFactory view" /></p>
<p>As you can see the coverage wasn&#8217;t that great. There are several reasons for this poor coverage. The number after &#8220;Done&#8221; in the status column is a count of the number of suggestions from JUnitFactory about testing problems and how to improve the test coverage. The screen shown below contains typical warnings and suggestions.</p>
<p><img src="http://blog.technoetic.com/wp-content/suggestions.png"/><br />
Clicking in the second column of the JUnitFactory view will display the generated test code. Being the eager person I am, I immediately ran the tests in Eclipse JUnit test runner&#8230; and they all failed. Fortunately, the situation was quickly resolved by reading the test error messages which told me that I must run the test in the Agitar-specific JUnit test runner. I do so and all the tests passed. I&#8217;m not sure why a proprietary test runner is required. It doesn&#8217;t appear to be compatible with other plugins I have installed, like the EclEmma coverage analyzer.</p>
<p><strong>First Impressions</strong></p>
<p>One very important fact to remember is that the tests generated by JUnitFactory are not intended to be used in the way most people use unit tests. They don&#8217;t test correct behavior, for example. They test what the code does, not what it&#8217;s supposed to do. To replace Test Driven Design (TDD) and handwritten unit tests with JUnitFactory-generated would be a huge mistake.</p>
<p>Agitar suggests that the tests are best used as <em>characterization tests</em>. A characterization test can be thought of as executable documentation of the behavior (actual, not necessarily correct, behavior) of the tested software. If you are redesigning existing (legacy) software that doesn&#8217;t have tests, a characterization test suite can help you determine if the new software behaves the same as the previous implementation.</p>
<p>This sounds great in theory, but there are many practical problems. For example, it may be difficult to effectively use the legacy-based characterization tests if the OO design changes in the new code. The JUnitFactory tests are at the class-level, so if even just the class name changes in the new code you&#8217;ll need to make manual modifications to the characterization tests to run them against the new code. With a highly modified OO design, you&#8217;ll probably not be able to effectively use the legacy tests at all or only with significant effort. This problem is aggravated if the legacy software has problems like undisciplined use of method visibility. The exposed methods will generally trigger unit test generation although they are really an internal implementation detail. Of course, JUnitFactory can&#8217;t do anything about that, but it&#8217;s a practical problem to consider. If you have thousands of classes with issues like these, it would be a major effort to keep the characterization test suite consistent between legacy code and new implementations. </p>
<p>JUnitFactory looks inside the implementation of the class when generating the tests. This can result in some tests that are arguably overly implementation-dependent and will fail even with a correct reimplementation of the code. For example, it may assert that a NPE is thrown for a null method argument. This isn&#8217;t required behavior of the class. A new implementation might handle the null argument without a NPE (by returning a empty result, for example). This can be easily corrected in any specific test suite. However, in a large legacy system there could be many of these false alarms.</p>
<p><strong>Conclusions</strong></p>
<p>To quote one of the JUnitFactory announcements from a few months ago:</p>
<blockquote><p>
Remember, it&#8217;s still experimental and mostly for fun so don&#8217;t expect too much or bang on it too hard.
</p></blockquote>
<p>Overall, I thought JUnitFactory was interesting but I&#8217;m not convinced it would be useful for my day-to-day work. If I weren&#8217;t required to upload the code to their server, I&#8217;d love to try it on some work-related legacy code that we are currently reimplementing. The legacy code is EJB-based (circa 2000), has few abstractions for testing, and makes heavy use of stored procedures. My guess is that JUnitFactory wouldn&#8217;t be able to help me much in this situation. </p>
<p>JUnitFactory does provide various types of hooks for fixing testing-related problems and improving coverage through writing extra testing support code. Based on the coverage and suggestions for the project shown earlier in the JUnitFactory view, most of the classes in that project would need custom test framework extensions to get decent coverage. This was relatively well-written code. I&#8217;m guessing that practically 100% of the classes in the legacy system I described would need custom test extensions to get acceptable test coverage. That&#8217;s a huge job. And I&#8217;m wondering if the whole approach is fatally flawed anyway.</p>
<p>When reimplementing a legacy system, characterization tests at the class level are generally going to be far too low level (too sensitive to behavior-preserving design changes). Another strategy is to do characterization testing closer to the system or subsystem level and verify that externally visible behavior is consistent. JUnitFactory will not help with this type of testing.</p>
<p>Another use for JUnitFactory is to find holes in a handwritten unit test suite. However, be prepared for studying numerous, somewhat obfuscated tests, and then doing some deep reasoning about whether what you learn represents a hole in your current test suite or not.</p>
<p>I&#8217;m not sure about the practical payoff, but if you are interested in automated test generation from a research perspective, definitely try out JUnitFactory.</p>
<p>Related Links:</p>
<ul>
<li><a href="http://www.artima.com/weblogs/viewpost.jsp?thread=200725">Fun With Automated Characterization Test Generation</a>
</li>
<li><a href="http://www.sdtimes.com/fullcolumn/column-20070315-03.html">Characterization: Beyond Pure Unit Testing</a>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.technoetic.com/2007/04/08/junitfactory-first-impressions/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Pragmatic Agility</title>
		<link>http://blog.technoetic.com/2007/03/29/pragmatic-agility/</link>
		<comments>http://blog.technoetic.com/2007/03/29/pragmatic-agility/#comments</comments>
		<pubDate>Thu, 29 Mar 2007 12:41:16 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Software Dev.]]></category>

		<guid isPermaLink="false">http://blog.technoetic.com/2007/03/29/pragmatic-agility/</guid>
		<description><![CDATA[There was an interesting discussion during the Agile Toolkit Podcast interview with Dave of the Pragmatic Programmers. I&#8217;ve transcribed a few of the comments about agile methodologies below. Dave Thomas: I think agile methodologies have adopted their own venom. And to that extent, I&#8217;m pulling back, away from, the individual agile methodologies. I believe very, [...]]]></description>
			<content:encoded><![CDATA[<p>There was an interesting discussion during the <a href="http://agiletoolkit.libsyn.com/"> Agile Toolkit Podcast</a> interview with Dave of the <a href="http://www.pragmaticprogrammer.com/">Pragmatic Programmers</a>. I&#8217;ve transcribed a few of the comments about agile methodologies below.</p>
<blockquote><p>
<strong>Dave Thomas:</strong> I think agile methodologies have adopted their own venom. And to that extent, I&#8217;m pulling back, away from, the individual agile methodologies. I believe very, very strongly in agility. I&#8217;m an author of the agile manifesto and I think the underlying values of agility fit far better with my world view of how software should be built. I think some of the implementations of agile methodologies are, frankly, scarey in their kind of&#8230;</p>
<p><strong>Bob Payne:</strong> dogmatic?</p>
<p><strong>Dave Thomas:</strong> dogmatic, yeah that&#8217;s a good word, that&#8217;s a mild word for some it. It&#8217;s kind of like &#8220;my way or you&#8217;re not doing it properly&#8221;, a lot of blackmail, a lot of absolutes. And to me that&#8217;s not what agility is all about. So I pull back from that. I don&#8217;t want to be associated with that.</p>
<p><strong>Bob Payne:</strong> In the past I&#8217;ve felt a number of pulls in different directions and I&#8217;ve started to realize that it is not necessarily the particular practice but what the resulting outcome is, the rhythm that it sets up.
</p></blockquote>
<p>This perspective sounds very similar to what I&#8217;ve been calling &#8220;<a href="http://blog.technoetic.com/2007/01/04/agile-without-a-name/">agile without a name</a>&#8221; or &#8220;effective software development&#8221; or what Tim Beck calls &#8220;<a href="http://pliantalliance.org/">pliant software development</a>&#8220;.</p>
<p>P.S. I highly recommend the <a href="http://agiletoolkit.libsyn.com/"> Agile Toolkit Podcast</a>. It&#8217;s a great resource to hear candid discussions about agile topics.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technoetic.com/2007/03/29/pragmatic-agility/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do You Write Green Software?</title>
		<link>http://blog.technoetic.com/2007/03/25/green-software/</link>
		<comments>http://blog.technoetic.com/2007/03/25/green-software/#comments</comments>
		<pubDate>Sun, 25 Mar 2007 14:46:29 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Software Dev.]]></category>

		<guid isPermaLink="false">http://blog.technoetic.com/2007/03/25/do-you-write-green-software/</guid>
		<description><![CDATA[QCon 2007 was a great opportunity to hear the architects of some of the largest Internet sites discuss the challenges they&#8217;ve had. One particularly interesting challenge was discussed by Dan Pritchett, Technical Fellow at eBay, Inc. He spoke about the challenges of providing enough power and air conditioning to eBay&#8217;s data centers. I&#8217;m not sure [...]]]></description>
			<content:encoded><![CDATA[<p><a href="qcon.infoq.com/qcon/">QCon 2007</a> was a great opportunity to hear the architects of some of the largest Internet sites discuss the challenges they&#8217;ve had. One particularly interesting challenge was discussed by <a href="http://www.addsimplicity.com/">Dan Pritchett</a>, Technical Fellow at eBay, Inc. He spoke about the challenges of providing enough power and air conditioning to eBay&#8217;s data centers. I&#8217;m not sure how accurate this statistic was, but he mentioned a 3 million watt power requirement for their northern California data center. The problem is that the local electricity provider is reaching the limits of their ability to provide that much power. This, in turn, limits ebay&#8217;s ability to scale at this physical location.</p>
<p><span id="more-114"></span> <img src="http://blog.technoetic.com/wp-content/power_lines.jpg" alt="Power lines" align="left" hspace="8"/>This problem is not unique to eBay. For example, CNet News <a href="http://news.com.com/Power+could+cost+more+than+servers,+Google+warns/2100-1010_3-5988090.html">reports </a>that &#8220;a Google engineer has warned that if the performance per watt of today&#8217;s computers doesn&#8217;t improve, the electrical costs of running them could end up far greater than the initial hardware price tag.&#8221; The Gartner group reports that IT energy costs will increase from 25-30% to 40% within 5 years. A report from Lawrence Livermore Laboratories says that data centers will be using more electricity than the 275 million televisions in the United States. The Wall Street Journal reports that one large data center can consume as much power as a small city of 30,000-40,000 people.</p>
<p>There are several ways to respond to these challenges. The most common approaches are to buy more efficient hardware or to place data centers near cheap and abundant power. This is reportedly one reason for Google&#8217;s interest in creating a data center in North Carolina. However, Dan Pritchett spoke of another option: writing more energy efficient software. He estimates that inefficient programming techniques may increase eBay&#8217;s energy consumption by 25-30%. This limits scalability of their data center given the limits of the power companies to provide energy, but it also results in huge amounts of wasted money for large data centers.</p>
<p>It&#8217;s a very interesting idea. Computationally efficient software would also generally be more energy efficient. What other techniques can we use to optimize power efficiency for &#8220;green software development&#8221;?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technoetic.com/2007/03/25/green-software/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>APM Tooling Survey and XPlanner</title>
		<link>http://blog.technoetic.com/2007/01/22/apm-tooling-survey-and-xplanner/</link>
		<comments>http://blog.technoetic.com/2007/01/22/apm-tooling-survey-and-xplanner/#comments</comments>
		<pubDate>Mon, 22 Jan 2007 12:07:51 +0000</pubDate>
		<dc:creator>Steve</dc:creator>
				<category><![CDATA[Agile]]></category>
		<category><![CDATA[Software Dev.]]></category>
		<category><![CDATA[XPlanner]]></category>

		<guid isPermaLink="false">http://blog.technoetic.com/2007/01/22/apm-tooling-survey-and-xplanner/</guid>
		<description><![CDATA[Trail Ridge Consulting has released the results of an agile project management tooling survey performed in late 2006. Apparently, APM tools are being widely used by both small and large organizations although the primary reasons differ with the size of the organization. It was interesting to me to see that card-based approaches are use less [...]]]></description>
			<content:encoded><![CDATA[<p>Trail Ridge Consulting has released the results of an agile <a href="http://trailridgeconsulting.com/surveys.html">project management tooling survey</a> performed in late 2006. Apparently, <a href="http://blog.technoetic.com/agile-pm-tools/">APM tools</a> are being widely used by both small and large organizations although the primary reasons differ with the size of the organization. It was interesting to me to see that card-based approaches are use less often than dedicated APM tools or MS Office tools like Excel.</p>
<p>It was also interesting to see that XP has been adopted in about half as many organizations as Scrum. Of course, I&#8217;d guess that many of the Scrum shops are using at least some XP software development practices.</p>
<p><img src="http://www.xplanner.org/images/logo.jpg" alt="XPlanner" align="left" hspace="4" /> <a href="http://www.xplanner.org">XPlanner </a> was the fourth most widely used APM tool and the only open source product in the top 10 most used tools. (There is a factual error in the survey results that says ScrumWorks is also open source. The ScrumWorks Basic product is free but not open source). XPlanner is also the most used tool focusing specifically on XP. It surprised me a little to see that XPlanner is adopted somewhat more by large organizations than small organizations. It&#8217;s possible that this is an indication that the licensing fees for the commercial tools are high enough to cause some pain for large organizations. I know at least one large organization that chose XPlanner over VersionOne for this reason.</p>
<p>As the founder<sup>[1]</sup> of the XPlanner project, I&#8217;m very happy to see it so widely used even with no marketing or sales resources. </p>
<hr /><span style="font-size: 0.9em">1. <a href="http://docs.codehaus.org/display/~jacmorel">Jacques Morel</a> is now the XPlanner project management and doing a great job.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.technoetic.com/2007/01/22/apm-tooling-survey-and-xplanner/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
