<?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>Bob McCune</title>
	<atom:link href="http://www.bobmccune.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bobmccune.com</link>
	<description>iOS and Java Design, Development, Training, and Mentoring</description>
	<lastBuildDate>Wed, 23 Jun 2010 07:47:27 +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>Road Stoves GPS &#8211; #3 on iTunes</title>
		<link>http://www.bobmccune.com/2010/04/13/road-stoves-gps-3-on-itunes/</link>
		<comments>http://www.bobmccune.com/2010/04/13/road-stoves-gps-3-on-itunes/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 01:16:02 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/?p=154</guid>
		<description><![CDATA[I recently finished an iPhone app for a client in California called RoadStoves. RoadStoves is the leader in the growing gourmet food truck business popular in Los Angeles and other cities. The app is called Road Stoves GPS and, as you might guess from the name, is a GPS tracker to keep tabs on the [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I recently finished an iPhone app for a client in California called <a href="http://www.roadstoves.com/">RoadStoves</a>.  RoadStoves is the leader in the growing gourmet food truck business popular in Los Angeles and other cities.  The app is called Road Stoves GPS and, as you might guess from the name, is a GPS tracker to keep tabs on the location of your favorite trucks.  There are other food truck apps available, but this is the only one on the market providing location-based services showing trucks &#8220;near me&#8221;, GPS map locations, and driving directions.  It&#8217;s a very handy app for all the foodies in the LA area.</p>
<p><span id="more-154"></span></p>
<p>I was happy to find out today that Road Stoves GPS is now the #3 paid navigation app on iTunes!</p>
<p><img src="http://www.bobmccune.com/wp-content/uploads/2010/06/rs_gps.png" alt="" title="RoadStoves GPS" width="202" height="283" class="size-full wp-image-172" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2010/04/13/road-stoves-gps-3-on-itunes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>iPhone Jam Session</title>
		<link>http://www.bobmccune.com/2010/04/08/iphone-jam-session/</link>
		<comments>http://www.bobmccune.com/2010/04/08/iphone-jam-session/#comments</comments>
		<pubDate>Fri, 09 Apr 2010 00:17:14 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Presentation]]></category>
		<category><![CDATA[iOS]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/?p=151</guid>
		<description><![CDATA[Thanks to everyone who turned out for the iPhone presentation Chris Bartling and I gave at last night&#8217;s Jam Session! We had a great time talking about a fun topic. I hope you enjoyed it. There were some questions about Apple&#8217;s approval process. I mentioned that I just submitted an app this past Saturday and [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Thanks to everyone who turned out for the iPhone presentation <a href="http://bartling.blogspot.com/">Chris Bartling</a> and I gave at last night&#8217;s Jam Session!  We had a great time talking about a fun topic.  I hope you enjoyed it.</p>
<p>There were some questions about Apple&#8217;s approval process.  I mentioned that I just submitted an app this past Saturday and said I didn&#8217;t know how soon it would be before it was given the thumbs up.  I wish I had checked my email during the break as it was approved last night.  That&#8217;s not too bad a turnaround time.  Thanks Apple!</p>
<p>Thanks again and I hope I&#8217;ll see some of you at next month&#8217;s CocoaHeads.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2010/04/08/iphone-jam-session/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CocoaHeads: We&#039;re Off To a Great Start!</title>
		<link>http://www.bobmccune.com/2008/06/16/cocoaheads-were-off-to-a-great-start/</link>
		<comments>http://www.bobmccune.com/2008/06/16/cocoaheads-were-off-to-a-great-start/#comments</comments>
		<pubDate>Mon, 16 Jun 2008 17:48:25 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Cocoa]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/?p=80</guid>
		<description><![CDATA[I would really like to thank all of you who attended the inaugural CocoaHeads meeting last Thursday. I couldn&#8217;t have been happier with the turnout and participation from everyone. It was also nice to finally meet many of you with whom I&#8217;ve traded emails over the past couple of months. We had a great mix [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I would really like to thank all of you who attended the inaugural CocoaHeads meeting last Thursday.  I couldn&#8217;t have been happier with the turnout and participation from everyone.  It was also nice to finally meet many of you with whom I&#8217;ve traded emails over the past couple of months.</p>
<p>We had a great mix of people at the first meeting ranging from experienced Cocoa, NeXT, and Mac OS developers to those experienced with other languages/platforms, but just starting out with Cocoa and CocoaTouch, to those just starting their journey into software development.  This should make for a very interesting group!</p>
<p><a href="http://anatkinson.com/">Andy Atkinson</a> started polling at the end of the meeting for what technical topics people would like to see at upcoming meetings.  I think the final ones we settled on were:</p>
<ul>
<li><span style="text-decoration:underline">Intro to iPhone Development</span></li>
<li><span style="text-decoration:underline">Overview of RubyCocoa</span></li>
<li><span style="text-decoration:underline">Unit Testing with OCUnit</span></li>
<li><span style="text-decoration:underline">NSFoundation Framework</span></li>
<li><span style="text-decoration:underline">Intro to CoreGraphics</span></li>
<li><span style="text-decoration:underline">Overview of Instruments</span></li>
</ul>
<p>Some additional ones I would personally like to see covered (even if I&#8217;m the one covering them) are overviews of <span style="text-decoration:underline">Core Data</span> and <span style="text-decoration:underline">Core Animation</span>.<br />
Let me know if there are any others that I missed and should be tracking.</p>
<p><a href="http://www.rjohnshields.com/blog/">John Shields</a> wrote up a nice summary of <a href="http://rjohnshields.com/blog/?p=50">his thoughts</a> on the meeting that you should check out.</p>
<p>I&#8217;d like to thank <a href="http://heymansoftware.com/">Bill Heyman</a> and <a href="http://damonallison.com/">Damon Allison</a> for showing us some very cool demos of what they are doing over at <a href="http://codemorphic.net/">CodeMorphic</a>.  Good luck guys and keep &#8216;em coming!  If anyone else would be interested in demoing their products or projects, just let me know and I&#8217;ll find you a slot.</p>
<p>I&#8217;d also like to thank everyone at Synergy Information Services.  Their facilities are great and they also have a larger room available should we need it.  We all also greatly appreciated the pizza and soda!</p>
<p>Vlad will be posting the <span style="text-decoration:underline">Getting Started with Cocoa</span> presentation and sample code to the website.  Keep an eye out at <a href="http://www.synfoserv.com/index.php?option=com_content&#038;view=article&#038;id=73&#038;Itemid=102">Synergy&#8217;s CocoaHeads Page</a> over the next few days if you&#8217;d like to download that content.</p>
<p>BTW, if you are interested in understanding the history of Cocoa and Mac OS X, I&#8217;d recommend checking out <a href="http://www.shawcomputing.net/">David Shaw&#8217;s website</a>.  He has a wealth of information on NeXT, Rhapsody, and Apple that many of you would find very interesting.  Great job David!</p>
<p>As I mentioned the other night I&#8217;ll be giving a presentation on Object-C 2.0 at the July meeting.  This will be a much more detailed look at ObjC which will allow us to dig into its core syntax and features.</p>
<p>I hope to see you all again at the next CocoaHeads meeting on 7/10 @ 6pm.</p>
<p>-Thanks,<br />
 Bob</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2008/06/16/cocoaheads-were-off-to-a-great-start/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Review: Cocoa Programming for Mac OS X, 3rd Edition</title>
		<link>http://www.bobmccune.com/2008/05/20/review-cocoa-programming-for-mac-os-x-3rd-edition/</link>
		<comments>http://www.bobmccune.com/2008/05/20/review-cocoa-programming-for-mac-os-x-3rd-edition/#comments</comments>
		<pubDate>Tue, 20 May 2008 16:21:21 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/?p=78</guid>
		<description><![CDATA[Over the weekend, I finished reading the 3rd edition of Cocoa Programming for Mac OS X by Aaron Hillegass. The previous edition had long been considered the best introduction to the topic, but it had grown rather out of date given the major changes introduced in the Leopard release of OS X. Thankfully, the 3rd [...]]]></description>
			<content:encoded><![CDATA[<p></p><p><a href="http://www.amazon.com/gp/product/0321503619?ie=UTF8&#038;tag=bobmcom-20&#038;link_code=as3&#038;camp=211189&#038;creative=373489&#038;creativeASIN=0321503619"><img src="http://www.bobmccune.com/wp-content/uploads/2010/06/hillegass.png" alt="" title="Cocoa Programming for Mac OS X" width="150" height="197" class="alignleft size-full wp-image-170" /></a></p>
<p>Over the weekend, I finished reading the 3rd edition of <a href="http://www.amazon.com/gp/product/0321503619?ie=UTF8&#038;tag=bobmcom-20&#038;link_code=as3&#038;camp=211189&#038;creative=373489&#038;creativeASIN=0321503619">Cocoa Programming for Mac OS X</a> by Aaron Hillegass.  The previous edition had long been considered the best introduction to the topic, but it had grown rather out of date given the major changes introduced in the Leopard release of OS X.  Thankfully, the 3rd edition has been completely revised to reflect the current state of Mac OS X development.</p>
<p><span style="text-decoration:underline">Cocoa Programming for Mac OS X</span> is an introductory guide to programming on the Mac platform.  It provides broad coverage of the core Mac programming concepts you&#8217;ll need to write real world applications, but is not intended to be a definitive reference on the subject.  Aaron&#8217;s presentation of the material is excellent and the code examples really help explain the concepts being covered.</p>
<p>The organization of the book has changed considerably since the last release.  Several less-relevant and irrelevant chapters have been dropped and replaced with chapters covering Core Data, Core Animation, web services, and garbage collection.  Additionally, the existing content and examples have been significantly revised giving this release the feel of a whole new book.</p>
<p>I would highly recommend this title to anyone interested in Mac development.  Even if you own the previous edition, I think you&#8217;ll find the new and revised content well worth the price.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2008/05/20/review-cocoa-programming-for-mac-os-x-3rd-edition/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Operation: Cocoa</title>
		<link>http://www.bobmccune.com/2008/03/13/operation-cocoa/</link>
		<comments>http://www.bobmccune.com/2008/03/13/operation-cocoa/#comments</comments>
		<pubDate>Thu, 13 Mar 2008 07:10:28 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/2008/03/13/operation-cocoa/</guid>
		<description><![CDATA[Over the past few months I&#8217;ve been spending a lot my free time learning Objective-C and Cocoa. Although it&#8217;s been fun learning a new language and framework, it has been somewhat of an uphill climb. Objective-C was the easy part. If you have some familiarity with C and also some experience with an OO language [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>Over the past few months I&#8217;ve been spending a lot my free time learning Objective-C and Cocoa.  Although it&#8217;s been fun learning a new language and framework, it has been somewhat of an uphill climb.  Objective-C was the easy part.  If you have some familiarity with C and also some experience with an OO language like Java, C#, or C++,  you&#8217;ll pick it up within a week or two.  Cocoa, on the other hand, can take quite a bit more time to wrap your head around.  It&#8217;s a very large and robust framework and understanding how to use its constituent parts to form a whole requires a fairly significant investment of time and effort.</p>
<p>One of the biggest challenges to learning Cocoa is the lack of up-to-date books.  There are several on the market, but most are woefully outdated.  The language, development tools, and available frameworks and APIs have changed considerably since these books were written which can present an obstacle to learning from these older references.  Thankfully, there are some new and updated titles coming out this year from <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FCocoa-Programming-Mac-OS-3rd%2Fdp%2F0321503619%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1205383619%26sr%3D1-2&#038;tag=bobmcom-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Aaron Hillegass</a><img src="http://www.assoc-amazon.com/e/ir?t=bobmcom-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FCore-Animation-OS-Compelling-Interfaces%2Fdp%2F1934356107%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1205383661%26sr%3D1-5&#038;tag=bobmcom-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Bill Dudney</a><img src="http://www.assoc-amazon.com/e/ir?t=bobmcom-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />, and <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&#038;location=http%3A%2F%2Fwww.amazon.com%2FCocoa-Design-Patterns-Developers-Library%2Fdp%2F0321535022%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1205383478%26sr%3D1-2&#038;tag=bobmcom-20&#038;linkCode=ur2&#038;camp=1789&#038;creative=9325">Erik Buck</a><img src="http://www.assoc-amazon.com/e/ir?t=bobmcom-20&amp;l=ur2&amp;o=1" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" />.  I&#8217;ve got &#8216;em all on pre-order!</p>
<p>Although the book market may be a bit lacking at the moment that doesn&#8217;t mean there aren&#8217;t useful resources to be found.  In fact, you&#8217;ll find quite the opposite is true.  <a href="http://developer.apple.com/mac/">Apple&#8217;s Developer Connection</a> posts many references, guides, and sample code at its site.  There are also a number of useful third-party resources I visit regularly including <a href="http://www.macdevnet.com/">MacDevNet</a>, <a href="http://cocoadev.com/">CocoaDev</a>, <a href="http://www.cocoabuilder.com/">CocoaBuilder</a>, and <a href="http://theocacao.com/">Scott Stevenson&#8217;s</a> excellent <a href="http://cocoadevcentral.com/">Cocoa Dev Central</a>.  Additionally, you&#8217;ll find dozens of great blogs and articles in various places.  One of my new favorite Mac dev blogs is Marcus S. Zarra&#8217;s  and Matt Long&#8217;s <a href="http://www.cimgf.com/">Cocoa Is My Girlfriend</a>.  The content is great and the name is brilliant!</p>
<p>The problem isn&#8217;t that there&#8217;s not enough information to be found.  The problem is how do you make sense of it all and more importantly, how do you use this information to build a real application?</p>
<p>To help in this regard I&#8217;m starting a new site called <span style="text-decoration:underline">Operation: Cocoa</span>.  Its purpose will be to provide the aspiring Cocoa developer with a path through the maze.  Although it will likely be a few months before the site is up and running, I&#8217;m already working on content and will be hosting it on this site in the interim.  The first tutorial entitled &#8220;Hello Cocoa&#8221; will be posted in the next week or two.</p>
<p>I&#8217;m very interested to hear any comments or opinions you have about this idea: what you think about the site name, what kind of content would you like to see, etc.</p>
<p>
Thanks,<br/><br />
&nbsp;&nbsp;-Bob</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2008/03/13/operation-cocoa/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Core Animation</title>
		<link>http://www.bobmccune.com/2008/02/03/core-animation/</link>
		<comments>http://www.bobmccune.com/2008/02/03/core-animation/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 07:20:31 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Cocoa]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/2008/02/03/core-animation/</guid>
		<description><![CDATA[For the past few months I&#8217;ve been spending a considerable amount of my free time learning Objective-C and Cocoa. Apple&#8217;s Leopard release has introduced so many new and interesting developer technologies that I decided it was finally time to dive in and learn to write code for my favorite platform. One of the new Leopard [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>For the past few months I&#8217;ve been spending a considerable amount of my free time learning Objective-C and Cocoa.  Apple&#8217;s Leopard release has introduced so many new and interesting developer technologies that I decided it was finally time to dive in and learn to write code for my favorite platform.</p>
<p>One of the new Leopard APIs I&#8217;ve been excited to learn is called <a href="http://developer.apple.com/graphicsimaging/coreanimation/">Core Animation</a> (CA).  CA is a new Cocoa framework providing you the ability to create UIs with rich animations and compositions by using with a simple, consistent programming model.  This allows you to easily create visual effects for your applications that would be impractical, if not downright impossible, to do on other platforms.</p>
<p>One of the challenges to learning CA (especially given my n00b status) is the lack of books and tutorials on the topic.  So, I was pleasantly surprised to receive an email from the <a href="http://www.pragprog.com/">Pragmatic Programmer</a> guys introducing Bill Dudney&#8217;s new book <a href="http://www.pragprog.com/titles/bdcora"><span style="text-decoration:underline;">Core Animation for OS X</span></a>.  It provides in-depth coverage of all the key concepts including animations, filtering, layering, and 3D effects.  I&#8217;ve just started reading it, but it looks great so far.  I&#8217;ll be sure to write a full review when I complete it.</p>
<p>The book is currently available in &#8220;beta&#8221; PDF form with the final print version available in July.  You can find out more about the book and get your own copy at <a href="http://www.pragprog.com/titles/bdcora"><span style="text-decoration:underline;">its website</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2008/02/03/core-animation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TCJUG &#8211; What&#039;s New in Spring 2.5?</title>
		<link>http://www.bobmccune.com/2008/01/21/tcjug-whats-new-in-spring-25/</link>
		<comments>http://www.bobmccune.com/2008/01/21/tcjug-whats-new-in-spring-25/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 18:23:42 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/2008/01/21/tcjug-whats-new-in-spring-25/</guid>
		<description><![CDATA[I&#8217;d like to say thanks to everyone who attended my Spring 2.5 presentation at last week&#8217;s TCJUG meeting. We had another good turnout, which is always nice to see. Jeff Jensen at Intertech is always a great host and I had a fun time presenting. I hope the info was useful to you. I&#8217;ve attached [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;d like to say thanks to everyone who attended my <a href="http://www.springframework.org/node/561">Spring 2.5</a> presentation at last week&#8217;s <a href="http://www.intertech-inc.com/Resource/JavaUserGroup.aspx">TCJUG</a> meeting.  We had another good turnout, which is always nice to see.  Jeff Jensen at <a href="http://www.intertech-inc.com/">Intertech</a> is always a great host and I had a fun time presenting.  I hope the info was useful to you.  I&#8217;ve attached copies of the presentation and sample code for your reference.</p>
<div>
<a href='http://www.bobmccune.com/wp-content/uploads/2008/01/whats-new-in-spring-25.pdf' title='whats-new-in-spring-25.pdf'>What&#8217;s New in Spring 2.5?</a>
</div>
<div>
<a href='http://www.bobmccune.com/wp-content/uploads/2008/01/spring-web.zip' title='spring-web.zip'>Spring 2.5 Contacts Demo Application</a>
</div>
<p>
<br/><br />
Thanks again!</p>
<p>-Bob</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2008/01/21/tcjug-whats-new-in-spring-25/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TCJUG &#8211; JPA Presentation</title>
		<link>http://www.bobmccune.com/2007/03/23/tcjug-jpa-presentation/</link>
		<comments>http://www.bobmccune.com/2007/03/23/tcjug-jpa-presentation/#comments</comments>
		<pubDate>Fri, 23 Mar 2007 03:16:07 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Presentation]]></category>

		<guid isPermaLink="false">http://www.bobmccune.com/2007/03/23/tcjug-jpa-presentation/</guid>
		<description><![CDATA[I&#8217;d like to say thanks to everyone who attended my JPA presentation at last night&#8217;s TCJUG meeting. It was a full house and there was a lot of good conversation during and after the presentation. As always, Jeff Jensen at Intertech is a great host and I had a fun time. I hope the info [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I&#8217;d like to say thanks to everyone who attended my <a href="http://java.sun.com/javaee/technologies/persistence.jsp">JPA</a> presentation at last night&#8217;s <a href="http://www.intertech-inc.com/Resource/JavaUserGroup.aspx">TCJUG</a> meeting.  It was a full house and there was a lot of good conversation during and after the presentation.  As always, Jeff Jensen at <a href="http://www.intertech-inc.com/">Intertech</a> is a great host and I had a fun time.  I hope the info was useful to you.  I&#8217;ll post the slides and demo application as soon as I finish making some Maven tweaks.  Look for it early next week.</p>
<p>Thanks again!</p>
<p>-Bob</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2007/03/23/tcjug-jpa-presentation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Unit Testing Best Practices</title>
		<link>http://www.bobmccune.com/2006/12/09/unit-testing-best-practices/</link>
		<comments>http://www.bobmccune.com/2006/12/09/unit-testing-best-practices/#comments</comments>
		<pubDate>Sun, 10 Dec 2006 00:49:46 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://bobmccune.com/2006/12/09/unit-testing-best-practices/</guid>
		<description><![CDATA[I was recently compiling a list of Test-driven Development (TDD) &#8220;Best Practices&#8221; for my client project&#8217;s wiki site and thought this would probably be useful to the community at large. I&#8217;ve been an avid practitioner and proponent of test-driven development for a few years now and have found it to be one of the most [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I was recently compiling a list of Test-driven Development (TDD) &#8220;Best Practices&#8221; for my client project&#8217;s wiki site and thought this would probably be useful to the community at large.  I&#8217;ve been an avid practitioner and proponent of test-driven development for a few years now and have found it to be one of the most important practices I&#8217;ve adopted.  If practiced correctly, it will have a significantly positive impact on the design and quality of your code.</p>
<p><span id="more-32"></span></p>
<p>Without further ado, here is my list of key concerns to keep in mind while practicing TDD&#8230;</p>
<h4>Test Behavior, Not Methods</h4>
<p>It is important to write test cases that test how a client object would interact with the class under test.  A common question asked is &#8220;should I write unit tests for private or package-private methods?&#8221;, and my general response is, no.  Private methods should not be directly tested as they do not comprise an object&#8217;s publicly exported API and instead only exist to support its publicly observable behavior.  This certainly isn&#8217;t a hard and fast rule.  If a private method is sufficiently complex or would be difficult to fully test via its public methods it can make sense to test these directly.  If you choose to do so you&#8217;ll need to write some reflection code to invoke these methods or use something like the utilities provided by the <a href="http://junit-addons.sourceforge.net/">JUnit Add-ons</a> project.</p>
<h4>Apply the &#8220;Too Simple to Break&#8221; Rule</h4>
<p>Although maintaining a high degree of code coverage across the test suite is important, striving for 100% coverage is not advisable.  There is a point of diminishing returns that needs to be considered.  A good rule of thumb is if a method is too simple to break, don&#8217;t write a unit test for it.  The question of what constitutes &#8220;to simple to break&#8221; is certainly up to interpretation, however, it&#8217;s rarely useful to write a unit test for a method like the following:</p>
<pre>
public String getName() {
    return name;
}
</pre>
<p>Testing simple getter and setter methods is generally not advisable.</p>
<h4>Use Object-Oriented Best Practices In Your Test Cases</h4>
<p>It is important to view your test cases as first class code assets.  The same design techniques you would apply when writing your production code should be applied to test cases as well.  This means you should look for opportunities to refactor your test cases to pull up common functionality into a base class, remove duplicate code, decompose long methods, etc.  Failing to do so will drive up the cost of change and will contribute to the test suite losing value over time.</p>
<h4>Use Appropriate Method Names</h4>
<p>This may seem obvious, but it is all too common to see test methods with the following signatures:</p>
<pre>
public void testGetUser1() {
}

public void testGetUser2() {
}
</pre>
<p>Instead, use method names that clearly describe the purpose of the test.  Doing so makes your test cases more understandable and easier for the team to maintain.  For instance:</p>
<pre>
public void testGetUserWithInvalidUsername() {
}

public void testGetUserThrowsExpiredCredentialsException() {
}
</pre>
<h4>Don&#8217;t Use Try/Catch Blocks to Catch Unexpected Exceptions</h4>
<p>The keyword with this practice is <i>unexpected</i>.  The JUnit framework automatically handles any exceptions that bubble up the call stack.  It is important that you don&#8217;t circumvent this behavior by using a try/catch block around a test that <u>should not</u> throw an exception.  Doing so can mask bugs that won&#8217;t be caught until the code is in production.  For instance, consider the following implementation of the <code>UserService</code> interface:</p>
<pre>
public class UserServiceImpl implements UserService {

  private UserDao dao;

  public User getUser(String username)
                          throws UserNotFoundException {
    User user = dao.getUser(username);
    if (user == null) {
      String msg = "No User found for: '" + username + "'";
      throw new UserNotFoundException(msg);
    }
    return user;
  }

  public void setUserDao(UserDao dao) {
    this.dao = dao;
  }

}
</pre>
<p>There are two primary scenarios that need to be tested:</p>
<ol>
<li>A valid <code>User</code> instance is returned for the specified username.</li>
<li>A <code>UserNotFoundException</code> is thrown for the specified username.</li>
</ol>
<p>In the first scenario, no exception should be thrown so we should not attempt to catch it.  Instead, we should declare, in the test method&#8217;s signature, that an exception is thrown.  This will allow any exceptions to bubble up to the JUnit framework in the event that our setup code was incorrect and inadvertently caused this exception.</p>
<p>In the second scenario, we are explicitly checking for the case where an exception <u>is</u> thrown.  This means we need to wrap this in a try/catch block and fail the test if the exception <u>is not</u> thrown.</p>
<p>The following test case implementation shows how to appropriately test these two scenarios.  I&#8217;m using <a href="http://www.easymock.org">EasyMock</a> to mock the interaction with my DAO.</p>
<pre>
public class UserServiceImplTest extends TestCase {

  private UserDao dao;
  private MockControl ctrl;

  private UserServiceImpl service;

  protected void setUp() throws Exception {
    ctrl = MockControl.createControl(UserDao.class);
    dao = (UserDao) ctrl.getMock();
    service = new UserServiceImpl();
    service.setUserDao(dao);
  }

  public void testGetUserWithValidUserName()
                                  throws Exception {

    User expected = new User();
    String validUser = "validUser";
    ctrl.expectAndReturn(dao.getUser(validUser), expected);
    ctrl.replay();

    User result = service.getUser(validUser);
    assertSame(expected, result);

    ctrl.verify();
  }

  public void testGetUserThrowsUserNotFoundException() {

    String bogusUser = "bogusUser";
    ctrl.expectAndReturn(dao.getUser(bogusUser), null);
    ctrl.replay();

    try {
        service.getUser(bogusUser);
        fail("Should have thrown a UserNotFoundException");
    } catch (UserNotFoundException e) {
        // should be here
    }

    ctrl.verify();
  }

}
</pre>
<h4>Don&#8217;t Rely on Visual Inspection</h4>
<p>The success or failure of a test should not be predicated on a developer &#8220;eyeballing&#8221; the console to determine the result.  This means you shouldn&#8217;t use <code>System.out.println()</code> or <code>Logger.debug()</code> statements to determine your test&#8217;s success state.  Instead, you should exclusively rely on JUnit&#8217;s various <code>assertXXX()</code> methods so the test can be run in an unattended, automated manner.</p>
<h4>Use A Code Coverage Tool</h4>
<p>It is often difficult to gauge how completely your test cases are exercising a piece of code.  Failing to fully test all execution paths could result in you missing a critical application bug that causes a system failure.  Coverage utilities can easily be incorporated into your Ant or Maven build processes which will generate a visual coverage report showing you precisely which lines of code were tested.</p>
<p>Here are a few open source tools I use for this purpose:<br />
<a href="http://cobertura.sourceforge.net/">Cobertura</a><br />
<a href="http://emma.sourceforge.net/">Emma</a><br />
<a href="http://www.eclemma.org/">EclEmma</a></p>
<h4>Use The Appropriate Tool for the Testing Scenario</h4>
<p>JUnit provides a solid framework for unit testing in a Java environment, however, JUnit alone does not provide you all the capabilities you need to effectively test your code.  It is important to find the right tool for the job.  Luckily, the community has developed a wide variety of extension to JUnit that will help you test virtually any scenario you might come across.</p>
<p>Here are a few unit and integration testing tools I commonly use:<br />
<a href="http://www.dbunit.org/">DBUnit</a><br />
<a href="http://mockrunner.sourceforge.net/">MockRunner</a><br />
<a href="http://www.easymock.org/">EasyMock</a><br />
<a href="http://www.jmock.org/">JMock</a><br />
<a href="http://www.openqa.org/selenium/">Selenium</a></p>
<p>That&#8217;s it for now.  Hopefully this will provide you with some useful things to keep in mind while writing your test cases.  If you have any additions to this list, please comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2006/12/09/unit-testing-best-practices/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EclEmma</title>
		<link>http://www.bobmccune.com/2006/11/22/eclemma/</link>
		<comments>http://www.bobmccune.com/2006/11/22/eclemma/#comments</comments>
		<pubDate>Wed, 22 Nov 2006 01:59:41 +0000</pubDate>
		<dc:creator>Bob McCune</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Unit Testing]]></category>

		<guid isPermaLink="false">http://bobmccune.com/?p=20</guid>
		<description><![CDATA[I recently came across a new Eclipse plugin you should definitely check out if you&#8217;re doing test-driven development (TDD). It&#8217;s called EclEmma and is based on Emma, the open source code coverage tool. Code coverage reporting tools like Emma or Cobertura are a must if you are doing TDD, but the one downside these tools [...]]]></description>
			<content:encoded><![CDATA[<p></p><p>I recently came across a new Eclipse plugin you should definitely check out if you&#8217;re doing test-driven development (TDD). It&#8217;s called <a href="http://www.eclemma.org/">EclEmma</a> and is based on Emma, the open source code coverage tool. Code coverage reporting tools like <a href="http://emma.sourceforge.net/">Emma</a> or <a href="http://cobertura.sourceforge.net/">Cobertura</a> are a must if you are doing TDD, but the one downside these tools have is it&#8217;s not easy to run them against an individual class while you&#8217;re writing your test. EclEmma solves this problem by nicely integrating with Eclipse which makes getting coverage feedback as easy as firing up the IDE&#8217;s JUnit test runner.  It&#8217;s still an early release, so you may find some rough edges here and there, however, I&#8217;ve been quite impressed with what I&#8217;ve seen so far.  It definitely looks promising.</p>
<p><a href="http://www.eclemma.org/">EclEmma Homepage</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bobmccune.com/2006/11/22/eclemma/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
