Contents:
About JCR
JCR (or jcodereview as it's known on Sourceforge) is a web application for performing and managing formal code reviews. It can be used for reviews of any type of source code, although it has some special smarts for reviewing Java projects. It has special features to make large-scale reviews not only practical but easy and fast. JCR is intended to assist:- Reviewers. All changes to code are highlighted, and syntax highlighting works for most languages. Code extracts are shown for context when adding comments. If reviewing Java code, references to other classes within the file are clickable, so that you can drill into the detail if required. After review comments have been made, those comments can themselves be reviewed, and the required actions decided on and tracked
- Project owners. Review projects are easy to create and configure, and support (but don't require) integration with your source code management (SCM) system
- Process bigots. Details of all comments are held in the database, along with any actions required, and whether they've been completed. Status reports can be viewed at any time, and also show how much review activity took place on each file (to make sure they were all reviewed)
- Architects and developers. As well as viewing the comments made for a project, it's possible to see details of all review projects and comments for a specified file - good for finding code that would benefit from refactoring.
JCR is generally targeted at larger-scale and more formal code reviews than other review tools (such as Crucible, Review Board, Rietveld and Codestriker. At work (TNS Payments), we use JCR to review more than half of the code we write. It's made a huge difference to our review process - code reviews now take less time, and the code gets reviewed much more thoroughly than it did in the past.
Why bother with formal code reviews?
There are all sorts of benefits from code reviews, and they're not always the ones you'd think. For my money, they include:- Education
Code reviews are a great way of pointing out good or bad techniques to other developers (particularly less-experienced ones) and making developers aware of internal or external libraries etc. that can be used instead of resorting to wheel-reinvention. Additionally, they give you an opportunity to discuss some of the issues, to make sure everyone's on the same page.
Oh, and you'll probably learn quite a bit yourself... In particular, you get a guided tour of parts of the codebase you may not know, from someone who's just been there. - Finding bugs
Yes, but not necessarily as important as you might think. If you've got good unit, integration and system test coverage (and if you haven't, what are you waiting for?), the main issues you might spot in a code review will be for non-functional aspects like concurrency issues, memory leaks etc. - Code and design quality
Very important. Reviews give you a chance to suggest better ways of doing it, whatever it is, and to discuss potential issues with the way the code has been written - Code standardisation
One of the tenets of agile methods is that all code should look the same - it shouldn't be possible to tell from the code who wrote it. That way you can concentrate on understanding the code, rather than grappling with trying to parse the code. While you can (and should) use static checkers like Checkstyle to ensure that your basic coding standards have been met, reviews will catch the issues that need human eyes to find. - Regulatory issues
At TNS Payments we operate under pretty tight security requirements, and we have to provide proof of appropriate peer code review to 2 separate external auditors. JCR provides everything we need for this.
Requirements for JCR
Server Requirements
JCR is easy to install (as of version 0.6, it uses easy_install), and most of the application dependencies will be installed automatically. However, there are some underlying requirements you'll have to provide yourself.- Linux (also UNIX and Cygwin, but not tested as much). As of 0.7.2 Windows appears to work, but has testing has been limited
- Python 2.4 or later (2.5+ recommended)
- Subversion and the Pysvn driver (if you plan to integrate with Subversion repositories)
- For production use, either Postgres 8.x or Mysql 5.x (also works with Sqlite, but this may not be suitable for heavy use)
- An SMTP server (if you want JCR to send notification emails)
Client Requirements
Mozilla/Firefox, Internet Explorer 6+, Google Chrome, Safari. Others should probably work, but not are tested.Licence
JCR is released under the GNU Public Licence.Contact Me
My name's John Dickson, and you can reach me at captsens at gmail dot com. I'd love to hear you get on with JCR. Unless you find it really bad, in which case I'm happy to cherish my ignorance, but thanks for coming anyway ;}And remember, if you're wedded to Java, Python makes a very appealing mistress...