Java 8 was released on March 18th. At the time of this blog, that is only about a week ago. The question on everyone’s mind is, "when can we begin moving applications over to Java 8?" The glib responses I most often hear is that we will wait for the first patch, wait 6 months, or wait until major bugs are found. I would argue that the question of when to move to Java 8 is really the question of when to adopt any package of software.
As developers, we are often faced with adding libraries we have not previously used and upgrading to new major versions of existing libraries. The first issue with any new library or major upgrade is that we don't have enough experience with the software to have an informed opinion of the risk it poses to the quality of our software.
When we are evaluating the risk of adding software to our application, there are several dimensions that developers tend to watch that provide a feeling of safety:
- How long has the package been in use? Newer packages are often less stable.
- How many bugs have been filed and fixed? More bugs fixed indicate that the software has stabilized and most dangers are removed.
- What is the size of the community? A large community of developers using a piece of software means more people to test the software in a wide variety of situations.
Unfortunately, most of these methods for evaluating risk fail on major version changes and new libraries. So then, how do we verify that the software is safe for our application? The answer is our application's automated testing. The purpose of automated testing is to validate that the software we produce behaves as we expect it to behave. When a library is introduced, it should not affect the existing tests. They must still pass.
So, when can we move to Java 8? The answer depends on how much you trust your automated tests. If your project is regularly delivering content with high quality through a standard test harness, Java 8 is not a leap of faith. As you move down the ladder of quality confidence, you should wait longer for bugs to flesh themselves out. Finally, new projects can be started with Java 8 as long as they are started with solid test automation.