Saturday 1 September 2012

Speeding Up Java Unit Testing

The Java Tutorials and Videos web site has published an interesting article titled "Speeding Up Java Test Code". This article explains that there are two distinct areas where we can work to improve the speed of our feedback cycle: code and build. The author shows you how to speed up your Java test code.One of the advice is that you don’t want your test to set up things you’ll never use. Another recommendation is that you should avoid making network calls in your unit tests. More specifically, we should see that the code we’re testing doesn’t access the network because calling the neighbors is a seriously slow conversation. We also want to minimize access to the file system in order to keep our tests fast. Keeping these in mind is a good idea if your feedback loop starts growing too long.