Tuesday, July 14, 2009

3 Code Review Items

It is true, things do come in threes. Yesterday I had three code review related experiences.

1 - What was I thinking

I created a code review in Crucible to share with my team. when it came time to do the code review, Crucible hung. Strange. It has always been a good product, why should it have problems now? Answer: 768 files is probably not a reasonable code review. At just 10 minutes per file that would be 128 hours for the entire review. Lesson learned: Keep the code review to a reasonable size both for the software and the people.

2 - Free book in the mail

I got a free book on code reviews in the mail. Best Kept Secrets of Peer Code Review is a compilation of 10 practical essays from industry experts giving specific techniques for effective peer code review. It is short but looks like a good read.

3 - 5.0 for 5 users for $5 for 5 days deal

While I am a big fan of Crucible, it is not free software, unless you work for a non-profit, like I do. It which case you can use it for free. A competitor of Crucible, CodeReviewer by Smart Bear Software is running a deal where you can get a 5 user license for $5.00. It has some interesting features. This comes from a conversation with a person at Smart Bear:
From a big-picture perspective, the two tools are similar: they automate the peer code review process. The biggest difference is the level of support for what we refer to here at Smart Bear as "pre-commit review." Both tools have good support for doing "post-commit" code review; in other words, creating a code review based on file revisions that have already been checked in to version control. From what we've seen in our customer base (over 20,000 licensed seats across Code Collaborator and Code Reviewer combined), about half of developers prefer to do pre-commit review and the other half do post-commit review. Crucible supports pre-commit review, but not nearly as thoroughly as Code Reviewer. A key reason for that is that Crucible does *not* include a client-side application, with the exception of plugins that they do provide for the Eclipse and IntelliJ IDEA integrated development environments. Please note, however, that the current version of their Eclipse plugin does not provide any support for creating pre-commit reviews (and further, it only supports Subversion). In contrast, Code Reviewer's client side tools consist of: a cross-platform GUI, a cross-platform command-line utility, an Eclipse plugin, and a p4v plugin (for Perforce users). These tools automate the creation of pre-commit reviews by using the developer's version control tools to figure out what files have changed in the developer's local working copy and then Code Reviewer packages up the necessary local changes and creates the review accordingly. For a pre-commit review, Crucible makes you do all of that manually (with the exception of when you are using their IntelliJ IDEA plugin): you have to create your own diffs, etc. So that's the biggest single difference between the two tools. Some additional points to note: 1. The list of supported version control systems is similar, but not identical. Both tools can, in theory, work with *any* version control system that can produce diffs. Crucible provides specific support for post-commit review creation with CVS, Perforce, Subversion, Git, and ClearCase. Code Reviewer provides specific support for pre-commit and post-commit review creation with CVS, Perforce, Subversion, Git, Vault, and Mercurial (as a side note, Code Collaborator provides specific support for 14 different version control systems). 2. Support for iterative review. Code Reviewer has always supported iterative review: the ability to upload multiple revisions of a file(s) and make it easy for users to see the most recent changes only (or all changes) and to keep it straight which comments/defects were entered on which lines of code, even as those lines of code move around because of insertions/deletions across the different revisions. Historically, this is not something that Crucible supported, but they are claiming support for this in their just released v2.0. Note, however, that it appears to only work with post-commit reviews, unlike in Code Reviewer where it works with both pre-commit and post-commit reviews. I haven't tested it enough to figure out if their 2.0 release can accurately move comments/defects with lines of code through multiple revisions of a file. 3. Real time chat. The Crucible user interface for entering comments/defects works well, but it is not real-time. If someone else enters a comment/defect in the same file that you are working in, you won't see that comment/defect until you refresh your browser page. In Code Reviewer, this works automatically. I realize this might not be useful in a "code buddy" environment, but we do have many customers who use this facility as essentially an IM-client in order to chat about the code in real time.
Can't hardly go wrong for 5 bucks.

>Summary

1 comment:

easy-list said...

nice share,,,
promise me to read and study it