Proven practices for more effective, efficient peer code review
ibm.com
ibm.com
Any tips on fostering this sort of culture? I personally am vary grateful when others point out defects in my code, as I view it as an opportunity to learn and grow as a developer. I try to encourage other developers on my team to have this attitude as well, and most do. However, I've worked with developers in the past who view anything pointed out in code review as personal attacks rather than a chance to learn. What can I do to help avoid this?
In all cases, there has been a lot of initial scepticism and worries.
Some things that I feel have contributed to people accepting code review, are: 1) Gerrit enforces code review, you have to get it done somehow, in order to get your changes in. It's integrated in the workflow. 2) You choose your own reviewers. 3) We have had a clear message, that code review is about communication, knowledge sharing and bug hunting is just an added bonus. And communication is always our biggest problem in big projects. Just by letting someone do code review of your changes, the knowledge inside the organization about the change has almost doubled. 4) We ask people to treat code review request as number one priority, as the changes can not get in before it.
Before Gerrit we tried to encourage the culture by using Reviewboard [2], but in our case it just wasn't used that much. People did not treat review request as a high priority. Maybe because it was not enforced and sometimes you'd do a review for a change that the developer already merged in.
It's interesting to see how small tricks can change peoples behaviour...
[1] http://code.google.com/p/gerrit/ [2] http://www.reviewboard.org/
It is an optionally requested meeting at the beginning of the review process. In this meeting, the goal, the general structure of the software and the general structure of the changes are discussed on a high level for about 10 minutes. Afterwards, we decide which classes are focus in the review, which classes are kinda part of the review but boring. Sometimes the review is even removed because the changes are too small.
Overall, it's a very helpful meeting, especially for people new on a project. Confusion changes into understanding and focus with just a few words and a simple informal diagram and from there, very precise and productive code reviews follow.
* minor correction to my original post - "they" refers to the code changes
IBM stuff, however... well, I've mentioned my feelings on their software on HN before. They're still selling Lotus Notes and Clearcase - I'd be very careful before taking anything they've built/bought.
At Mozilla, we use GitHub (for project hosted on github, such as Gaia), and splinter [1], that integrates with bugzilla. I know there is an ongoing effort to switch to reviewboard [2] at the moment, as we feel our review tool should do more that what splinter is capable of doing.
[1]: http://blog.fishsoup.net/2009/09/23/splinter-patch-review/ [2]: www.reviewboard.org
That's why I feel that their first rule of their study is based on the shortcomings in RTC's jazz version control system.
However the code review best practices came out of the study are solid. However they do not touch upon the version control practices.