JavaOne: Eugene Kuleshov, Misko Hevery on practical byte code

3

This BOF was “Practical applications of static bytecode based analysis”. Eugene did the first half of the presentation and went over the basic capabilities of ASM. ASM is a great library for doing bytecode generation, transformation, and analysis. We use ASM a lot at Terracotta so this was mostly review for me but it did fill in a couple questions for me.

Eugene also covered Cobertura, which is a code coverage tool that uses ASM to instrument counters around every method, branch, etc. He showed a nice example of how this can do code coverage for other languages like Groovy as well, including detecting coverage problems that exist only in bytecode and aren’t visible in the source.

After that, Misko Hevery from Google took over and showed some ways they are using ASM to build testing and quality tools at Google. He talked about two tools – the Google Singleton Detector and the Testability Explorer. The Google Singleton Detector has been around for a while and can be used on your code base to detect things matching a classic singleton pattern and also some more subtle singleton variants which they call hingeltons, fingletons, and mingletons”.

They showed some examples of running this on different open source code bases and that led into a discussion of how some singletons are not necessarily a problem as it’s really an issue with mutable global state, so singleton constants aren’t not really an issue.

So, they also developed a tool call Testability Explorer that can examine the bytecode of a project and assign a testability index to each class and display the results. The testability explorer examines a bunch of different stuff related to dependencies and mutable state. You can see the results from many popular open source projects at http://testabilityexplorer.org. Check it out on your own project!

Comments

3 Responses to “JavaOne: Eugene Kuleshov, Misko Hevery on practical byte code”
  1. prashant says:

    Alex,

    Cool links.Thanks for providing these links.I am right now downloading testability explorer and singleton detector.

    Thanks
    Prashant

  2. Misko Hevery says:

    Hi Alex,

    Glad to hear that you enjoyed our presentation and that you wrote it up on your blog. You know one idea which I am toying with is that it would be great to take an open source project and to work with them on improving their testability score. And then correlated their professional opinion of code quality and coding enjoyment with of the developers with progress on the testability explorer. Do you know of any project / anyone who would fit the bill?

    Many Thanks,
    – Misko

Trackbacks

Check out what others are saying about this post...
  1. [...] (via Pure Danger Tech) [...]



Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!