Thursday, April 25, 2013

A quick guide to code review

In my opinion, it's good practice to have a strong culture of peer review - it ensures your team knows what is going on, catches simple issues, and makes you a better group of developers.

Bitbucket and Github both provide a quite intuitive interface for reviewing code. You can simply look at a list of recent commits, and find a particular line to add a comment.

If you are new to git, I'd recommend you find an existing project and try this out.
  1. Find the commits tab - https://github.com/jaz303/tipsy/commits/master for example
  2. You can see a number of commits, with references like 3545aa6ae2 - these are hashes that uniquely identify the change.
    It shows the commit message, author, as well as date/time.
  3. Viewing one brings up the review user interface.

Code review is a fairly simple process. Different teams do different things, but I generally do:
  • Does the code change meet the description?
  • Is the code self describing / self explanatory?
  • Are there tests?
If you have questions, or don't understand something - ask. It may not be that you don't understand, it may be an oversight by the original developer.

Give it a go on an open source project today!

No comments: