[SVN] Simple way to do code review
Simple way to do code review
Table of Contents
A code review (also known as code inspection or walkthrough)
is often considered to be a complex, time consuming and highly
regulated process. In reality it’s just another form of communication
between team members and a great way to ensure code quality and stay up
to date with changes. In this guide we will show a simple and effortless
way to do it on a daily basis.
In Beanstalk we provide two types of email notifications – commit notifications and daily activity digests. Commit notifications deliver changesets right into your inbox moments after every commit is made (or pushed) so you can review code immediately.
Daily digests are a bit more comprehensive – every morning we will send you a simple summary of every commit, merge, push, branch removal or manual deployment in repository. (This means there is no excuse to say
On the changeset page you can comment on the entire revision, or reference a specific line of code to make it obvious what you are talking about by simply clicking on the line number. Rich text formatting can be used with Textile syntax.
Use version control
We hope you are already doing this! Version control systems make any work inside your team much easier, and this includes code reviews. Check out our guide “Introduction to version control” if you are still managing code the old-fashion way, or are interested in learning some best practices.Stay up to date
Email and RSS are common ways to be notified about new things and code changes are not exceptions. Depending on the project scope and team size you can choose between checking every commit or just doing review of all updates once per day or a few times per week.In Beanstalk we provide two types of email notifications – commit notifications and daily activity digests. Commit notifications deliver changesets right into your inbox moments after every commit is made (or pushed) so you can review code immediately.
Daily digests are a bit more comprehensive – every morning we will send you a simple summary of every commit, merge, push, branch removal or manual deployment in repository. (This means there is no excuse to say
“I didn’t know”anymore.)
Review code
There are a few reasons to do code reviews:- An extra set of eyes: catch bugs, mistakes or typos early while they are the cheapest to fix.
- Keep on task: Know your code and prevent duplication by learning what others are working on.
- Keep things consistent: Make sure that code follows team guidelines.
- Improve your skills and knowledge: Learn from your team and grow as a developer.
Tools
Version control systems provide useful tools for reviewing and understand changes.Diff
The Diff tool lets you compare any two revisions of the same file (changesets you use to review commits are just diffs between specific revision and the one before it). Diffs can even be saved as files and opened in your code editor of choice with appropriate syntax highlighting.Preview
Think of Beanstalk’s Preview as a visual diff tool for HTML mockups – you can compare several HTML pages or images as fullscreen previews, side by side or in overlay mode. This tool is incredibly helpful if you need to review visual changes or compare revisions of image. You can even share multiple visual revisions from a single link.Blame
The Blame tool shows author and revision information for every line of your files. Not sure when or why something was changed? Blame provides context for everything and makes it easier to understand reasons of every change or addition.Comments
After getting notified about a new revision and scrolling through the changeset you may have some questions or concerns, so it’s a perfect time to start a discussion. You can do this personally, in IM or in good old email, but there is a way to tie the discussion together with code by using Beanstalk comments. The easiest and fastest way to post a comment is to reply to a commit notification email, so you don’t even need to leave your email client and visit the changeset.On the changeset page you can comment on the entire revision, or reference a specific line of code to make it obvious what you are talking about by simply clicking on the line number. Rich text formatting can be used with Textile syntax.
Conclusion
Hopefully we have convinced you that code reviews don’t take much time, can be easy to fit into any development process, and are totally worth the effort. If you’re interested in more information that’s inspired us, here are some recommendations for further reading:- Code Reviews: Just Do It by Jeff Atwood
- You Should be Doing Formal Code Review by Jesse Storimer
- Effective Code Reviews Without the Pain by Robert Bogue
- Things Everyone Should Do: Code Review by Mark Chu-Carroll
Comments
Post a Comment