More effective code reviews with Review Board 0
Recently I have been ironing out our in house development process, making sure we are using the best tech possible to get the job done to a higher standard and more quickly. One of the most interest things that I have come across is that code reviews spot on average around 60% of issues in code (that’s more than unit testing, acceptance testing, basically its more than anything else!) so top of my list was getting a code review process in place!
One of the most difficult things I have found is getting an effective code review process in place. In my previous company this was done as a combination of emails, excel spreadsheets and code checkouts - not exactly a process that is 100% reliable. The other negative about a process such as this is its very hidden, if one of my team was reviewing another persons code I would never see the review process happening (unless I was CC’d in on every email!). So I went looking for a better solution…
After a lot of searching and testing I found Review Board, an open source project that is developed to take a lot (not all) of the pain out of the code review process.
Review Board can be set up in a number of ways (something that i’d like to cover in the future) and to be honest, its a real pain to get it set up and working, something which the review board team are working on. Once you have it set up its great, inside it you can view diff’s of code, add comments to lines, mark entire parts of code as ready to ship and best of all its out in the open and public so the whole team can learn.
I’m pretty sure that if I just installed a tool and that was it then the process wouldn’t work so I came up with 5 golden rules of code reviewing for everyone to follow to ensure we get the best out of our great new system:
- Its a code review, not a code flaming - all reviews should give praise as well as pointing out potential issues.
- It’s just code - Reviewers are reviewing the code only, if you don’t like the person, the coding standards or even the project it doesn’t matter you are only there to review the code.
- Standards are all important - Leading on from 2, if you don’t have a set of standards you cant expect reviews to be fair. So get a set of standards and everyone reviews against them (even if they don’t like them)
- There are always options - no-one is right all the time, for any problem there will be at least 3 or more ways to solve it. So use the code review as a discussion of why they used method A over method B. It may not be the approach you would have taken but that’s part of being in a team.
- Set your own standards high and live by them - Can you imagine someone that reviews every-one’s code saying its awful, it doesn’t work, etc, etc and then checks in code just as bad? Remember to be a part of the team, check in code that you would like to see checked in and then have an open discussion about it to make sure its as good as it can be.
Ok one bonus rule:
- Coding is a team sport - Remember that to create a great piece of software takes a great team, not just one great programmer. Code reviews are a process where you can make sure the code that is being shipped is of suitable quality as a team, and you can ensure that every time you perform a code review the whole team is improving the standards of what they produce by learning.
The more and more I use review board, the better the code is getting and the better the team is getting so i’ve got to say a big thanks to the team at review board for creating such an awesome piece of software!