Code reviews have been proven to be an effective way of enhancing quality and sharing experience a long time ago. Code reviews typically discover more problems than testing. Testing is still useful since the areas of detected flaws do not completely overlap.
Code reviews should be performed by experienced developers. For more critical changes or projects, several people might have to review the same code before accepting it for integration.
Reviewing code is very effective for blending in new team members. The “newbie mistakes” and misconceptions can be promptly brought out and discussed with the new teammates.
Since it is the quality of a developer's output that is being dissected in review results, the reviewer must take care to avoid hurting feelings of the developer of reviewed code. It is important to make it clear that the idea of code review is not about attacking him/her, but about achieving common standards, higher quality and less bugs to fix later.
It is important to review every change. First, when a change feels unimportant, it is also less tested, therefore chances of introducing a possibly severe bug are higher. Second, the more broken code slips in, the more will team members be reckless (“hey, it's broken anyway!”) and the less will team members believe in the quality assurance method, thus leading to a vicious cycle of doing even less reviews and having even more bugs creep in.
Since code reviews are most useful when performed by someone other than the original developer of the change, reviewing changes developed by yourself is usually prohibited in Changelogic. This option can be changed on project details page.
Code review can be performed on changes that are in state “awaiting review”. To start reviewing a change, click “Start review” on the details page of the change. Depending on the workflow of your project, code review may also be done after the change has been tested by a tester. In this case “start review” is done by a tester and if testing of functionality passes, the tester reassigns the change to a code reviewer. The state of the change remains “being reviewed” during such reassign.
During review, you might want to check various aspects of submitted code, such as:
You may define review templates to avoid neglecting to check for common trivial shortfalls. Based on the template, a form will have to be filled in by reviewer each time a review passes or fails.
The most time consuming part of a review is reading diffs. On the details page of a change, you can see the list of files that were edited, added or removed within that change. Click on the listed filenames to see how the file was edited within the reviewed change.
If you want to check out the whole change from VCS, you may use command ant checkout_version. Should you wish to perform the checkout manually, the tag is given on the detail form of the change along with the command how to update your working directory to that change. Using manual checkout is discouraged as it might not be possible in future versions of Changelogic.
When rejecting a review, be sure to describe thoroughly what exactly drove you to that decision and how things should be improved.
Statistics: according to Changelogic's current state of practice about 30% of overall code reviews fail, usually for several reasons. This translates into quite a number of bugs that would have otherwise reached the mainline.