There are different types of code review, and I was curious to see what the different types are- and how many I had personally experienced.
There seems to be three main categories:
1. Pair programming (also considered a non-formal type of code review)
2. Formal code review
3. Non-formal code review
Let’s go through them:
Two programmers at the same workstation, one driver and one observer. The roles are switched frequently. I’ve tried this with mixed results, but I like this. To make this happen I often ask my boss for this, or I’ll ask a developer if he has time to sit with me, or if I can sit with him/her.
Formal code review:
A preplanned evaluation process often following a preset way of code reviewing. Never tried this, doesn’t sound to fun really- but probably has its place.
Non-formal code review
Has also a few sub-types:
Rather self-explanatory, a second developer watched over the shoulder of the developer writing the code as the developer walks through the code, and of course gives feedback. I do this as much as I can, and to lure other devs into this I set my desk on standing so it’s easier to get them over for a quick review.
2. Email pass-around
Can be done using a source code management system or just by literally sending code for review. I’ve done this a lot when I have specific problems, and it does work quite nicely on minor problems and pieces of code.
3. Tool-assisted code review
Using specialized tools for review. The only tools I’ve tried are the generic code inspection tools such as JustCode, StyleCop and ReSharper. Not enough for a proper code review in my opinion, but better than nothing. I always strive to have at least one other person review my code.
Which type of code review do you think is the best one? And have I left out anything here? My favorite is over the shoulder with several developers at the same time (often done with a projector screen, snacks and coffee 🙂 )