We take testing very seriously at Google. You may have seen our testing blog and how we even test on the toilet.

We also like to create automated tools to make our lives easier and in the testing world this can mean having code to watch your back.

We have released a new tool that we have been playing with, the Google Singleton Detector, as open source. Its job is to find singletons and global state in the Java code that we produce. But wait, why would I care to find out where singletons may be in my code? In some cases they can make testing difficult and hide problems with your design. There's a bit more to it than that, so check out the FAQ for more info.

Do you maintain Java code and need to keep it nice and clean? Give the singleton detector a try!

Many thanks to David Rubel and the team for creating this, and working to get it out into the open source world.