20040816

How to set a world record for code reviews using Eclipse plugins.

Code reviews are boring, but necessary. What gets really boring is reviewing unit tests for correctness too. Code reviews can also get personal and hit team morale as a result. What you need are the tools to take all the nasty note taking, bug explanation, and other tedious parts away and concentrate on the 'does it do what is says on the tin' checks.

The eclipse plugins are:

  • Jupiter, which organises all the reporting and tracking of defects. It incorporates a good review process.

  • FindBugs, which uses byte code analysis to notice strange things about the code - and could quite possibly be sufficient for reviewing unit test classes on its own. See this paper for more information.

  • JDocs, to help you look up the API information you need.

  • CheckStyle, with all the class design and metrics analysis extras turned on. Use the metrics to target your second glances.

  • and Dupman will analyse for duplicates, if you are brave enough to tackle the German documentation.



There are a number of other tools that can help, but these cover the same areas as CheckStyle and Dupman do together, so rather than put in a large number of specialised tools you can get away with using the extras of the latest version of checkstyle and a good (free) duplication spotter.

FindBugs is a fantastic concept, it is really a time saver in this case. It finds "problem areas" more than anything else and so does require someone afterwards to look at the code and say something like "hmmm... that could have been embarassing" or "its not actually wrong, but it needs refactoring anyway".

5 comments:

Anonymous said...

Thanks for the list of plug-ins - especially the link to Jupiter.

Anonymous said...

See also this blog entry

reeses said...

Simian is a commercial app that does some sort of code similarity analysis.

I ran it once last night on some client code and saw what I more or less expected to see from a "copy and paste" perspective. However, I didn't see a lot of "copy this block, change the variable names to fit, and maybe mess with the formatting, too," so it seems a pretty naive implementation. I didn't see enough there to justify paying for a non-demo license.

I've been thinking that since IDEA compiles a lot of the workspace to do its own semantic analysis, this is a natural place to do more interesting duplicate detection.

Anonymous said...

Together for Eclipse has had this kind of stuff in its Audits and Metrics since it was released.

Jonathan said...

PMD's got a great duplicate finder. And no German!