3 ms·
Facts about code reviews. 1. According to research, there is no more cost-effective method of bug detection known than careful code review. (Steve McConnell's
by btilly 14y ago
Facts about code reviews.
1. According to research, there is no more cost-effective method of bug detection known than careful code review. (Steve McConnell's Rapid Development cites internal IBM statistics, but I completely believe it.) This is before you get to any other benefits, such as cross training, code consistency, etc.
2. According to widely reported experience for over 50 years, there is no faster way to get a lot of programmers upset than to review their code.
Therefore a primary goal in code review is to avoid conflict. The following principles have been found to help.
1. Do not involve management. When people have reason to believe that their manager will see the result of code review, the odds of defensive behavior skyrockets.
2. Review only small pieces. If you find a problem in a small piece, it can be easily fixed, you move on. Reviewing a big piece is a lot more work, and fixing even a minor design flaw can be a lot of work to redo.
3. Make reviews fast. If you don't want people to write a lot of code without getting any of it reviewed, then you cannot make them take a long time to review said code.
4. Make reviews required. If people don't have to do them, they won't. And the ones who are most likely to skip are the ones whom, 6 months later, you'll wish had.
In this spirit you might consider http://code.google.com/p/rietveld/ http://code.google.com/p/rietveld/ as a way to make sure that your team reviews early, reviews often, and reviews in small chunks. (Some will love it, some will hate it. Your source code quality will improve though.)
- jff 14y agoWe've found Gerrit (a git equivalent of Rietveld code review) to be significantly more usable. We were probably using it wrong, but it seemed like there wasn't a week that went by where we didn't have to re-initialize a local repo because Code Review had gone off the rails.