<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" gd:etag="W/&quot;C08HSXw6eip7ImA9WhFSFUU.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514</id><updated>2013-06-18T12:57:18.212-06:00</updated><category term="AOP" /><category term="Vista" /><category term="TestNG" /><category term="JPA" /><category term="OpenLaszlo" /><category term="Lucene" /><category term="Java SE 6" /><category term="POI" /><category term="Noop" /><category term="Spring Framework" /><category term="ActionScript" /><category term="ECMAScript" /><category term="Clojure" /><category term="OpenXML4J" /><category term="JAX-RS" /><category term="IntelliJ IDEA" /><category term="Windows" /><category term="Security" /><category term="General Development" /><category term="Oracle" /><category term="Swing" /><category term="JAXX" /><category term="JDeveloper" /><category term="Software Development Management" /><category term="Web Development" /><category term="Scala" /><category term="XQuery" /><category term="Portals" /><category term="PowerShell" /><category term="JRuby" /><category term="BlazeDS" /><category term="Guava" /><category term="JAXB" /><category term="Java SE 7" /><category term="Akka" /><category term="Java EE 6" /><category term="Flex" /><category term="JAX-WS" /><category term="JavaOne 2010" /><category term="JUnit" /><category term="JSON" /><category term="Android" /><category term="Unit Testing" /><category term="HTML5" /><category term="VisualVM" /><category term="Book Review" /><category term="Servlets" /><category term="JFreeChart" /><category term="JBoss" /><category term="OSGi" /><category term="MySQL" /><category term="Annotations" /><category term="REST" /><category term="Java EE 5" /><category term="Cloud Computing" /><category term="AIR" /><category term="GlassFish" /><category term="Java SE 8" /><category term="XML" /><category term="NetBeans" /><category term="JEdit" /><category term="NoSQL" /><category term="Groovy" /><category term="JDBC" /><category term="JavaOne 2011" /><category term="properties" /><category term="JavaFX" /><category term="Blogging" /><category term="C#" /><category term="PHP" /><category term="Apache Commons" /><category term="JavaOne 2012" /><category term="Firefox" /><category term="Gradle" /><category term="RMOUG" /><category term="JMX" /><category term="Ruby" /><category term="Database" /><category term="Linux" /><category term="Eclipse" /><category term="JSF" /><category term="Publications" /><category term="JavaScript" /><category term="Java (General)" /><category term="Ant" /><category term="Java SE 9" /><title>Inspired by Actual Events</title><subtitle type="html">&lt;p&gt;&lt;strong&gt;Dustin's Software Development Cogitations and Speculations&lt;/strong&gt;&lt;/p&gt;

My observations and thoughts concerning software development (general development, Java, JavaFX, Groovy, Flex, ...).</subtitle><link rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml" href="http://marxsoftware.blogspot.com/feeds/posts/default" /><link rel="alternate" type="text/html" href="http://marxsoftware.blogspot.com/" /><link rel="next" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default?start-index=9&amp;max-results=8&amp;redirect=false&amp;v=2" /><author><name>@DustinMarx</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><generator version="7.00" uri="http://www.blogger.com">Blogger</generator><openSearch:totalResults>911</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>8</openSearch:itemsPerPage><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/InspiredByActualEvents" /><feedburner:info uri="inspiredbyactualevents" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><entry gd:etag="W/&quot;DUUARHk4cCp7ImA9WhFSFUs.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-7790533315980931976</id><published>2013-06-01T20:08:00.002-06:00</published><updated>2013-06-18T08:54:05.738-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-06-18T08:54:05.738-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="JavaScript" /><category scheme="http://www.blogger.com/atom/ns#" term="Book Review" /><title>Book Review: Learning JavaScriptMVC</title><content type="html">&lt;p&gt;&lt;a href="http://www.packtpub.com/"&gt;Packt Publishing&lt;/a&gt; invited me to review the recently published &lt;a href="http://www.packtpub.com/building-javasript-web-applications-using-javascriptmvc/book"&gt;Learning JavaScriptMVC&lt;/a&gt; by &lt;a href="http://www.packtpub.com/authors/profiles/wojciech-bednarski"&gt;Wojciech Bednarski&lt;/a&gt;. I describe my impressions of this book on &lt;a href="http://javascriptmvc.com/"&gt;JavaScriptMVC&lt;/a&gt; in this post. Before beginning my review, I'll quote the description of &lt;a href="http://en.wikipedia.org/wiki/JavaScriptMVC"&gt;JavaScriptMVC&lt;/a&gt; from its &lt;a href="http://javascriptmvc.com/follow.html"&gt;web site&lt;/a&gt;: "A collection of the best practices and tools for building JavaScript applications" that is "built on top of jQuery." I reviewed the ebook (PDF) version of &lt;em&gt;Learning JavaScriptMVC&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.packtpub.com/building-javasript-web-applications-using-javascriptmvc/book"&gt;Learning JavaScriptMVC: Learn to build well-structured JavaScript web applications using JavaScriptMVC&lt;/a&gt; is a 100+ page book with six chapters. The Preface states that readers should "be familiar with JavaScript, browser APIs, jQuery, HTML5, and CSS." It also states that the book is intended "for anyone who is interested in developing small- and mid-size web applications with the &lt;a href="http://javascriptmvc.com/docs.html"&gt;JavaScriptMVC framework&lt;/a&gt;, which is based on the most popular JavaScript library – jQuery."&lt;/p&gt;

&lt;strong&gt;Chapter 1: Getting Started with JavaScriptMVC&lt;/strong&gt;

&lt;p&gt;The &lt;a href="http://www.packtpub.com/building-javasript-web-applications-using-javascriptmvc/book#chapter_1"&gt;first chapter&lt;/a&gt; introduces "&lt;a href="http://javascriptmvc.com/"&gt;JavaScriptMVC&lt;/a&gt; (&lt;a href="http://bitovi.com/blog/2010/02/talkin-javascriptmvc-is-hard.html"&gt;JMVC&lt;/a&gt;)" as "a &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript"&gt;JavaScript&lt;/a&gt; open source model-view-controller (MVC) framework" built "on top of the &lt;a href="http://jquery.com/"&gt;jQuery&lt;/a&gt; library." The chapter describes other aspects of JavaScript MVC such as historical details, basic objectives, license information, JavaScriptMVC architecture, the four major components of JavaScriptMVC (&lt;a href="http://javascriptmvc.com/docs.html#!stealjs"&gt;StealJS&lt;/a&gt;, &lt;a href="http://javascriptmvc.com/docs.html#!FuncUnit"&gt;FuncUnit&lt;/a&gt;, &lt;a href="http://javascriptmvc.com/docs.html#!jquerymx"&gt;jQueryMX&lt;/a&gt;, and &lt;a href="http://javascriptmvc.com/docs.html#!DocumentJS"&gt;DocumentJS&lt;/a&gt;), and links for more information. A paragraph in this first chapter discusses future plans to rename (&lt;a href="http://donejs.com/docs.html#!"&gt;DoneJS&lt;/a&gt; (&lt;a href="http://donejs.com/docs.html#!jquerypp"&gt;jQuery++&lt;/a&gt;) and &lt;a href="http://canjs.com/"&gt;CanJS&lt;/a&gt;) and make changes to the JavaScriptMVC framework and to some of its major components.&lt;/p&gt;

&lt;p&gt;Chapter 1 includes details on three different approaches for installing JavaScriptMVC. One of the demonstrated approaches is via &lt;a href="http://www.vagrantup.com/"&gt;Vagrant&lt;/a&gt; and &lt;a href="https://www.virtualbox.org/"&gt;Oracle VM VirtualBox&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The first chapter also demonstrates using JavaScriptMVC with a sample application that can be compared to a similar &lt;a href="http://javascriptmvc.com/docs.html#!todo"&gt;sample to-do application&lt;/a&gt; built with other web frameworks at &lt;a href="https://github.com/tastejs/todomvc/tree/gh-pages/architecture-examples"&gt;https://github.com/tastejs/todomvc/tree/gh-pages/architecture-examples&lt;/a&gt;. Several common web development techniques and tools are covered as part of this example: &lt;a href="https://developers.google.com/chrome-developer-tools/"&gt;Google Chrome Inspector&lt;/a&gt;, jQueryMX, and &lt;a href="http://embeddedjs.com/"&gt;Embedded JavaScript&lt;/a&gt; (EJS).&lt;/p&gt;

&lt;strong&gt;Chapter 2: DocumentJS&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://www.packtpub.com/building-javasript-web-applications-using-javascriptmvc/book#chapter_2"&gt;Chapter 2&lt;/a&gt; covers &lt;a href="http://javascriptmvc.com/docs.html#!DocumentJS"&gt;DocumentJS&lt;/a&gt;, which it introduces as "a powerful, yet simple tool designed to easily create searchable documentation for any JavaScript codebase." I think it's worth re-emphasizing here that this is an &lt;em&gt;independent&lt;/em&gt; tool that can be used with any JavaScript code base and is not limited to use on JavaScriptMVC applications.&lt;/p&gt;

&lt;p&gt;Bednarski states in this second chapter that DocumentJS is quickly learned by anyone familiar with &lt;a href="http://usejsdoc.org/"&gt;JSDoc&lt;/a&gt;, &lt;a href="http://yui.github.io/yuidoc/"&gt;YUIDoc&lt;/a&gt;, &lt;a href="http://yardoc.org/"&gt;YARD&lt;/a&gt;, or other Javadoc documentation tools. He also cites DocumentJS's support for &lt;a href="http://daringfireball.net/projects/markdown/"&gt;Markdown&lt;/a&gt; as one of its advantages. This chapter adds documentation comments (look and feel a lot like Javadoc) to the code introduced for the sample application in Chapter 1 before covering how to generate documentation from these special source code comments.&lt;/p&gt;

&lt;strong&gt;Chapter 3: FuncUnit&lt;/strong&gt;

&lt;p&gt;The &lt;a href="http://www.packtpub.com/building-javasript-web-applications-using-javascriptmvc/book#chapter_3"&gt;third chapter&lt;/a&gt; is devoted to &lt;a href="http://javascriptmvc.com/docs.html#!FuncUnit"&gt;FuncUnit&lt;/a&gt;, which it describes as "a functional testing framework with jQuery-like syntax" that "is built on top of the &lt;a href="http://qunitjs.com/"&gt;QUnit&lt;/a&gt; unit test framework." The chapter &lt;a href="http://stackoverflow.com/questions/2741832/unit-tests-vs-functional-testing"&gt;contrasts&lt;/a&gt; functional testing to unit testing and demonstrates using related tools &lt;a href="http://docs.seleniumhq.org/"&gt;Selenium&lt;/a&gt;, &lt;a href="http://phantomjs.org/"&gt;PhantomJS&lt;/a&gt;, and &lt;a href="http://www.envjs.com/"&gt;Envjs&lt;/a&gt; along with &lt;a href="http://maven.apache.org/"&gt;Maven&lt;/a&gt; and &lt;a href="http://jenkins-ci.org/"&gt;Jenkins&lt;/a&gt;.&lt;/p&gt;

&lt;strong&gt;Chapter 4: jQueryMX&lt;/strong&gt;

