IBM's developerWorks has published my latest article, Easier Testing with EasyMock. Is EasyMock worth it? It does nothing that couldn't be done by manually writing mock classes, and in the case of manually written classes your project would be a dependency or two leaner. However, when mocking larger interfaces such as org.w3c.dom.Node (25 methods) or java.sql.ResultSet (139 methods and growing), EasyMock is a huge time saver that produces much shorter and more legible code at a minimal cost.
Now a word of caution: mock objects can be taken too far. It is possible to mock out so much that a test always passes even when the code is seriously broken. The more you mock, the less you're testing. Many bugs exist in dependent libraries and in the interactions between one method and the methods it calls. Mocking out dependencies can hide a lot of bugs you'd really rather find. Mocks should not be your first choice in any situation. If you can use the real dependency, do so. A mock is an inferior replacement for the real class. However, if you can't reliably and automatically test with the real class for any reason, then testing with a mock is infinitely superior to not testing at all.
Did Oracle buy a money sink? Sun has announced its results for the third quarter of its fiscal year (ended in March) and they're dismal again. They lost $201 million or $0.27 per share. Revenues was $2.6 billion, a 20 percent drop from the third quarter of fiscal 2008 and a big drop from the previous quarter.
JetBrains has released TeamCity 4.5, a $1999 payware continuous integration server. TeamCity manages builds and can be configured not to check in code unless tests pass. (This is actually a quite bad idea, for reasons I've outlined elsewhere. I've also recently noticed that like a doctor breaking a bone to reset it, sometimes you need to break a build to improve it, especially when refactoring large and complex projects spread out over multiple source trees. Of course, when you're done with that the build should be fixed and all tests should pass, but the intermediate broken state is still a convenient step along the way.) New features in 4.5 include:
Google has released the Android 1.5, Cupcake, Software Development Kit. For the moment only dev phones can actually be upgraded to this release. The upgrade should be automatically pushed to regular phones within a month or two. The feature I'm most looking forward to is soft keyboards. Hopefully this means, I no longer have to pull out and fiddle with the keyboard to "Enter your four digit personal identification number and press pound." Without an onscreen keyboard, accessing the voice mail on this thing is a real pain. You'd think T-Mobile or Google or somebody would have noticed that.
The Gnu Project has released version 4.4 of GCC, the GNU Compiler Collection. GCC contains frontends for C, C++, Objective C, Fortran, Ada, and Java as well as libraries for these languages. GCC's Java is a clean room implementation that doesn't use any Sun code, so it doesn't always exactly match Sun release versions, but this is roughly at the Java 1.5 level with some omissions. There don't seemn to be any Java-specific changes in this release.
JFree.org has released JFreeChart 1.0.13. According to David Gilbert, This release "contains major enhancements including mouse wheel zooming, panning, clipboard support, improved renderer support for series visibility flags, better performance for rendering of large time series datasets, improved mouse click support, additional support for heat map generation, various minor feature updates, and a good number of bug fixes". JFreeChart is free software under the terms of the GNU Lesser General Public Licence (LGPL), and requires Java 1.3.1 or later.
Oracle--not IBM--is buying Sun for $9.50 a share. On the up side, this means we'll continue to have two strong Java vendors in the market (Oracle and IBM) instead of just IBM. On the down side--well, let's just say I'm really glad MySQL is open source.
The Legion of the Bouncy Castle has released version 1.43
of the Bouncy Castle Java Cryptography API, an open source,
clean-room implementation of the Java Cryptography Extension (JCE).
It supports X.509 certificates, PKCS12, S/MIME, CMS, PKCS7, TEA, XTEA, SHA224, and lots of other juicy acronyms. It also includes its own light-weight crypto API that works in Java 1.0 and later, and does not depend on the JCE. This is a bug fix release.
Google has posted an early access release of Android 1.5, Cupcake. According to Xavier Ducrohet, "This new version (which will be 1.5) is based on the cupcake branch from the Android Open Source Project. Version 1.5 introduces APIs for features such as soft keyboards, home screen widgets, live folders, and speech recognition."
I think it's time to get serious about Android development. This week is pretty full; but next week it may be time to knuckle down and start writing the mobile app I've been contemplating for the last few years.
Versions 1.5.8 and 1.6.1 of Groovy have been released.
Groovy is
a JVM hosted scripting language that combines the blazing speed of GW-Basic with the sparkling
clarity of Perl. "Groovy 1.5.8 contains a ton of bug fixes and will be the last version of the old Groovy 1.5.x branch.
So make sure you eventually transition your project to Groovy 1.6.1, if you've not done so already.
Please report any problem you may encounter throughout the transition to ensure they are addressed rapidly.
Groovy 1.6.1 is the latest stable version of Groovy.
It also contains several bug fixes or minor enhancements."
Google has released a beta of AppEngine for Java. "With App Engine, you can build web applications using standard Java technologies and run them on Google's scalable infrastructure. The Java environment provides a Java 6 JVM, a Java Servlets interface, and support for standard interfaces to the App Engine scalable datastore and services, such as JDO, JPA, JavaMail, and JCache.":
App Engine uses the Java Servlet standard for web applications. You provide your app's servlet classes, JavaServer Pages (JSPs), static files and data files, along with the deployment descriptor (the web.xml file) and other configuration files, in a standard WAR directory structure. App Engine serves requests by invoking servlets according to the deployment descriptor.
The JVM runs in a secured "sandbox" environment to isolate your application for service and security. The sandbox ensures that apps can only perform actions that do not interfere with the performance and scalability of other apps. For instance, an app cannot spawn threads, write data to the local file system or make arbitrary network connections. An app also cannot use JNI or other native code. The JVM can execute any Java bytecode that operates within the sandbox restrictions.
I also just noticed that Google turned on billing while I wasn't looking, so it's now possible to pay for additional quota (CPU, bandwidth in/out, storage, and e-mail) if the initial free allotment doesn't suffice.
David Peterson has released
Concordion 1.3.1, an open source acceptance testing framework based on JUnit and XHTML. If I'm reading this right, tests are written in XHTML, but fixtures are written in a JUnit test case. The XHTML becomes a runnable specification.
The piece that itches me a little is the fixture is
written in Java os that the test specification is really split over two files, one in Java and one in XHTML.
I'd prefer to hyave a test case completely contained in one file, be it Java or XHTML, even if this involves embedding Java in XHTML or vice versa.
The Eclipse Project has released the Eclipse 3.4.2, their open integrated development environment for Java. This is a bug fix release.
I suspect the failure of the IBM-Sun merger is a good thing. More competition in the marketplace is usually a good thing. I understand that the acquiring company is often looking for an exit strategy, but I've never quite understood what most acquirers think they're getting. Was there really anything Sun had that IBM couldn't build itself? What exactly did Sun bring to the table?
Especially in large mergers, only rarely does the acquired company become worth what was invested in it. In the worst case scenario, it ends up killing the company that acquired it. Sun's been poisoned by too many acquisitions over the years from Cobalt to MySQL. Only a few would I call successes--StarOffice and NetBeans--and then only by product standards. None of them seem to have generated any real revenue for Sun.
Imagine, for example, what would happen if the Apple-Sun deal had gone through in the late 90s. Both companies would be dead now. Sun could never have pulled off what Apple did on its own. We can hope this is Sun's reverse-Apple moment, and that they too will climb out of the depths of despair to a market leading position over the next ten years. Rumors are that McNealy scuttled this deal, and may now take control of Sun. Can McNealy do for Sun what Jobs did for Apple? I doubt it, but I doubted Jobs too. Maybe I'm wrong again. I hope so, but I'm still not buying any JAVA stock.
Subversion 1.6.0, an open source version control system designed to replace CVS, has been released.
1.6 improves filesystem storage mechanisms and authentication data handling and adds support for tree conflict detection.