&lt;p&gt;The &lt;a href="http://www.packtpub.com/building-javasript-web-applications-using-javascriptmvc/book#chapter_4"&gt;fourth chapter&lt;/a&gt; focuses on &lt;a href="http://javascriptmvc.com/docs.html#!jquerymx"&gt;jQueryMX&lt;/a&gt; and describes jQueryMX as "a collection of jQuery libraries that provides functionality necessary to implement and organize large JavaScript applications." The chapter covers several jQueryMX plugins such as &lt;a href="http://javascriptmvc.com/docs.html#!jQuery.Class"&gt;jQuery.Class&lt;/a&gt; (&lt;a href="http://javascriptmvc.com/docs.html#!mvc.class"&gt;based&lt;/a&gt; on &lt;a href="http://ejohn.org/about/"&gt;John Resig&lt;/a&gt;'s &lt;a href="http://ejohn.org/blog/simple-javascript-inheritance/"&gt;Simple JavaScript Inheritance&lt;/a&gt;), &lt;a href="http://javascriptmvc.com/docs.html#!jQuery.Model"&gt;jQuery.Model&lt;/a&gt;, and &lt;a href="http://javascriptmvc.com/docs.html#!mvc.view"&gt;jQuery.View&lt;/a&gt;.&lt;/p&gt;

&lt;strong&gt;Chapter 5: StealJS&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://www.packtpub.com/building-javasript-web-applications-using-javascriptmvc/book#chapter_5"&gt;Chapter 5&lt;/a&gt; covers &lt;a href="http://javascriptmvc.com/docs.html#!stealjs"&gt;StealJS&lt;/a&gt; and describes it as an "independent code manager and packaging tool." The chapter also states that "StealJS requires Java 1.6 or greater." The chapter demonstrates using StealJS to load files, to log, to clean/beautify code, and to concatenate and compress code. Related tools mentioned in this chapter include &lt;a href="https://developers.google.com/closure/"&gt;Google Closure&lt;/a&gt; and &lt;a href="http://www.jslint.com/"&gt;JSLint&lt;/a&gt;.&lt;/p&gt;

&lt;strong&gt;Chapter 6: Building the App&lt;/strong&gt;

&lt;p&gt;The &lt;a href="http://www.packtpub.com/building-javasript-web-applications-using-javascriptmvc/book#chapter_6"&gt;final chapter&lt;/a&gt;'s stated goal is "to show how to build a real-word application from concept
through design, implementation, documentation, and testing." Along the way, the chapter mentions many process-related issues including use of &lt;a href="https://trello.com/"&gt;Trello&lt;/a&gt;, &lt;a href="http://trac.edgewall.org/"&gt;Trac&lt;/a&gt;, &lt;a href="http://en.wikipedia.org/wiki/JIRA"&gt;JIRA&lt;/a&gt;, and &lt;a href="http://git-scm.com/"&gt;Git&lt;/a&gt;. The example in the chapter also demonstrates using &lt;a href="https://developer.mozilla.org/en-US/docs/IndexedDB"&gt;IndexedDB&lt;/a&gt;, &lt;a href="http://pouchdb.com/"&gt;PouchDB&lt;/a&gt;, and &lt;a href="http://sass-lang.com/"&gt;Sass&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Similarly to the first chapter, the last chapter is code-intensive as the entire application's code base is included in the chapter.&lt;/p&gt;

&lt;strong&gt;Positives&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Conciseness&lt;/strong&gt; - The author limits background details and opinions to sentences rather than the normal paragraphs or pages many authors devote to background and opinions.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Code Examples&lt;/strong&gt; - The book is code-heavy with numerous pages devoted to code listings and to commands for running various tools.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Frame of Reference&lt;/strong&gt; - This book's most useful feature may be that it provides an overall frame of reference for understanding what the JavaScriptMVC framework is. With the overall framework understood at a high level, the reader can go to other resources for additional or more in-depth details.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;References&lt;/strong&gt; - The book's conciseness (just over 100 pages total) leaves many details out and so it is helpful that it has numerous references to online resources with additional details.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Truth in Advertising&lt;/strong&gt; - The book's preface stated that this book is intended for readers familiar with "JavaScript, browser APIs, jQuery, HTML5, and CSS." This is not overstated; the heavy use of code (especially JavaScript) means that the book is going to be much more useful to those already familiar with JavaScript and related technologies than those not familiar with those technologies. As the "Learning" part of the title implies, this book is an introductory book rather than a detailed reference book.&lt;/li&gt;
&lt;/ul&gt;

&lt;strong&gt;Negatives&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Grammar and Sentence Structure&lt;/strong&gt; - One of the advantages traditionally associated with books when compared to blogs is better spelling, grammar, and sentence structure in books. This is typically because books (and even articles) typically have much more editorial process than blog posts (the latter of which often have no editorial process). Unfortunately, much of this book felt like very little editing had occurred in the book publication process. There were numerous disjoint sentences and a couple cases where the chosen words did not seem to be used properly in the context in which they were used.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Good Online Documentation&lt;/strong&gt; - This is really not a disadvantage of &lt;em&gt;Learning JavaScriptMVC&lt;/em&gt;, but I thought it worth pointing out for those trying to decide whether to purchase the book. The &lt;a href="http://javascriptmvc.com/docs.html#!"&gt;online documentation for JavaScriptMVC&lt;/a&gt; seems fairly thorough and clear and might be sufficient for those wanting to learn and use JavaScriptMVC. In fact, the JavaScriptMVC documentation even includes its &lt;a href="http://javascriptmvc.com/docs.html#!todo"&gt;own To-Do example application&lt;/a&gt;. I often prefer having a printed or electronic copy of a book because they have some advantages, but this is also a matter of taste. It is important to reiterate that this book is an introductory book rather than a reference book.&lt;/li&gt;
&lt;/ul&gt;

&lt;strong&gt;Conclusion&lt;/strong&gt;

&lt;p&gt;I was happy to read &lt;em&gt;Learning JavaScriptMVC&lt;/em&gt; and become more acquainted with JavaScriptMVC and how it fits in with other popular web development technologies and tools. This book seems best suited for developers who are about to use JavaScriptMVC without significant previous experience using that framework but with experience with JavaScript and other common web technologies. &lt;em&gt;Learning JavaScriptMVC&lt;/em&gt; provides a different introductory perspective than the well-written online documentation and is filled with code examples demonstrating the concepts.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/xb3_Yaevd-g" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=7790533315980931976" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/7790533315980931976?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/7790533315980931976?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/xb3_Yaevd-g/book-review-learning-javascriptmvc.html" title="Book Review: Learning JavaScriptMVC" /><author><name>@DustinMarx</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2013/06/book-review-learning-javascriptmvc.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DU4GQ304cCp7ImA9WhFTEkw.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-5982858836623551388</id><published>2013-05-31T07:00:00.001-06:00</published><updated>2013-06-02T18:05:22.338-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-06-02T18:05:22.338-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java (General)" /><category scheme="http://www.blogger.com/atom/ns#" term="Android" /><category scheme="http://www.blogger.com/atom/ns#" term="Gradle" /><title>Java Happenings in May 2013</title><content type="html">&lt;p&gt;This post very briefly summarizes some recent (within the past few weeks) developments in the world of Java.&lt;/p&gt;

&lt;strong&gt;Yet Another Java Versioning Scheme&lt;/strong&gt;

&lt;p&gt;Oracle has changed the &lt;a href="http://www.oracle.com/technetwork/java/javase/overview/jdk-version-number-scheme-1918258.html"&gt;Java version numbering schema&lt;/a&gt; again, this time in an effort "to avoid confusion caused by renumbering releases" because of the "recent increase of security releases" that have already led to skipped numbers and renumbered releases.&lt;/p&gt;

&lt;strong&gt;The Closure of java.blogs&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://www.atlassian.com/"&gt;Atlassian&lt;/a&gt;'s &lt;a href="http://javablogs.com/"&gt;java.blogs&lt;/a&gt; is currently &lt;a href="https://twitter.com/mraible/status/332471407239913472"&gt;closed&lt;/a&gt;, though it seems like this &lt;a href="http://osintegrators.com/RIPJavaBlogs"&gt;may not be permanent&lt;/a&gt; if there is sufficient interest in it being restored and updated. There is a form at the &lt;a href="http://javablogs.com/"&gt;main site&lt;/a&gt; available for folks interested in it being restored to make that known.&lt;/p&gt;

&lt;strong&gt;Kicking the Tires of JDK 8&lt;/strong&gt;

&lt;p&gt;In &lt;a href="https://blogs.oracle.com/java/entry/contribute_to_the_quality_of"&gt;Feedback Wanted, Java SE 8&lt;/a&gt;, Tori Wieldt provides links for downloading the latest released versions of Java SE 8 under development. She also provides links to the source code and to a list of Java Enhancement Proposals that have been incorporated into the latest JDK 8 releases. There are also links for reporting bugs found with a new release and for obtaining help if problems are encountered trying to use a new release.&lt;/p&gt;

&lt;strong&gt;JDK8 Javadoc Updates&lt;/strong&gt;

&lt;p&gt;&lt;a href="https://blogs.oracle.com/jjg/"&gt;Jonathan Gibbons&lt;/a&gt;'s post &lt;a href="https://blogs.oracle.com/jjg/entry/javadoc_tlc"&gt;javadoc TLC&lt;/a&gt; summarizes &lt;a href="http://mail.openjdk.java.net/pipermail/compiler-dev/2013-May/006224.html"&gt;recent JDK8 tools fixes&lt;/a&gt; and the effect on Javadoc. I &lt;a href="http://marxsoftware.blogspot.com/2013/04/jdk-8-javadoc-tweaked-for-methods.html"&gt;previously blogged&lt;/a&gt; on some changes in JDK8 Javadoc and its presentation of class methods.&lt;/p&gt;

&lt;strong&gt;Android, IntelliJ, and Gradle&lt;/strong&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/events/io/"&gt;Google I/O&lt;/a&gt; 2013 recently concluded and there were some &lt;a href="https://developers.google.com/events/io/sessions/324603352"&gt;big announcements&lt;/a&gt; in the &lt;a href="http://developer.android.com/index.html"&gt;Android&lt;/a&gt; space related to products that are well-known in the Java community. In particular, &lt;a href="http://www.jetbrains.com/idea/"&gt;IntelliJ&lt;/a&gt;-based &lt;a href="http://developer.android.com/sdk/installing/studio.html"&gt;Android Studio&lt;/a&gt; is now offered (currently "early access preview") alongside more mature &lt;a href="http://www.eclipse.org/"&gt;Eclipse&lt;/a&gt;-based &lt;a href="http://developer.android.com/tools/sdk/eclipse-adt.html"&gt;Eclipse ADT plug-in&lt;/a&gt; and &lt;a href="http://www.gradle.org/"&gt;Gradle&lt;/a&gt; is now the &lt;a href="http://tools.android.com/tech-docs/new-build-system"&gt;main Android build system&lt;/a&gt;.&lt;/p&gt;

&lt;strong&gt;JAXconf&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://jaxconf.com/"&gt;JAX Conference&lt;/a&gt; will be next week (June 4-5) in the &lt;a href="http://www.santaclara.org/conventioncenter/"&gt;Santa Clara Convention Center&lt;/a&gt;.&lt;/p&gt;

&lt;strong&gt;Java EE 7 Kick-off&lt;/strong&gt;

&lt;p&gt;The webcast &lt;a href="https://blogs.oracle.com/otn/entry/introducing_java_ee_7_june"&gt;Introducing Java EE 7&lt;/a&gt; has been announced and will be broadcast live. &lt;a href="https://blogs.oracle.com/geertjan/entry/welcome_to_me"&gt;Geertjan Wielenga&lt;/a&gt; has &lt;a href="https://blogs.oracle.com/geertjan/entry/wednesday_june_12_2013_java"&gt;posted that NetBeans support&lt;/a&gt; for Java EE 7 will be featured in this webcast.&lt;/p&gt;

&lt;strong&gt;New JDK 7 and JDK 8 Early Access Releases&lt;/strong&gt;

&lt;p&gt;In &lt;a href="http://robilad.livejournal.com/134010.html"&gt;Food For Tests: 7u40 Build b26 &amp; 8 Build b91&lt;/a&gt;, Dalibor Topic writes of the new Early Access releases of JDK 7 Update 40 and JDK 8 Build b91. One thing of particular note is that the new JDK 8 build has "&lt;a href="http://openjdk.java.net/projects/nashorn/"&gt;Nashorn&lt;/a&gt; replacing &lt;a href="http://marxsoftware.blogspot.com/2009/04/javascript-in-java.html"&gt;Rhino&lt;/a&gt;."&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/R-CUpaMQhOE" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=5982858836623551388" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/5982858836623551388?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/5982858836623551388?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/R-CUpaMQhOE/java-happenings-in-may-2013.html" title="Java Happenings in May 2013" /><author><name>@DustinMarx</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><thr:total>1</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2013/05/java-happenings-in-may-2013.html</feedburner:origLink></entry><entry gd:etag="W/&quot;C08AQX8zcSp7ImA9WhBbEE8.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-2320419882400776619</id><published>2013-05-08T08:04:00.000-06:00</published><updated>2013-05-08T08:04:00.189-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-05-08T08:04:00.189-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java SE 8" /><title>JDK 8's Calendar.Builder</title><content type="html">&lt;p&gt;One of the defining characteristics of the &lt;a href="http://jaxenter.com/5-reasons-to-be-excited-about-java-in-2013-45938.html"&gt;brave new world of Java&lt;/a&gt; is the increasing prevalence of the builder pattern in the &lt;a href="http://stackoverflow.com/questions/328496/when-would-you-use-the-builder-pattern"&gt;Java space&lt;/a&gt;. &lt;a href="http://groovy.codehaus.org/"&gt;Groovy&lt;/a&gt;, which appears to be the most popular alternative language (to Java) on the JVM, is well-known for its heavy use of the Builder in both the core libraries and in Groovy-supported libraries and frameworks. &lt;a href="https://twitter.com/joshbloch"&gt;Josh Bloch&lt;/a&gt; brought the pattern to the forefront of Java developer community mindset with coverage of the &lt;a href="http://stackoverflow.com/questions/5007355/builder-pattern-in-effective-java"&gt;pattern&lt;/a&gt; in &lt;a href="http://www.informit.com/articles/article.aspx?p=1216151&amp;seqNum=2"&gt;Item #2&lt;/a&gt; of the second edition of his highly influential &lt;a href="http://www.informit.com/store/effective-java-9780321356680"&gt;Effective Java&lt;/a&gt;. There have been several builders added to the JDK including the addition of &lt;a href="http://docs.oracle.com/javase/7/docs/api/java/util/Locale.Builder.html"&gt;Locale.Builder&lt;/a&gt; in &lt;a href="http://docs.oracle.com/javase/7/docs/api/"&gt;J2SE 1.7&lt;/a&gt;. In this post, I briefly introduce &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.Builder.html"&gt;Calendar.Builder&lt;/a&gt; coming to &lt;a href="http://download.java.net/jdk8/docs/api/"&gt;JDK 8&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Today, a Java developer typically populates an instance of the &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.html"&gt;Calendar class&lt;/a&gt; by either calling one of the "set" methods that accepts a lengthy list of content for the instance or by calling individual "set" methods on the instance one after another. These two typical approaches for populating a &lt;code&gt;Calendar&lt;/code&gt; instance are demonstrated in the next two code listings.&lt;/p&gt;

&lt;strong&gt;Populating Calendar with Single 'set' Method&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
/**
 * Demonstrate pre-JDK 8 method of instantiating Calendar instance using
 * "set" method for main fields.
 */
public static void demoCalendarWithSingleSet()
{
   final Calendar calendar =
      Calendar.getInstance(TimeZone.getTimeZone(timeZoneId),
         ENGLISH);
   calendar.set(2013, APRIL, 6, 15, 45, 22);
   out.println("Calendar via Constructor: " + stringifyCalendar(calendar));
}
&lt;/pre&gt;

&lt;strong&gt;Populating Calendar with Multiple Individual 'set' Methods&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
/**
 * Demonstrate pre-JDK 8 method of instantiating Calendar instance using
 * individual "set" calls for each pair of field names and values.
 */
public static void demoCalendarWithIndividualSets()
{
   final Calendar calendar =
      Calendar.getInstance(
         TimeZone.getTimeZone(timeZoneId),
         ENGLISH);
   calendar.set(YEAR, 2013);
   calendar.set(MONTH, APRIL);
   calendar.set(DATE, 6);
   calendar.set(HOUR, 3);
   calendar.set(MINUTE, 45);
   calendar.set(SECOND, 22);
   calendar.set(AM_PM, PM);
   out.println("Calendar via set methods: " + stringifyCalendar(calendar));
}
&lt;/pre&gt;

&lt;p&gt;SIDE NOTE: In both of the examples above, I used another &lt;a href="http://marxsoftware.blogspot.com/2012/04/are-static-imports-becoming.html"&gt;increasingly popular feature&lt;/a&gt; of modern Java: the &lt;a href="http://docs.oracle.com/javase/1.5.0/docs/guide/language/static-import.html"&gt;static import&lt;/a&gt;. The constants such as &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Locale.html#ENGLISH"&gt;ENGLISH&lt;/a&gt;, &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.html#YEAR"&gt;YEAR&lt;/a&gt;, and &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.html#SECOND"&gt;SECOND&lt;/a&gt; are actually statically imported from classes such as &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Locale.html"&gt;Locale&lt;/a&gt; and &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.html"&gt;Calendar&lt;/a&gt;. As I have &lt;a href="http://marxsoftware.blogspot.com/2012/04/are-static-imports-becoming.html"&gt;previously written&lt;/a&gt;, static imports seem to be increasingly popular with Java developers, especially in light of the trend toward fluent interfaces.&lt;/p&gt;

&lt;p&gt;The two "traditional" approaches shown above show different ways to populate the &lt;code&gt;Calendar&lt;/code&gt; instance. One extreme is to set each individual field separately while the other is to set all the significant fields with a single "set" method. There are advantages to each approach. The single "set" method has fewer states of an "unfinished" object than the multiple-set approach, but the multiple-set approach is more readable because the name of the value being set is clear based on the first parameter to each "set" method. The single-set approach is a little unwieldy because it takes six integers that can be easily mixed up in order passed because there is no obvious way to differentiate which integer is which other than the implicit order.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.Builder.html"&gt;Calendar.Builder&lt;/a&gt; leverages on the advertised benefits of the Builder as described by Bloch: removes the existence of "inconsistent states partway through [an object's] construction." This is demonstrated in the next code listing.&lt;/p&gt;

&lt;strong&gt;Calendar.Builder Allows Single-Statement Instantiation with Readable Settings&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
   /**
    * Demonstrate using JDK 8's Calendar.Builder to instantiate an instance of
    * Calendar using the set methods to set each field individually based on
    * field name and value.
    */
   public static void demoCalendarWithCalendarBuilderSetFields()
   {
      final Calendar calendar =
         new Calendar.Builder()
            .set(YEAR, 2013)
            .set(MONTH, APRIL)
            .set(DATE, 6)
            .set(HOUR, 15)
            .set(MINUTE, 45)
            .set(SECOND, 22)
            .setTimeZone(TimeZone.getTimeZone(timeZoneId))
            .setLocale(ENGLISH)
            .build();
      out.println(
           "Calendar via Calendar.Builder 'set' Fields: "
         + stringifyCalendar(calendar));
   }
&lt;/pre&gt;

&lt;p&gt;In the above code listing, the &lt;code&gt;Calendar&lt;/code&gt; instance is created AND populated in one statement, removing the need to risk an object being in an inconsistent state across multiple statements. This example retains the readability of the traditional individual "set" methods approach [&lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.Builder.html#set(int, int)"&gt;set(int, int)&lt;/a&gt;] with the added safety of having the object populated fully immediately at instantiation.&lt;/p&gt;

&lt;p&gt;For developers who want to provide fewer individual "set" methods, another opportunity with &lt;code&gt;Calendar.Builder&lt;/code&gt; is to use the &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.Builder.html#setDate(int, int, int)"&gt;setDate(int, int, int)&lt;/a&gt; and &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.Builder.html#setTimeOfDay(int, int, int)"&gt;setTimeOfDay(int, int, int)&lt;/a&gt; methods as demonstrated in the next code listing.&lt;/p&gt;

&lt;strong&gt;Calendar.Builder Setting Date and Time as Two Calls&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
/**
 * Demonstrate using JDK 8's Calendar.Builder to instantiate an instance of
 * Calendar using the "setDate" and "setTimeOfDay" builder methods.
 */
public static void demoCalendarWithCalendarBuilderSetDaySetTime()
{
   final Calendar calendar =
      new Calendar.Builder()
         .setDate(2013, APRIL, 6)
         .setTimeOfDay(15, 45, 22)
         .setTimeZone(TimeZone.getTimeZone(timeZoneId))
         .setLocale(ENGLISH).build();
   out.println(
        "Calendar via Calendar.Builder setDate/setTimeOfDay: "
      + stringifyCalendar(calendar));
}
&lt;/pre&gt;

&lt;p&gt;There are fewer characters and lines to type with this approach, but it partially reintroduces the disadvantage of being more likely to have an integer parameter inadvertently switched as each of the two methods takes three integers (or an overloaded version of &lt;code&gt;setTimeOfDay()&lt;/code&gt; will take a fourth integer representing milliseconds).&lt;/p&gt;

&lt;p&gt;For developers wanting the ultimate flexibility in specifying &lt;code&gt;Calendar&lt;/code&gt; parameters during its instantiation, &lt;code&gt;Calendar.Builder&lt;/code&gt; provides the method &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.Builder.html#setFields(int...)"&gt;setFields(int ...)&lt;/a&gt; that takes an arbitrary length of pairs of integers with the first integer of the pair representing the field to be set and the second integer of the pair representing the value for that field. This method is used in the next code listing.&lt;/p&gt;

&lt;strong&gt;Specifying Calendar Fields via Calendar.Builder's setFields Method&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
   /**
    * Demonstrate using JDK 8's Calendar.Builder to instantiate an instance of
    * Calendar using the setFields method that allows providing of Calendar
    * fields as key/value pairs.
    */
   public static void demoCalendarWithCalendarBuilderSetPairs()
   {
      final Calendar calendar =
         new Calendar.Builder()
            .setFields(YEAR, 2013, MONTH, APRIL, DATE, 6, HOUR, 15, MINUTE, 45, SECOND, 22)
            .setTimeZone(TimeZone.getTimeZone("timeZoneId"))
            .setLocale(ENGLISH)
            .build();
      out.println(
           "Calendar via Calendar.Builder setPairs: "
         + stringifyCalendar(calendar));
   }
&lt;/pre&gt;

&lt;p&gt;This &lt;code&gt;setFields(int ...)&lt;/code&gt; method brings greater risk of mangling the order of integers used for instantiation of the new instance of &lt;code&gt;Calendar&lt;/code&gt;, but using the statically imported &lt;code&gt;Calendar&lt;/code&gt; constants does improve readability and reduces the likelihood of mixing the integers incorrectly. If an odd number of integers is provided (meaning that there is an incomplete pair), an &lt;a href="http://download.java.net/jdk8/docs/api/java/lang/IllegalArgumentException.html"&gt;IllegalArgumentException&lt;/a&gt; is thrown.&lt;/p&gt;

&lt;p&gt;Although &lt;code&gt;Calendar.Builder&lt;/code&gt; provides some convenience in instantiating and populating an instance of &lt;code&gt;Calendar&lt;/code&gt;, anyone fortunate enough to adopt JDK 8 will have access to the &lt;a href="http://openjdk.java.net/projects/threeten/"&gt;new date/time API&lt;/a&gt; and so the question might be asked, "Why use Calendar.Builder?" Perhaps the best answer is that there are millions of lines of existing code, libraries, and frameworks out there using and expecting &lt;code&gt;Calendar&lt;/code&gt; instances, so it will probably be a long time before the need for &lt;code&gt;Calendar&lt;/code&gt; is completely gone (if ever). Fortunately, &lt;code&gt;Calandar.Builder&lt;/code&gt; makes it easy to covert an instance of &lt;a href="http://download.java.net/jdk8/docs/api/java/time/Instant.html"&gt;Instant&lt;/a&gt; (part of the &lt;a href="http://download.java.net/jdk8/docs/api/java/time/package-summary.html"&gt;new Java data/time API&lt;/a&gt;) into a &lt;code&gt;Calendar&lt;/code&gt; via &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.Builder.html#setInstant(long)"&gt;CalendarBulder.setInstant(long)&lt;/a&gt;. This is demonstrated in the next code listing.&lt;/p&gt;

&lt;strong&gt;Converting Instant to Calendar with Calendar.Builder&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
   /**
    * Demonstrate using JDK 8's Calendar.Builder to instantiate an instance of
    * Calendar based on "now" Instant.
    */
   public static void demoCalendarWithCalendarBuilderInstant()
   {
      final Calendar calendar =
         new Calendar.Builder().setInstant(Instant.now().toEpochMilli())
            .setTimeZone(TimeZone.getTimeZone(timeZoneId))
            .setLocale(ENGLISH)
            .build();
      out.println("Calendar via Calendar.Builder and Instant: " + stringifyCalendar(calendar));
   }
&lt;/pre&gt;

&lt;p&gt;Note that an overloaded version of the &lt;code&gt;setInstant&lt;/code&gt; method accepts a &lt;code&gt;Date&lt;/code&gt; for instantiating a &lt;code&gt;Calendar&lt;/code&gt;. In both cases, whether instantiated with &lt;code&gt;setInstant(long)&lt;/code&gt; or &lt;code&gt;setInstant(Date)&lt;/code&gt;, no other "set" method on &lt;code&gt;Calender.Builder&lt;/code&gt; should be called to avoid an &lt;a href="http://docs.oracle.com/javase/7/docs/api/java/lang/IllegalStateException.html"&gt;IllegalStateException&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;It is easy to go the other direction (getting an &lt;code&gt;Instant&lt;/code&gt; from a &lt;code&gt;Calendar&lt;/code&gt;) using &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.html#toInstant()"&gt;Calendar.toInstant()&lt;/a&gt;. Other methods introduced to &lt;code&gt;Calendar&lt;/code&gt; with JDK 1.8 are related to providing the &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.html#getCalendarType()"&gt;current instance's calendar type&lt;/a&gt; (as a String) or the set of &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.html#getAvailableCalendarTypes()"&gt;available calendar types&lt;/a&gt; (Set of Strings). When I run &lt;a href="http://download.java.net/jdk8/docs/api/java/util/Calendar.html#getAvailableCalendarTypes()"&gt;Calendar.getAvailableCalendarTypes()&lt;/a&gt; on my system, I see these three Strings: "&lt;a href="http://docs.oracle.com/javase/7/docs/api/java/util/GregorianCalendar.html"&gt;gregory&lt;/a&gt;", "&lt;a href="http://docs.oracle.com/javase/6/docs/technotes/guides/intl/enhancements.html"&gt;japanese&lt;/a&gt;", and "&lt;a href="http://en.wikipedia.org/wiki/Buddhist_calendar"&gt;buddhist&lt;/a&gt;" (the same three calendars documented in &lt;a href="http://docs.oracle.com/javase/6/docs/technotes/guides/intl/calendar.doc.html"&gt;Supported Calendars&lt;/a&gt;)&lt;/p&gt;

&lt;strong&gt;Conclusion&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://marxsoftware.blogspot.com/2012/03/how-badly-do-we-want-new-java-datetime.html"&gt;Like many Java developers&lt;/a&gt;, I'm looking forward to an improved Java data/time API that is built into the standard Java Development Kit. However, I also realize that, especially in large code bases and when using libraries and frameworks expecting &lt;code&gt;Calendar&lt;/code&gt; or &lt;code&gt;Date&lt;/code&gt;, that I won't be free of &lt;code&gt;Calendar&lt;/code&gt; and &lt;code&gt;Date&lt;/code&gt; for some time. The introduction of &lt;code&gt;Calendar.Builder&lt;/code&gt; in JDK 8 eases that burden a bit.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/3ES1ga7QV8I" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=2320419882400776619" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/2320419882400776619?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/2320419882400776619?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/3ES1ga7QV8I/jdk-8-calendar-builder.html" title="JDK 8's Calendar.Builder" /><author><name>@DustinMarx</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2013/05/jdk-8-calendar-builder.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUcGQX85fyp7ImA9WhBVGUU.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-5063077494136203666</id><published>2013-04-26T08:37:00.000-06:00</published><updated>2013-04-26T08:37:00.127-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-26T08:37:00.127-06:00</app:edited><title>Interesting Java Blog Posts in Mid-April 2013</title><content type="html">&lt;p&gt;There have been numerous Java-related blog posts in recent days and I reference and summarize four of them here.&lt;/p&gt;

&lt;strong&gt;Creating a Memory Leak&lt;/strong&gt;

&lt;p&gt;In the "rather evil post" &lt;a href="http://plumbr.eu/blog/how-to-create-a-memory-leak"&gt;How to Create a Memory Leak&lt;/a&gt;, &lt;a href="http://plumbr.eu/about-us"&gt;Ivo Mägi&lt;/a&gt; describes and provides code examples of two commons leaks. The first leak covered is related to objects lacking the &lt;a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#hashCode()"&gt;hashCode()&lt;/a&gt;/&lt;a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)"&gt;equals(Object)&lt;/a&gt; implementations to be used properly in &lt;a href="http://marxsoftware.blogspot.com/2010/02/basic-java-hashcode-and-equals.html"&gt;collections needing them to be correct&lt;/a&gt;. The second covered leak is related to the &lt;a href="http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4513622"&gt;change of handling&lt;/a&gt; for &lt;a href="http://java-performance.info/changes-to-string-java-1-7-0_06/"&gt;String internals&lt;/a&gt; in &lt;a href="http://www.oracle.com/technetwork/java/javase/7u6-relnotes-1729681.html"&gt;Java 7 Update 6&lt;/a&gt;. The second problem is a reminder of the subtle and difficult to diagnose issues that can occur when even minor differences exist between versions of Java used in different environments.&lt;/p&gt;

&lt;strong&gt;StringBuffer Was Never a Good Idea&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://www.blogger.com/profile/17982030676088168612"&gt;Peter Lawrey&lt;/a&gt;'s blog post &lt;a href="http://vanillajava.blogspot.com/2013/04/why-synchronized-stringbuffer-was-never.html"&gt;Why a synchronized StringBuffer was never a good idea&lt;/a&gt; articulates something I've found to be the case: most uses of &lt;a href="http://docs.oracle.com/javase/7/docs/api/java/lang/StringBuilder.html"&gt;building up strings&lt;/a&gt; do not need to be thread safe. Even when thread safety is needed, Lawrey points out why &lt;a href="http://docs.oracle.com/javase/7/docs/api/java/lang/StringBuffer.html"&gt;StringBuffer&lt;/a&gt; often is not sufficient.&lt;/p&gt;

&lt;strong&gt;9 Fallacies of Java Performance&lt;/strong&gt;

&lt;p&gt;&lt;a href="http://www.infoq.com/author/Ben-Evans"&gt;Ben Evans&lt;/a&gt; looks at &lt;a href="http://www.infoq.com/articles/9_Fallacies_Java_Performance"&gt;9 Fallacies of Java Performance&lt;/a&gt; including the outdated mantra "Java is slow" and problems with using microbenchmarks to make performance decisions. He points out that "Java performance-tuning intuition is often misleading" and that "we require empirical data and tools to help us visualize and understand the platform's behavior."&lt;/p&gt;

&lt;strong&gt;Infamous Java Bugs and Pitfalls&lt;/strong&gt;

&lt;p&gt;Murat Yener has collected some Java-related "bugs and pitfalls" in his post &lt;a href="http://www.devchronicles.com/2013/04/infamous-java-bugs-and-pitfalls.html"&gt;Infamous Java Bugs and Pitfalls&lt;/a&gt; such as &lt;a href="http://docs.oracle.com/javase/tutorial/java/data/autoboxing.html"&gt;autoboxing&lt;/a&gt; issues and &lt;a href="http://marxsoftware.blogspot.com/2010/01/caution-double-to-bigdecimal-in-java.html"&gt;BigDecimal quirks&lt;/a&gt;.&lt;/p&gt;

&lt;strong&gt;Conclusion&lt;/strong&gt;

&lt;p&gt;The four blog posts on Java cited above have been recently posted and provide good reminders and potentially new information on things to be cognizant of when developing with Java.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/1a76EGMgNzo" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=5063077494136203666" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/5063077494136203666?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/5063077494136203666?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/1a76EGMgNzo/interesting-java-blog-posts-apr-2013.html" title="Interesting Java Blog Posts in Mid-April 2013" /><author><name>@DustinMarx</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2013/04/interesting-java-blog-posts-apr-2013.html</feedburner:origLink></entry><entry gd:etag="W/&quot;AkUCRHk7eyp7ImA9WhBVGE0.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-8267190737119474603</id><published>2013-04-22T08:50:00.000-06:00</published><updated>2013-04-24T06:57:45.703-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-24T06:57:45.703-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java (General)" /><category scheme="http://www.blogger.com/atom/ns#" term="Java SE 7" /><title>More Reasons to Update to Java 7</title><content type="html">&lt;p&gt;In &lt;a href="https://blogs.oracle.com/java/entry/java_se_7_update_21"&gt;Java SE 7 Update 21 Release and more&lt;/a&gt;, &lt;a href="http://blog.eisele.net/2011/10/my-interview-with-tori-wieldt-java.html"&gt;Tori Wieldt&lt;/a&gt; pointed out that "Oracle has released three updates to Java" this past week: &lt;a href="http://www.oracle.com/technetwork/java/javase/6u45-relnotes-1932876.html"&gt;Java 6 Update 45&lt;/a&gt;, &lt;a href="http://www.oracle.com/technetwork/java/javase/7u21-relnotes-1932873.html"&gt;Java 7 Update 21&lt;/a&gt;, and &lt;a href="http://www.oracle.com/technetwork/java/javase/emb7u21-relnotes-1932887.html"&gt;Java SE Embedded 7 Update 21&lt;/a&gt;. This &lt;a href="https://blogs.oracle.com/java/"&gt;The Java Source&lt;/a&gt; blog post briefly focuses on "new security &lt;i&gt;features&lt;/i&gt; in this release" (more than just &lt;a href="http://krebsonsecurity.com/2013/04/java-update-plugs-42-security-holes/"&gt;security fixes&lt;/a&gt;): "&lt;a href="http://www.oracle.com/technetwork/java/javase/7u21-relnotes-1932873.html#serverjre"&gt;new Server JRE package&lt;/a&gt;" (tools used commonly for server "without the Java plug-in, auto-update or installer found in the regular JRE package"), removal of &lt;i&gt;low&lt;/i&gt; and &lt;i&gt;custom&lt;/i&gt; settings from &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/guides/jweb/jcp.html#security"&gt;Java Control Panel&lt;/a&gt;, and changes to &lt;a href="https://blogs.oracle.com/java/entry/imp_your_applets_and_web"&gt;Security Dialogs&lt;/a&gt;. &lt;a href="https://plus.google.com/100362024804331957185/posts"&gt;Markus Eisele&lt;/a&gt; has posted additional details on the new security features in &lt;a href="http://blog.eisele.net/2013/04/java-7-update-21-security-improvements.html"&gt;Java 7 Update 21 Security Improvements in Detail&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Whether it be security fixes or security features, the attention paid to security in Java SE 6 and Java SE 7 has come at a &lt;a href="http://www.infoworld.com/d/application-development/java-8-release-delayed-until-next-year-216797"&gt;price&lt;/a&gt;: it looks like Java 8 is likely to be delayed again (this time pushing &lt;a href="http://openjdk.java.net/projects/jdk8/milestones#General_Availability"&gt;General Availability&lt;/a&gt; to First Quarter 2014). In the blog post &lt;a href="http://mreinhold.org/blog/secure-the-train"&gt;Java 8: Secure the train&lt;/a&gt;, &lt;a href="http://mreinhold.org/"&gt;Mark Reinhold&lt;/a&gt; writes, "Maintaining the security of the Java Platform always takes priority over developing new features, and so these efforts have inevitably taken engineers away from working on Java 8. ... As a consequence of this renewed focus on security the Java 8 schedule, with a GA release in early September, is no longer achievable." For people waiting to upgrade from Java 6 to skip to Java 8, this delay of Java 8 is another reason to consider upgrading to Java 7 now.&lt;/p&gt;

&lt;p&gt;Although Oracle has been &lt;a href="http://www.infoq.com/news/2013/01/jdk6-retirement"&gt;warning&lt;/a&gt; of the end of free availability of &lt;a href="http://www.oracle.com/technetwork/java/javase/eol-135779.html"&gt;Java 6 updates&lt;/a&gt; since the beginning of the year and &lt;a href="https://blogs.oracle.com/henrik/entry/java_6_eol_h_h"&gt;extended Public Updates&lt;/a&gt; multiple times, &lt;a href="https://blogs.oracle.com/henrik/"&gt;Henrik Stahl&lt;/a&gt;'s post &lt;a href="https://blogs.oracle.com/henrik/entry/oracle_jdk_7u21_released_with"&gt;Oracle JDK 7u21 released with new security features&lt;/a&gt; states that "we are not planning any more public JDK 6 updates" (past Java 6 Update 45). Users of Java 6 are encouraged to &lt;a href="Migrating from Java SE 6 to Java SE 7"&gt;migrate to Java 7&lt;/a&gt; to continue receiving public updates. In his Question-and-Answer formatted post, Stahl also covers alternatives such as access to newer Java 6 releases via the appropriate support license ("Oracle middleware or applications customer") or via separately purchased &lt;a href="http://www.oracle.com/us/technologies/java/standard-edition/support/overview/index.html"&gt;Java SE support&lt;/a&gt;.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-0UMStnECqSQ/UXSxPvnxHdI/AAAAAAAAELU/voXvmZCT9YY/s1600/JavaSE7EndOfPublicSupportJava6Update45.png" imageanchor="1" &gt;&lt;img border="0" src="http://4.bp.blogspot.com/-0UMStnECqSQ/UXSxPvnxHdI/AAAAAAAAELU/voXvmZCT9YY/s320/JavaSE7EndOfPublicSupportJava6Update45.png" /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Besides access to future public releases of Java SE, there are other reasons to upgrade to Java 7. Some of these are enumerated in &lt;a href="http://www.agilejava.eu/2011/07/15/7-reasons-to-upgrade-to-java-7/"&gt;7 reasons to upgrade to Java 7&lt;/a&gt; and the "Features of Java 7" section of "&lt;a href="http://java.com/en/download/faq/why_upgrade.xml"&gt;Why should I upgrade to Java 7?&lt;/a&gt;"&lt;/p&gt;
&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/yRzDyVa5Ia8" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=8267190737119474603" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/8267190737119474603?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/8267190737119474603?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/yRzDyVa5Ia8/more-reasons-to-update-to-java-7.html" title="More Reasons to Update to Java 7" /><author><name>@DustinMarx</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://4.bp.blogspot.com/-0UMStnECqSQ/UXSxPvnxHdI/AAAAAAAAELU/voXvmZCT9YY/s72-c/JavaSE7EndOfPublicSupportJava6Update45.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2013/04/more-reasons-to-update-to-java-7.html</feedburner:origLink></entry><entry gd:etag="W/&quot;A0QMQH0_fyp7ImA9WhBVEUQ.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-8589992029019490043</id><published>2013-04-16T08:03:00.000-06:00</published><updated>2013-04-17T05:49:41.347-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-17T05:49:41.347-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java SE 8" /><title>JDK 8 Javadoc Tweaked For Methods Listings</title><content type="html">&lt;p&gt;Since its beginning, &lt;a href="http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html"&gt;Javadoc&lt;/a&gt; output has been largely static HTML with navigation links and simple stylesheet styling of its appearance. &lt;a href="http://docs.oracle.com/javase/7/docs/api/"&gt;Java SE 7&lt;/a&gt; saw the &lt;a href="http://marxsoftware.blogspot.com/2011/06/new-java-se-7-javadoc-api-documentation.html"&gt;first significant change in Javadoc output&lt;/a&gt; default appearance in a long time and now it looks like &lt;a href="http://openjdk.java.net/projects/jdk8/"&gt;JDK 8&lt;/a&gt; will introduce a new twist on generated Javadoc output. In this post, I look briefly at the more dynamic filtering of methods in Javadoc output by type of method that appears to be available with JDK 8's &lt;a href="http://www.oracle.com/technetwork/java/javase/documentation/index-137868.html"&gt;javadoc&lt;/a&gt; tool.&lt;/p&gt;

&lt;p&gt;The following two screen snapshots compare the JDK 7 and JDK 8 versions of default Javadoc output for the &lt;a href="http://docs.oracle.com/javase/7/docs/api/java/util/Calendar.html"&gt;Calendar&lt;/a&gt; class (chosen for its variety of method types).&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-VOpBQ6-iBbU/UWtnVFUyKmI/AAAAAAAAEKU/TLrNbau13l8/s1600/javase7JavadocCalendarMethods.png" imageanchor="1" &gt;&lt;img border="0" src="http://2.bp.blogspot.com/-VOpBQ6-iBbU/UWtnVFUyKmI/AAAAAAAAEKU/TLrNbau13l8/s320/javase7JavadocCalendarMethods.png" /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-6VYurcniJ4o/UWtnYRahUFI/AAAAAAAAEKc/dyKUAr8IVNU/s1600/jdk8JavadocCalendarMethods.png" imageanchor="1" &gt;&lt;img border="0" src="http://1.bp.blogspot.com/-6VYurcniJ4o/UWtnYRahUFI/AAAAAAAAEKc/dyKUAr8IVNU/s320/jdk8JavadocCalendarMethods.png" /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;Although the Javadoc output for JDK 8 has the same overall styles (including orange "tabs" for "Constructors", "Fields", "Methods" and so forth) as Java 7 Javadoc documentation, the methods in the JDK 8 generated documentation have multiple orange tabs above the listing of methods that allow the reader to click on the appropriate tab to see the appropriate subset of methods. The names of the tabs are about as self-explanatory as you could want with names like "All Methods" (all methods on the class), "&lt;a href="http://www.javaworld.com/javaqa/2001-11/03-qa-1121-mrhappy.html"&gt;Static Methods&lt;/a&gt;" (class-level methods), "&lt;a href="http://math.hws.edu/javanotes/c5/s1.html"&gt;Instance Methods&lt;/a&gt;" (object-level methods), "&lt;a href="http://docs.oracle.com/javase/tutorial/java/IandI/abstract.html"&gt;Abstract Methods&lt;/a&gt;" (methods without implementation), and "&lt;a href="http://butunclebob.com/ArticleS.DeanWampler.ShouldYouEverOverrideConcreteMethods"&gt;Concrete Methods&lt;/a&gt;" (implemented methods).&lt;/p&gt;

&lt;p&gt;The next series of screen snapshots demonstrate how clicking on any of these tabs invokes embedded JavaScript code that calls appropriate functions in the &lt;code style="font-weight: bold;"&gt;script.js&lt;/code&gt; file that exists at the root level of the generated Javadoc directory structure.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-k31xB5cxiLs/UWtrxADnB6I/AAAAAAAAEK8/-CJnMrPKVP4/s1600/jdk8JavadocCalendarStaticMethods.png" imageanchor="1" &gt;&lt;img border="0" src="http://1.bp.blogspot.com/-k31xB5cxiLs/UWtrxADnB6I/AAAAAAAAEK8/-CJnMrPKVP4/s320/jdk8JavadocCalendarStaticMethods.png" /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-sPUlIlekqoQ/UWtrxfqI1VI/AAAAAAAAELA/vTiMxvfOlK4/s1600/jdk8JavadocCalendarInstanceMethods.png" imageanchor="1" &gt;&lt;img border="0" src="http://3.bp.blogspot.com/-sPUlIlekqoQ/UWtrxfqI1VI/AAAAAAAAELA/vTiMxvfOlK4/s320/jdk8JavadocCalendarInstanceMethods.png" /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-idzlTEXw-WM/UWtrwbeDQdI/AAAAAAAAEKs/LmPEAnKH97w/s1600/jdk8JavadocCalendarAbstractMethods.png" imageanchor="1" &gt;&lt;img border="0" src="http://3.bp.blogspot.com/-idzlTEXw-WM/UWtrwbeDQdI/AAAAAAAAEKs/LmPEAnKH97w/s320/jdk8JavadocCalendarAbstractMethods.png" /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-bPQ-ZojnymM/UWtrw0XSVNI/AAAAAAAAEK0/P5twRAuxt3g/s1600/jdk8JavadocCalendarConcreteMethods.png" imageanchor="1" &gt;&lt;img border="0" src="http://2.bp.blogspot.com/-bPQ-ZojnymM/UWtrw0XSVNI/AAAAAAAAEK0/P5twRAuxt3g/s320/jdk8JavadocCalendarConcreteMethods.png" /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;This is a minor, but still somewhat handy, feature of Javadoc in JDK 8. I have often looked through methods of Javadoc for a class with mixed method types for methods that fit one particular type. Now, rather than needing to scan for keywords such as "static" or "abstract" or for the absence of those same words, I can simply use these "tabs" to filter the types of methods I want to see for a given class.&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/lBe9TC3wgTg" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=8589992029019490043" title="1 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/8589992029019490043?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/8589992029019490043?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/lBe9TC3wgTg/jdk-8-javadoc-tweaked-for-methods.html" title="JDK 8 Javadoc Tweaked For Methods Listings" /><author><name>@DustinMarx</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://2.bp.blogspot.com/-VOpBQ6-iBbU/UWtnVFUyKmI/AAAAAAAAEKU/TLrNbau13l8/s72-c/javase7JavadocCalendarMethods.png" height="72" width="72" /><thr:total>1</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2013/04/jdk-8-javadoc-tweaked-for-methods.html</feedburner:origLink></entry><entry gd:etag="W/&quot;DUQFSHo_fip7ImA9WhBVEEU.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-5397814073385027363</id><published>2013-04-15T07:26:00.000-06:00</published><updated>2013-04-15T22:41:59.446-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-15T22:41:59.446-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java (General)" /><category scheme="http://www.blogger.com/atom/ns#" term="Groovy" /><title>Browsing the COS Naming Service Namespace with Groovy</title><content type="html">&lt;p&gt;There was a time when &lt;a href="http://www.omg.org/gettingstarted/corbafaq.htm"&gt;CORBA&lt;/a&gt; was all the rage and was as trendy and popular as any favored technology that has come along since. Although CORBA does not get the attention in blogs and other online media that it would have in those days or that other technologies get today, it &lt;a href="http://netbeans.dzone.com/nb-call-ejb-on-glassfish"&gt;still&lt;/a&gt; underlies several of the technologies that many of us use. In this post, I look at using &lt;a href="http://groovy.codehaus.org/"&gt;Groovy&lt;/a&gt; to browse the objects in a hierarchical namespace associated with the &lt;a href="http://www.omg.org/cgi-bin/doc?formal/97-06-18.pdf"&gt;CORBA Common Object Services&lt;/a&gt; (COS) &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/guides/idl/jidlNaming.html#nameserver"&gt;Naming Service&lt;/a&gt; that is provided by &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/guides/idl/GShome.html"&gt;Java IDL&lt;/a&gt; (which also includes &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/tools/#idl"&gt;command line tools&lt;/a&gt;) and supports &lt;a href="http://glassfish.java.net/javaee5/ejb/EJB_FAQ.html"&gt;GlassFish's EJBs&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The &lt;a href="http://docs.oracle.com/javase/index.html"&gt;Oracle Java SE Documentation&lt;/a&gt; contains a highly useful page called &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/guides/idl/jidlNaming.html"&gt;Naming Service&lt;/a&gt; that provides Java source code with explanations for &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/guides/idl/jidlNaming.html#example1"&gt;adding objects to the namespace&lt;/a&gt;, &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/guides/idl/jidlNaming.html#example2"&gt;resolving objects from the namespace&lt;/a&gt;, and &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/guides/idl/jidlNaming.html#example3"&gt;browsing the namespace&lt;/a&gt;. In this post, I convert the Java code providing for the third example (browsing the namespace) to Groovy for a script that is easy to use to check objects in the namespace. That script is shown next.&lt;/p&gt;

&lt;strong&gt;browseNamingService.groovy&lt;/strong&gt;
&lt;pre name="code" class="java" style="font-size: 9pt; overflow: auto;"&gt;
#!/usr/bin/env groovy
//
// browseNamingService.groovy &amp;lt;hostname&amp;gt; &amp;lt;port&amp;gt;
//
// Adapted from Example #3 at
// http://docs.oracle.com/javase/7/docs/technotes/guides/idl/jidlNaming.html#example3

if (args.length &amp;lt; 2)
{
   println "\n\nUsage: browseNamingService.groovy &amp;lt;hostname&amp;gt; &amp;lt;port&amp;gt;\n\n"
   System.exit(-1)
}

import java.util.Properties
import org.omg.CORBA.*
import org.omg.CosNaming.*

def properties = new Properties()
properties.put("org.omg.CORBA.ORBInitialPort", args[1])
properties.put("org.omg.CORBA.ORBInitialHost", args[0])
def orb = ORB.init(args, properties)

def namingContext = NamingContextExtHelper.narrow(orb.resolve_initial_references("NameService"))

def bindingList = new BindingListHolder()
def bindingListIterator = new BindingIteratorHolder()
namingContext.list(1000, bindingList, bindingListIterator)
def bindings = bindingList.value

bindings.each
{ binding -&amp;gt;
   def lastIndex = binding.binding_name.length-1;

   // BindingType of ncontext indicates this is a naming context; only other
   // BindingType is nobject.
   if (binding.binding_type == BindingType.ncontext)
   {
      println "Context: ${binding.binding_name[lastIndex].id}"
   }
   else
   {
      println "Object: ${binding.binding_name[lastIndex].id}"
   }
}
&lt;/pre&gt;

&lt;p&gt;For details on what the script above is doing, see the &lt;a href="http://docs.oracle.com/javase/7/docs/technotes/guides/idl/jidlNaming.html#example3"&gt;discussion&lt;/a&gt; surrounding the Java code from which this was adapted. The script makes it easy to provide a hostname and port and find the objects referenced in the namespace at that host and port. This is shown in the &lt;a href="http://glassfish.java.net/"&gt;GlassFish&lt;/a&gt; (&lt;a href="http://stackoverflow.com/questions/1281594/connecting-java-se-client-to-glassfish"&gt;port 3700&lt;/a&gt;) in the next screen snapshot.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-lGJIo0J9k_0/UWnWQF3rVuI/AAAAAAAAEJ8/BriyqnsvoE0/s1600/outputBrowsingNamespaceGroovyScript.png" imageanchor="1" &gt;&lt;img border="0" src="http://1.bp.blogspot.com/-lGJIo0J9k_0/UWnWQF3rVuI/AAAAAAAAEJ8/BriyqnsvoE0/s320/outputBrowsingNamespaceGroovyScript.png" /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;In this case, I happened to know that my GlassFish installation used the default port of 3700 for this CORBA COS Naming Service, but I also could have found that port in the GlassFish web-based Admin GUI as shown in the next screen snapshot.&lt;/p&gt;

&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-KSA9EOSEqm4/UWnYaTX7VoI/AAAAAAAAEKE/ikAWTC4uim4/s1600/glassfish3iiopListenersPort3700.png" imageanchor="1" &gt;&lt;img border="0" src="http://2.bp.blogspot.com/-KSA9EOSEqm4/UWnYaTX7VoI/AAAAAAAAEKE/ikAWTC4uim4/s320/glassfish3iiopListenersPort3700.png" /&gt;&lt;/a&gt;
&lt;/div&gt;

&lt;p&gt;When you don't know the appropriate port and the product whose port you are looking for the Naming Service on doesn't indicate the appropriate port, you can use tools to find potential ports such as &lt;a href="http://en.wikipedia.org/wiki/Netstat"&gt;netstat&lt;/a&gt;, &lt;a href="http://www.cyberciti.biz/faq/find-out-which-service-listening-specific-port/"&gt;lsof&lt;/a&gt;, and &lt;a href="http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx"&gt;TCPView for Windows&lt;/a&gt;. Any of these ports run through the above script without a stack trace and that return names are posts on which a CORBA COS Naming Service is hosted.&lt;/p&gt;


&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/a-2CQgidj2s" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=5397814073385027363" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/5397814073385027363?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/5397814073385027363?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/a-2CQgidj2s/browsing-cos-naming-service-namespace.html" title="Browsing the COS Naming Service Namespace with Groovy" /><author><name>@DustinMarx</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://1.bp.blogspot.com/-lGJIo0J9k_0/UWnWQF3rVuI/AAAAAAAAEJ8/BriyqnsvoE0/s72-c/outputBrowsingNamespaceGroovyScript.png" height="72" width="72" /><thr:total>0</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2013/04/browsing-cos-naming-service-namespace.html</feedburner:origLink></entry><entry gd:etag="W/&quot;CkUCRH0zeip7ImA9WhBWGUo.&quot;"><id>tag:blogger.com,1999:blog-6517450204508339514.post-2527481055696783339</id><published>2013-04-12T20:29:00.003-06:00</published><updated>2013-04-14T14:11:05.382-06:00</updated><app:edited xmlns:app="http://www.w3.org/2007/app">2013-04-14T14:11:05.382-06:00</app:edited><category scheme="http://www.blogger.com/atom/ns#" term="Java (General)" /><category scheme="http://www.blogger.com/atom/ns#" term="Unit Testing" /><category scheme="http://www.blogger.com/atom/ns#" term="Book Review" /><title>Book Review: Effective Unit Testing: A Guide for Java Developers</title><content type="html">&lt;p&gt;In the Preface for &lt;a href="http://www.manning.com/koskela2/"&gt;Effective Unit Testing: A Guide for Java Developers&lt;/a&gt;, author &lt;a href="http://lassekoskela.com/"&gt;Lasse Koskela&lt;/a&gt; states that although the impetus for &lt;em&gt;Effective Unit Testing&lt;/em&gt; was to "write a Java edition of &lt;a href="http://artofunittesting.com/"&gt;Roy Osherove&lt;/a&gt;'s book, &lt;a href="http://www.manning.com/osherove2/"&gt;The Art of Testing with Examples in .NET&lt;/a&gt;," &lt;em&gt;Effective Unit Testing&lt;/em&gt; ended up "having very little in common with Roy's book." Koskela further explains in the Preface that "this book is for the Java programmer," but adds that "writing good tests is a language-agnostic problem" and he recommends his book even for developers using languages other than Java.&lt;/p&gt;

&lt;p&gt;Koskela does a nice job in the "Preface" of succinctly summarizing what the book is and isn't when he says, "I didn't want to give you a tutorial on JUnit or my favorite mock object library" and "I've tried to minimize the amount of technology-specific advice." This is important to note because &lt;em&gt;Effective Unit Testing&lt;/em&gt; is not the book you'll want if you're looking for a book covering intricate details of &lt;a href="http://junit.org/"&gt;JUnit&lt;/a&gt;, &lt;a href="http://testng.org/doc/index.html"&gt;TestNG&lt;/a&gt;, &lt;a href="https://code.google.com/p/mockito/"&gt;Mockito&lt;/a&gt;, &lt;a href="http://www.easymock.org/"&gt;EasyMock&lt;/a&gt;, &lt;a href="https://github.com/hamcrest"&gt;Hamcrest&lt;/a&gt; or other commonly used Java unit testing frameworks and tools. Instead, the focus of &lt;em&gt;Effective Unit Testing: A Guide for Java Developers&lt;/em&gt; is on more general concepts of &lt;a href="http://docs.pylonsproject.org/en/latest/community/testing.html"&gt;unit testing&lt;/a&gt; in general (and in Java in particular) that might be implemented with any variety of different tools. That being stated, Koskela doesn't ignore these tools completely and does sprinkle JUnit code throughout the book along with code samples based on other unit testing tools such as JMock, Mockito, and Hamcrest.&lt;/p&gt;

&lt;strong&gt;Chapter 1: The Promise of Good Tests&lt;/strong&gt;

&lt;p&gt;In Chapter 1 of &lt;em&gt;Effective Unit Testing&lt;/em&gt;, Koskela mixes brief historical testing anecdotes with basic introductory material and &lt;a href="http://stackoverflow.com/questions/67299/is-unit-testing-worth-the-effort"&gt;often-cited reasons&lt;/a&gt; on why unit tests and automated tests are important (&lt;a href="http://jjinux.blogspot.com/2012/05/unit-tests-dont-find-bugs-death-of-qa.html"&gt;identifying bugs&lt;/a&gt;, &lt;a href="http://blog.stevensanderson.com/2009/08/24/writing-great-unit-tests-best-and-worst-practises/"&gt;improving design&lt;/a&gt;, &lt;a href="http://www.extremeprogramming.org/rules/testfirst.html"&gt;avoiding scope creep&lt;/a&gt;, and &lt;a href="http://cwd.dhemery.com/2005/02/wdywft/"&gt;learning&lt;/a&gt; from the test-writing experience). Koskela talks about why units tests are more effective when used for design in addition to being used for quality assurance.&lt;/p&gt;

&lt;p&gt;The "Factors of Productivity" section of Chapter 1 is useful for understanding certain measures by which one might determine whether unit tests are "effective." These include &lt;a href="http://googletesting.blogspot.com/2007/04/tott-stubs-speed-up-your-unit-tests.html"&gt;execution speed&lt;/a&gt; (performance), &lt;a href="http://java.dzone.com/articles/making-test-driven-development"&gt;readability&lt;/a&gt;, reliability, and trustworthiness. Achieving these characteristics of effective unit tests is the focus of the book. A couple concluding sections of the first chapter focus on using tests for design and employing &lt;a href="http://dannorth.net/introducing-bdd/"&gt;behavior-driven development&lt;/a&gt; (BDD).&lt;/p&gt;

&lt;p&gt;Among other introductory details, he articulates why "&lt;a href="http://www.ericsink.com/articles/Code_Coverage.html"&gt;100% code coverage&lt;/a&gt; isn't the goal." Several well-known testing-related terms ["&lt;a href="http://junit.sourceforge.net/doc/testinfected/testing.htm"&gt;test-infected&lt;/a&gt;", "&lt;a href="http://en.wikipedia.org/wiki/Test-driven_development"&gt;test-driven development&lt;/a&gt;" (TDD), and "&lt;a href="http://en.wikipedia.org/wiki/Accidental_complexity"&gt;accidental complexity&lt;/a&gt;"] are also introduced in this chapter along with references for additional details. In this first chapter, the author also introduces his "The Law of Two Plateaus" to differentiate between using unit tests solely for quality assurance versus using them for design in addition to quality assurance.&lt;/p&gt;

&lt;p&gt;Chapter 1 is mostly introductory and probably doesn't hold a lot of new insights for someone who has worked with Java extensively and/or has written &lt;a href="http://zacgery.blogspot.com/2013/03/unit-testing-good-ideabad-idea.html"&gt;unit tests&lt;/a&gt; extensively. However, it does manage in 12 pages to meet the author's goal for it and the other two chapters (Chapter 2 and Chapter 3) of Part 1 of providing a "shared context" for the remainder of the book.&lt;/p&gt;

&lt;strong&gt;Chapter 2: In Search of Good&lt;/strong&gt;

&lt;p&gt;Chapter 2 delves deeper into the question of "What makes a test 'good'?" Koskela is quick to point out that there is some subjectiveness to this ("some of the quality of test code is in the eye of the beholder" as is &lt;a href="http://marxsoftware.blogspot.com/2009/06/code-beauty-is-in-eye-of-beholder.html"&gt;the case for any code&lt;/a&gt;) and that different contexts can affect whether a particular unit test is good or not.&lt;/p&gt;

&lt;p&gt;Koskela discusses in this chapter how virtues of regular source code are often valued virtues of test code. For example, he discusses that readable test code is maintainable test code and that appropriate structure plays a big role in making tests understandable. Koskela devotes a section of Chapter 2 to a smaller but significant issue I've seen repeatedly in writing and maintaining my own and others' unit tests: unit test methods that advertise testing something they don't really test (perhaps because they are named poorly) can be very costly. I like what Koskela titles that section, "It's not good if it's testing the wrong things." This sounds obvious, but there is deep truth to that simple statement.&lt;/p&gt;

&lt;p&gt;Another section of the second chapter focuses on the principle that, for good tests, "independent tests run easily in solitude." Koskela provides a list of dependencies (such as "randomness" and "persistence") that to him are &lt;a href="http://www.codinghorror.com/blog/2006/05/code-smells.html"&gt;code smells&lt;/a&gt; indicating that something &lt;em&gt;might&lt;/em&gt; be wrong with the unit test code. I like his "litmus test for a project's test infrastructure" to satisfy the following scenario: "Can I check out a fresh copy from version control to a brand new computer I just unboxed, run a single command, lean back, and watch a full suite of automated tests run and pass?" This section does a nice job of covering why it's important that tests are independent and do not rely on being called in a certain order. In addition to pointing out some unit test dependency smells in this section, Kosekla also provides some specific approaches that might be taken to address these.&lt;/p&gt;

&lt;p&gt;One of the sections of the second chapter of &lt;em&gt;Effective Unit Testing&lt;/em&gt; looks at why testing the wrong thing or even testing nothing at all ("happy tests") are problematic. There is coverage of why tests "need to be repeatable" along with references to Java-specific examples of tests that introduce things outside of the testing developer's control into the tests.&lt;/p&gt;

&lt;p&gt;The last section of Chapter 2 (not counting the "Summary") introduces &lt;a href="http://www.martinfowler.com/bliki/TestDouble.html"&gt;test doubles&lt;/a&gt;, the subject of Chapter 3. Koskela defines &lt;a href="http://stackoverflow.com/questions/346372/whats-the-difference-between-faking-mocking-and-stubbing"&gt;test doubles&lt;/a&gt; as "an umbrella term for ... stubs, &lt;a href="http://nirajrules.wordpress.com/2011/08/27/dummy-vs-stub-vs-spy-vs-fake-vs-mock/"&gt;fakes&lt;/a&gt;, or &lt;a href="http://martinfowler.com/articles/mocksArentStubs.html"&gt;mocks&lt;/a&gt;." He adds that "&lt;a href="http://msdn.microsoft.com/en-us/magazine/cc163358.aspx"&gt;test doubles&lt;/a&gt;" are "objects that you substitute for the real implementation for testing purposes." Koskela groups &lt;a href="http://lostechies.com/derekgreer/2011/05/15/effective-tests-test-doubles/"&gt;test doubles&lt;/a&gt; with testing frameworks and build tools as his "top three tools of the trade for software developers writing automated tests."&lt;/p&gt;

&lt;strong&gt;Chapter 3: Test Doubles&lt;/strong&gt;

&lt;p&gt;The third chapter is the concluding chapter and my favorite chapter of Part 1 ("Foundations"). The chapter is devoted to coverage of "test doubles", a &lt;a href="http://xunitpatterns.com/Mocks,%20Fakes,%20Stubs%20and%20Dummies.html"&gt;term and concept&lt;/a&gt; introduced in &lt;a href="http://ca.linkedin.com/in/gerardmeszaros"&gt;Gerard Meszaros&lt;/a&gt;'s &lt;a href="http://xunitpatterns.com/"&gt;xUnit Test Patterns: Refactoring Test Code&lt;/a&gt;. Koskela outlines five reasons developers might use test doubles, including "the most fundamental of the reasons for employing a test double - to isolate the code you want to test from its surroundings." After listing these five reasons for use of test doubles, Koskela describes each of these motivating reasons in greater detail. He then describes each of the &lt;a href="http://www.martinfowler.com/bliki/TestDouble.html"&gt;types of test doubles&lt;/a&gt; and compares their strengths and weaknesses. Koskela's section "Guidelines for Using Test Doubles" introduces his "logic and heuristics" for "picking the [test double] option that results in the most readable test". These include five considerations plus the simplifying rule: "&lt;a href="http://www.mockobjects.com/2007/05/test-smell-too-many-expectations.html"&gt;stub queries; mock actions&lt;/a&gt;" (attributed to &lt;a href="http://en.wikipedia.org/wiki/J._B._Rainsberger"&gt;J.B. Rainsberger&lt;/a&gt;, author of &lt;a href="http://www.manning.com/rainsberger/"&gt;JUnit Recipes&lt;/a&gt;).&lt;/p&gt;

&lt;p&gt;The third chapter of &lt;em&gt;Effective Unit Testing&lt;/em&gt; also touches on organizing unit tests with the &lt;a href="http://www.arrangeactassert.com/why-and-what-is-arrange-act-assert/"&gt;Arrange-Act-Assert&lt;/a&gt; convention and likens this to behavior-driven development's &lt;a href="http://guide.agilealliance.org/guide/gwt.html"&gt;Given-When-Then&lt;/a&gt; vocabulary. This chapter also demonstrates principles of the chapter with brief forays into &lt;a href="http://jmock.org/"&gt;JMock&lt;/a&gt; and Mockito code examples and a reference to &lt;a href="http://www.myagiletutor.com/"&gt;J.B. Rainsberger&lt;/a&gt;'s &lt;a href="http://blog.thecodewhisperer.com/"&gt;blog&lt;/a&gt; post &lt;a href="http://blog.thecodewhisperer.com/2010/10/05/jmock-v-mockito-but-not-to-the-death"&gt;JMock v. Mockito, but Not to the Death&lt;/a&gt;.&lt;/p&gt;

&lt;strong&gt;Chapter 4: Readability&lt;/strong&gt;

&lt;p&gt;The fourth chapter of &lt;a href="http://www.manning.com/koskela2/excerpt_contents.html"&gt;Effective Unit Testing&lt;/a&gt; is the first chapter of Part 2 ("Catalog"). As with all three chapters in Part 2, Chapter 4 looks at "&lt;a href="http://xunitpatterns.com/Test%20Smells.html"&gt;test smells&lt;/a&gt;" that might indicate tests that are less effective than they could be. In this chapter's case, the test smells are those most closely associated with problems related to readability of unit tests.&lt;/p&gt;

&lt;p&gt;Koskela starts Chapter 4 by articulating the difference between reading test code and running test code: "Reading the tests ... should provide the programmer with an understanding of what the code &lt;em&gt;should&lt;/em&gt; do. Running those tests should tell the programmer what the code actually &lt;em&gt;does&lt;/em&gt;."&lt;/p&gt;

&lt;p&gt;The test smells that Koskela associates most closely with the "readability" portion of his Test Smells Catalog are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Primitive Assertions
  &lt;ul&gt;
  &lt;li&gt;Assertion that "uses more primitive elements than the behavior it's checking"&lt;/li&gt;
  &lt;li&gt; Analogous to the &lt;a href="http://curiousjava.blogspot.com/2012/09/primitive-obsession-with-example.html"&gt;primitive obsession&lt;/a&gt; code smell&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Bitwise Assertions
  &lt;ul&gt;
  &lt;li&gt;Special case of Primitive Assertions that uses bitwise operators for "optimized test assertions" at the cost of readability and understandability&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Hyperassertions
  &lt;ul&gt;
  &lt;li&gt;Assertion that that "becomes brittle and hides its intent under its overwhelming breadth and depth"&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Incidental Details
  &lt;ul&gt;
  &lt;li&gt;Incidental details make it difficult to identify the "intent, purpose, and meaning" of a unit test&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Split Personality
  &lt;ul&gt;
  &lt;li&gt;Unit test "embodies multiple tests" rather than obeying unit test mantra "&lt;a href="http://stackoverflow.com/questions/235025/why-should-unit-tests-test-only-one-thing"&gt;A test should only check one thing&lt;/a&gt; and check it well"&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Split Logic
  &lt;ul&gt;
  &lt;li&gt;Test code scattered over multiple files&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Magic Numbers
  &lt;ul&gt;
  &lt;li&gt;Using numeric and String literals rather than using constants and variables with readable names&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Setup Sermon
  &lt;ul&gt;
  &lt;li&gt;Too much code (often refactored from tests suffering incidental details smell) in the setup method
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Overprotective Tests
  &lt;ul&gt;
  &lt;li&gt;Application of unnecessary/redundant guard or test assertions when condition would fail anyway&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In each test smell case, Koskela provides examples of these test smells along with one or more ways (description and code examples) of addressing the smells.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://marxsoftware.blogspot.com/2012/05/junits-built-in-hamcrest-core-matcher.html"&gt;Hamcrest&lt;/a&gt; is introduced in Chapter 4 as a partial solution to addressing test smells. There is also a unit test example that is built for testing &lt;a href="http://jruby.org/"&gt;JRuby&lt;/a&gt; source code.&lt;/p&gt;

&lt;p&gt;In the fourth chapter, Koskela provides some memorable quotes. He articulates an opinion that I've long held regarding unit test code: "When weighing alternatives to expressing intent in test code, you should keep in mind that the nature and purpose of tests puts a higher value on readability and clarity than, say, &lt;a href="http://stackoverflow.com/a/129722"&gt;code duplication&lt;/a&gt; or performance." He also writes, "A test that has never failed is of little value - it's probably not testing anything. On the other end of the spectrum, a test that always fails is a nuisance." Koskela also explains that "&lt;a href="http://lostechies.com/jimmybogard/2008/10/14/acceptable-test-failures/"&gt;A test should have only one reason to fail&lt;/a&gt;" and explains that this is related to the &lt;a href="http://www.oodesign.com/single-responsibility-principle.html"&gt;Single Responsibility Principle&lt;/a&gt;.&lt;/p&gt;

&lt;strong&gt;Chapter 5: Maintainability&lt;/strong&gt;

&lt;p&gt;Chapter 5 continues the coverage of test smells, but moves from the focus of Chapter 4 on "readability" to focus instead of "maintainability." As he did in Chapter 4, Koskela enumerates several test smells most closely associated with test maintainability and uses code examples to demonstrate these smells and how to address these smells.&lt;/p&gt;

&lt;p&gt;Chapter 5 focuses on the following "maintainability" test smells:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Duplication
  &lt;ul&gt;
  &lt;li&gt;Needless repetition that increases places where same change must be made and increases risk of not changing all necessary code&lt;/li&gt;
  &lt;li&gt;Duplication can be structural or semantic or both&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Conditional Logic
  &lt;ul&gt;
  &lt;li&gt;"Conditional execution structures such as &lt;a href="http://docs.oracle.com/javase/tutorial/java/nutsandbolts/if.html"&gt;if&lt;/a&gt;, else, &lt;a href="http://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html"&gt;for&lt;/a&gt;, &lt;a href="http://docs.oracle.com/javase/tutorial/java/nutsandbolts/while.html"&gt;while&lt;/a&gt;, and &lt;a href="http://docs.oracle.com/javase/tutorial/java/nutsandbolts/switch.html"&gt;switch&lt;/a&gt;" reduce the ability to use tests to "understand what the code does and what it should do"&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Flaky Test
  &lt;ul&gt;
  &lt;li&gt;Tests that "fail intermittently," typically due to multithreading or race conditions&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Crippling File Path
  &lt;ul&gt;
  &lt;li&gt;Absolute paths, especially hard-coded absolute paths, prevent unit tests from being run on others' machines&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Persistent Temp Files
  &lt;ul&gt;
  &lt;li&gt;Files that are generated by unit tests may be less temporary than one realizes and interfere with later tests&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.dzone.com/links/r/unit_testing_in_java_a_sleeping_snail.html"&gt;Sleeping Snail&lt;/a&gt;
  &lt;ul&gt;
  &lt;li&gt;Use of &lt;a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Thread.html#sleep(long)"&gt;Thread.sleep(long)&lt;/a&gt; calls in unit test methods&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Pixel Perfection
  &lt;ul&gt;
  &lt;li&gt;Specialized version of Primitive Assertion and Magic Numbers test smells applied to exactly matching graphic representations in unit tests&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Parameterized Mess
  &lt;ul&gt;
  &lt;li&gt;Result of overusing and abusing &lt;a href="http://programmers.stackexchange.com/questions/63016/parameterized-tests-when-and-why-do-you-use-them"&gt;parameterized tests&lt;/a&gt;&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Lack of Cohesion in Methods
  &lt;ul&gt;
  &lt;li&gt;"Test methods in a test class are only interested in some of the fixture's objects"&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As he did for the test smells covered in Chapter 5, Koskela provides code-based examples of each test smell discussed in Chapter 5 along with code-based examples of how to address each of the code smells.&lt;/p&gt;

&lt;strong&gt;Chapter 6: Trustworthiness&lt;/strong&gt;

&lt;p&gt;Chapter 6 finishes off Part 2 and the Catalog of Test Smells. Chapter 6's focus is on test smells closely associated with the degree of reliability and trustworthiness of tests. The test smells covered in this chapter are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Commented-out Tests
  &lt;ul&gt;
  &lt;li&gt;Commenting out tests' implementations so they appear to pass when they really aren't run at all ("poor man's version control")&lt;/li&gt;
  &lt;li&gt;Removing &lt;a href="http://junit.sourceforge.net/javadoc/org/junit/Test.html"&gt;@Test&lt;/a&gt; annotation from JUnit 4-based unit test method has same negative effect&lt;/li&gt;
  &lt;li&gt;Use of &lt;a href="http://java.dzone.com/articles/ignore-unit-tests-immediately"&gt;@Ignore&lt;/a&gt; (JUnit) is similar&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Misleading Comments
  &lt;ul&gt;
  &lt;li&gt;Confuse what the tests are really testing (a famous code smell as well as test smell)&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Never-failing Tests
  &lt;ul&gt;
  &lt;li&gt;"A test that can never fail is probably worse than not having that test ... Tests are supposed to fail when they should."&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Shallow Promises
  &lt;ul&gt;
  &lt;li&gt;A "tests that does much less than what it says it does - or does nothing at all"&lt;/li&gt;
  &lt;li&gt;One type of "shallow promise" test smell (commenting out the body of the test method but not its signature and &lt;code&gt;@Test&lt;/code&gt; annotation) misleads people to think test of something significant passed&lt;/li&gt;
  &lt;li&gt;Lack of assertions in a test method is another specific example of this test smell&lt;/li&gt;
  &lt;li&gt;Method name implying different functionality tested than what is actually tested is third example&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Lowered Expectations
  &lt;ul&gt;
  &lt;li&gt;"Tests that are overly robust - they don't fail when they should," usually because "assertions are too vague"&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Platform Prejudice
  &lt;ul&gt;
  &lt;li&gt;"Failure to treat all platforms equal"&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Conditional Tests
  &lt;ul&gt;
  &lt;li&gt;"... conditional tests in our tests ... [are] bad in general"&lt;/li&gt;
  &lt;li&gt;"All branches in a test method should have a chance to fail"&lt;/li&gt;
  &lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Koskela uses code samples to illustrate the Chapter 6 code smells and what unit tests look like once the test smells are addressed with his recommendations. Chapter 6 wraps up Part 2 on the Catalog of Test Smells.&lt;/p&gt;

&lt;strong&gt;Chapter 7: Testable Design&lt;/strong&gt;

&lt;p&gt;Proponents of Test-Driven Development and even many proponents of any type of unit testing argue that unit testing is as much about design as it is about testing. As mentioned earlier, Koskela wrote about the Law of Two Plateaus in Chapter 1 and explained that significantly more benefit can be obtained from unit tests when they are used for more than quality assurance and are used in the design process. Chapter 7 returns to this idea and focuses on what it means to be a "testable design." Koskela defines testable design as "[making] it easy to instantiate classes, substitute implementations, simulate different scenarios, and invoke particular execution paths from our test code."&lt;/p&gt;

&lt;p&gt;Koskela describes several &lt;a href="http://blog.scottbellware.com/2009/01/good-design-is-easily-learned.html"&gt;design principles&lt;/a&gt; that lead to testable design: &lt;a href="http://en.wikipedia.org/wiki/Modular_programming"&gt;modular design&lt;/a&gt;, &lt;a href="http://butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod"&gt;SOLID&lt;/a&gt; principles [&lt;a href="http://www.objectmentor.com/resources/articles/srp.pdf"&gt;Single Responsibility Principle&lt;/a&gt;, &lt;a href="http://www.objectmentor.com/resources/articles/ocp.pdf"&gt;Open Closed Principle&lt;/a&gt;, &lt;a href="http://www.objectmentor.com/resources/articles/lsp.pdf"&gt;Liskov Substitution Principle&lt;/a&gt;, &lt;a href="http://www.objectmentor.com/resources/articles/isp.pdf"&gt;Interface Segregation Principle&lt;/a&gt;, &lt;a href="http://www.objectmentor.com/resources/articles/dip.pdf"&gt;Dependency Inversion Principle&lt;/a&gt;]. Koskela discusses these principles of object-oriented &lt;a href="http://www.jbrains.ca/permalink/the-four-elements-of-simple-design"&gt;design&lt;/a&gt; and how software that adheres to them is inherently more testable./p&gt;

&lt;p&gt;Koskela articulates an advantage of writing unit tests early that I've definitely observed: "The act of writing tests before the implementation they call for is essentially a way to ensure that you're taking the client's view on the code you're shaping."&lt;/p&gt;

&lt;p&gt;Section 7.2 of &lt;em&gt;Effective Unit Testing&lt;/em&gt; looks at several "testability issues" and then Section 7.3 addresses these testability issues with "guidelines for testable design." It is worth nothing here that Section 7.2 and Section 7.3 (and really the entire book) make the assumption that these Java unit tests are run without use of reflection or bytecode manipulation. Using these tools, such as provided by &lt;a href="https://code.google.com/p/powermock/"&gt;PowerMock&lt;/a&gt;, would be one way to address some of these issues, but do add complexity to the unit tests.&lt;/p&gt;

&lt;p&gt;I expected Section 7.3 to be the most controversial part of the book for me. It's not that I expected the book to be controversial; rather, it is the topic that is controversial. It has always bothered me when I have to change my production code design for no other reason than to accommodate a unit test. In practical terms, I often cave in and do this because the negative effect on my production code design is less significant than the benefit of unit testing, but I still don't have to like doing it.&lt;/p&gt;

&lt;p&gt;In Section 7.3, Koskela describes some of the commonly-held assertions about testable Java code, including avoiding complex &lt;a href="http://lassekoskela.com/thoughts/24/test-everything-but-not-private-methods/"&gt;private methods&lt;/a&gt;, &lt;a href="http://butunclebob.com/ArticleS.MichaelFeathers.ItsTimeToDeprecateFinal"&gt;avoiding final methods&lt;/a&gt;, &lt;a href="http://blog.codecentric.de/en/2011/11/testing-and-mocking-of-static-methods-in-java/"&gt;avoiding static methods&lt;/a&gt;, &lt;a href="http://stackoverflow.com/a/8239763"&gt;avoiding logic in constructors&lt;/a&gt;, &lt;a href="http://stackoverflow.com/questions/8256989/singleton-and-unit-testing"&gt;avoiding the singleton&lt;/a&gt;, &lt;a href="http://simpleprogrammer.com/2010/01/15/inheritance-is-inherently-evil/"&gt;favoring composition over inheritance&lt;/a&gt;, and &lt;a href="http://stackoverflow.com/questions/354441/best-practices-for-wrapping-an-external-library"&gt;wrapping external libraries&lt;/a&gt;. I started reading this section expecting to think, "Yeah, but ...." Instead, I found myself largely agreeing with Koskela's arguments based on my own experience. His pragmatic attitude made his assertions in this section agreeable and realistic. For example, he advises to avoid "complex private methods" rather than simply stating avoid private methods altogether. I've always liked when good design principles are also good for testability and Koskela manages to couch most of these "testable design principles" as such.&lt;/p&gt;


&lt;strong&gt;Chapter 8: Writing Tests in Other JVM Languages&lt;/strong&gt;

&lt;p&gt;I'm a big fan of &lt;a href="http://groovy.codehaus.org/"&gt;Groovy&lt;/a&gt; (127 blog posts to date &lt;a href="http://marxsoftware.blogspot.com/search/label/Groovy"&gt;labeled Groovy&lt;/a&gt;) and am increasingly interested in &lt;a href="http://marxsoftware.blogspot.com/search/label/Scala"&gt;Scala&lt;/a&gt;, so I looked forward to reading Chapter 8 on unit testing with alternative JVM languages. Koskela provides a brief history of languages other than Java on the JVM and covers some benefits common to these alternative languages.&lt;/p&gt;

&lt;p&gt;Although Koskela mentions &lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt;, &lt;a href="http://clojure.org/"&gt;Clojure&lt;/a&gt;, &lt;a href="http://jruby.org/"&gt;JRuby&lt;/a&gt;, &lt;a href="http://www.jython.org/"&gt;Jython&lt;/a&gt; and even non-JVM &lt;a href="http://www.ruby-lang.org/en/"&gt;Ruby&lt;/a&gt; in Chapter 8, the lion's share of the chapter is on testing with Groovy and Groovy-based tools. In particular, the chapter covers using Groovy for testing directly as well as using Groovy-based &lt;a href="http://en.wikipedia.org/wiki/Behavior-driven_development"&gt;BDD&lt;/a&gt; testing frameworks &lt;a href="http://easyb.org/"&gt;easyb&lt;/a&gt; and &lt;a href="https://code.google.com/p/spock/"&gt;Spock Framework&lt;/a&gt;.&lt;/p&gt;


&lt;strong&gt;Chapter 9: Speeding Up Test Execution&lt;/strong&gt;

&lt;p&gt;There are numerous factors that can demotivate Java developers when it comes to unit testing. Perhaps none is more significant than slowly executing tests. If running the tests starts to take too long, the developer might lose interest in running them as often. As they are used (run) less, the developer may start to question the investment of time and energy in writing and maintaining them. Also, as they are run less, it becomes increasingly likely that problems the test would flag will go on longer before being caught.&lt;/p&gt;

&lt;p&gt;Koskela covers ideas for improving unit test execution performance in the ninth and final chapter of &lt;em&gt;Effective Unit Testing&lt;/em&gt;. He begins by looking at why it is important to have fast tests (both builds and test execution) and follows that with looking at strategies to make the builds and execution of tests quicker.&lt;/p&gt;

&lt;p&gt;Chapter 9 includes brief coverage of using &lt;a href="http://ant.apache.org/"&gt;Ant&lt;/a&gt; and &lt;a href="http://maven.apache.org/"&gt;Maven&lt;/a&gt; for building unit tests and how to profile build performance with both of those tools. Until reading this chapter I was not aware of Ant's built-in &lt;a href="http://ant.apache.org/manual/listeners.html#ProfileLogger"&gt;ProfileLogger&lt;/a&gt; (since 1.8) or &lt;a href="http://ant-contrib.sourceforge.net/"&gt;Ant-Contrib&lt;/a&gt;. This chapter also demonstrates how to use &lt;a href="https://github.com/lkoskela"&gt;Koskela&lt;/a&gt;'s &lt;a href="https://github.com/lkoskela/maven-build-utils"&gt;maven-build-utils&lt;/a&gt; extension. Ant's &lt;a href="http://ant.apache.org/manual/Tasks/junitreport.html"&gt;JUnitReport task&lt;/a&gt; and Maven's &lt;a href="http://maven.apache.org/surefire/maven-surefire-plugin/"&gt;maven-surefire-plugin&lt;/a&gt; are also demonstrated in this chapter.&lt;/p&gt;

&lt;p&gt;Besides covering build and execution profiling tools and how to use them to identify the tests that really need to have their performance addressed, Koskela also provides several tactical approaches one can use to improve test execution efficiency. These are solid ideas that I don't consider &lt;a href="http://marxsoftware.blogspot.com/2012/11/when-premature-optimization-isnt.html"&gt;premature optimization&lt;/a&gt; because they are, for the most part, simply good ideas in general that potentially improve performance without sacrificing readability or maintainability of the tests. Another thing I like about these tactical approaches is that many of them have been covered in a slightly different perspective earlier in the book. This ending chapter now brings those previously discussed principles back into the discussion for improving test performance while at the same time addressing test smells.&lt;/p&gt;

&lt;p&gt;All of Koskela's tactical suggestions for better performing unit tests make sense to me, but I particularly liked his coverage on database access in unit tests because I so often see this violated at extreme cost. I like his emphasized statement: "&lt;em&gt;friends don't let friends use a database in their unit tests&lt;/em&gt;." He explains (and I agree) that integration tests are more appropriate for testing of actual database access.&lt;/p&gt;

&lt;p&gt;There is a table in Chapter 9 (Table 9-1) that summarizes approaches one might take to address the two primary external constraints on unit test execution performance (CPU and I/O). Koskela then moves onto detailing how to implement some of these mitigation approaches. Several tools are covered in this chapter including some Linux tools, but two of the most interesting and new to me were Koskela's descriptions of how to use &lt;a href="http://aws.amazon.com/"&gt;Amazon Web Services&lt;/a&gt; and &lt;a href="http://www.gridgain.com/"&gt;GridGain&lt;/a&gt; to improve unit test building performance.&lt;/p&gt;

&lt;strong&gt;Appendices&lt;/strong&gt;

&lt;p&gt;Appendix A is a 7-page "JUnit Primer" that covers basics of JUnit with focus on assertions and use of Hamcrest matchers. Appendix B is a little over 6 pages on "Extending JUnit" with focus on runners and rules.&lt;/p&gt;

&lt;strong&gt;Test Smells&lt;/strong&gt;

&lt;p&gt;For me, the heart of &lt;em&gt;Effective Unit Testing&lt;/em&gt; is Part 2 (plus Chapter 7 and Chapter 9 of Part 3 which I highlight next) that catalogs the test smells. This Part 2 is great at outlining issues I've run into with unit tests that can make unit testing more painful than it needs to be. It is also easy to see that there are trade-offs between the test smells such that the very approach that alleviates one test smell may increase risk of introducing another test smell. One example is the &lt;a href="http://stackoverflow.com/questions/129693/is-duplicated-code-more-tolerable-in-unit-tests"&gt;trade-off between duplication and readability&lt;/a&gt; in unit tests. The author talks about many of these trade-offs and provides rough guidelines of how to decide which way to lean without going too far in either direction. In the case of unit test readability at the cost of some duplication, I like &lt;a href="http://stackoverflow.com/users/21379/stucampbell"&gt;stucampbell&lt;/a&gt;'s &lt;a href="http://stackoverflow.com/a/129768"&gt;take on this&lt;/a&gt;: "I'm more likely to refactor duplicated code for setting up state. But less likely to refactor the part of the test that actually exercises the code."&lt;/p&gt;

&lt;strong&gt;Testable Design and JUnit Performance&lt;/strong&gt;

&lt;p&gt;Like all three chapters in Part 2 on test smells, two of the chapters in Part 3 (Chapter 7 on testable design and Chapter 9 on unit test performance) are also chapters that I plan to re-read in the future. There is a lot packed into these chapters that directly address common unit testing issues as well as sparking ideas about other approaches that could be used to improve unit testing.&lt;/p&gt;

&lt;strong&gt;The Audience&lt;/strong&gt;

&lt;p&gt;As one would expect from a book with the title &lt;em&gt;Effective Unit Testing&lt;/em&gt;, this book does indeed provide guidance on what separates effective unit tests from less effective unit tests. Not only does it cover practices one should use and should avoid, but it introduces terminology and cites well-known resources in the unit testing literature. As such, it is not only an appropriate book for someone with basic familiarity with unit testing who wants to improve their unit tests, but is also highly relevant to those new to unit testing in general and unit testing in Java in particular who want an overview of unit testing in Java. This book doesn't have enough details to be the only source of information for someone new to unit testing in Java, but does give the overall high-level view that can provide context for reading literature more specifically focused on frameworks and other unit testing tools.&lt;/p&gt;

&lt;p&gt;Part 1 will be least interesting to those with significant experience with unit testing, but will be of high value to those who are new to unit testing or non-coding managers and leads who want an overview of why unit testing is important and what kinds of high-level things can make unit tests less effective or more effective. Although Part 1 was the least interesting to me, I still felt it was well-written and met the author's stated goal of providing a common context for the remainder of the book.&lt;/p&gt;

&lt;p&gt;Part 2 and Part 3 are more technically detailed than Part 1. I like the overall descriptions of test smells and approaches to scrub these test smells in Part 2. I also really like the coverage in Part 3 of ideas for improving test build and execution performance and related to how to design code that is more testable.&lt;/p&gt;

&lt;strong&gt;What This Book is Not&lt;/strong&gt;

&lt;p&gt;As I have stated in this post and as the author reminds the reader of &lt;em&gt;Effective Unit Testing&lt;/em&gt;, this book is not the book one should use to learn details of JUnit or other testing framework. There is just enough coverage of these to illustrate more general points, but the focus is on unit testing principles rather than on unit testing implementation libraries and frameworks. Although someone new to unit testing Java applications could find this book useful (particularly Part 1), some knowledge of JUnit would be beneficial (particularly for Part 2 and Part 3).&lt;/p&gt;

&lt;strong&gt;The Book Advantage&lt;/strong&gt;

&lt;p&gt;I have found that different mediums have different advantages when it comes to conveying information and learning. Although many of the principles found in this book are available online in various forms, the strength of the book is the author's organization and articulation of the ideas in a single coherent source. I think the book is well worth its price when I think of the time it would take to collect and organize these ideas from online sources. Furthermore, the author provides examples from his own and friends' experiences to add a "real life" feeling to it all. A well-written book's advantage over blog posts, forum threads, and the like is the ability to cohesively and coherently cover a topic with breadth and depth. This book does just that for the topic of unit testing in Java. To me this book may not offer a lot of new high-level concepts (although it does offer some new to me low-level details), but it articulates well the ideas and practices that seem to be emerging from collective experience writing unit tests for Java-based applications.&lt;/p&gt;

&lt;strong&gt;Breadth of References&lt;/strong&gt;

&lt;p&gt;Another thing I liked about &lt;em&gt;Effective Unit Testing&lt;/em&gt; is the abundance of reference to sources with additional details on the ideas, concepts, tools, and frameworks referenced in the book. Some might argue that a downside of the book is that most of the concepts are not new. I actually argue the opposite: because these are practices for effective unit tests, one would expect them to be based on what more than one person has found to be effective through hard experience. When I am reading a book on "effective" anything, I'm not looking for something that is simply "new" or "different"; I am looking for things I should generally do and generally not do and why. By referencing others' work in unit testing as well as describing his own efforts in this area, Koskela increases the credibility of his book. I also liked the mixing of alternative languages, frameworks, and operating systems in the examples.&lt;/p&gt;

&lt;strong&gt;Breadth of Coverage&lt;/strong&gt;

&lt;p&gt;In 201 pages (not counting appendices, preface, etc.), Koskela articulates and demonstrates what has taken me years of experience to learn from writing and maintaining unit tests and from reading about unit testing. Even though the high-level concepts were not really new to me, I still learned several tactical approaches from this book. Besides learning some new tactics to employ to implement the concepts of unit testing in Java that I thought I already knew, this book has sparked additional ideas for improving my unit tests and has reinvigorated my interest in writing better unit tests.&lt;/p&gt;

&lt;strong&gt;Pragmatic Advice&lt;/strong&gt;

&lt;p&gt;I liked Koskela's pragmatism in this book. Some unit testing enthusiasts (or test-infected Java developers as he calls them in the book) can be overbearing in their enthusiasm and evangelism to the point where it's difficult to believe their claims. Koskela is obviously enthusiastic about unit testing, but seems to keep in mind one important truth: unit tests exist to benefit the quality of the design and code (the production code does not exist to benefit the unit tests). Koskela points out, for example, that there are cases where redundant unit test code might be easier to read and maintain than rigorously implementing &lt;a href="http://devlearnings.wordpress.com/2013/04/07/junit-receipes-common-setup-teardown/"&gt;DRY&lt;/a&gt; principles within test code at any cost.&lt;/p&gt;

&lt;strong&gt;Conclusion&lt;/strong&gt;

&lt;p&gt;I was a little apprehensive when I purchased &lt;em&gt;Effective Unit Testing&lt;/em&gt; as part of Manning's &lt;a href="http://www.manning.com/about/meap.html"&gt;MEAP&lt;/a&gt;, but I am glad that I did. This book delivered what I hoped for and I found Part 2 and Chapter 7 and Chapter 9 of Part 3 to be particularly useful for someone in my situation (relatively experienced Java developer looking for ideas to improve his or her unit testing). Although there wasn't a lot new to me at the highest level, there were a lot of interesting lower-level details that were new to me or were presented from a unique and interesting perspective. I also liked having these ideas I had from my own experiences laid out and articulated for me in printed form and I liked having these concepts being developed by the Java unit testing community all codified in a single book. The book packs a lot into 201 pages of regular text and the writing style is easy to read and understand. It is easy for me to recommend this book to Java developers who feel they have room to improve in writing of unit tests of Java applications. I also know many Java developers (including myself) who could benefit from reading this book.&lt;/p&gt;
&lt;div class="blogger-post-footer"&gt;&lt;p&gt;Original posting available at &lt;a href="http://marxsoftware.blogspot.com/"&gt;http://marxsoftware.blogspot.com/&lt;/a&gt; (Inspired by Actual Events)&lt;/p&gt;&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/InspiredByActualEvents/~4/z5t3s-1oU5g" height="1" width="1"/&gt;</content><link rel="replies" type="text/html" href="http://www.blogger.com/comment.g?blogID=6517450204508339514&amp;postID=2527481055696783339" title="0 Comments" /><link rel="edit" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/2527481055696783339?v=2" /><link rel="self" type="application/atom+xml" href="http://www.blogger.com/feeds/6517450204508339514/posts/default/2527481055696783339?v=2" /><link rel="alternate" type="text/html" href="http://feedproxy.google.com/~r/InspiredByActualEvents/~3/z5t3s-1oU5g/book-review-effective-unit-testing.html" title="Book Review: Effective Unit Testing: A Guide for Java Developers" /><author><name>@DustinMarx</name><uri>http://www.blogger.com/profile/10790950138196529391</uri><email>noreply@blogger.com</email><gd:image rel="http://schemas.google.com/g/2005#thumbnail" width="26" height="32" src="http://4.bp.blogspot.com/_sDOe5HxTdMk/SJvYLEdKt8I/AAAAAAAAAgI/0jC2EBEtpv8/s1600-R/Marx6035.jpg" /></author><thr:total>0</thr:total><feedburner:origLink>http://marxsoftware.blogspot.com/2013/04/book-review-effective-unit-testing.html</feedburner:origLink></entry></feed>
