Interview Questions

Review Code by Programmer Peers

Why are there Bugs in Software?

(Continued from previous question...)

Review Code by Programmer Peers

Peer code reviews have consistently been shown to be the single most cost-effective way of removing bugs from code. The process of explaining a new section of code to another engineer and persuading that second engineer the code is defect-free has several positive impacts:
Exposes the design and implementation, with benefits similar to tracing the code.
Forces the engineer to articulate assumptions. About ten percent of our code reviews are stopped in progress as the authoring engineer suddenly says, "Oops! Never mind!" because he suddenly realized that he had made an invalid assumption. (The review later resumes with the revised code.)
Allows more than one engineer to look at the code while it can still be easily changed. Code will be made simpler and easier to understand.
Encourages cross-training and sharing of techniques. By discussing design strategies and implementation techniques, each engineer learns from the experience of their peers.
Peer code reviews seem to work best. Code reviews done by managers or senior technical staff can have some of the same benefits, but sometimes are less effective due to the interpersonal dynamics.

(Continued on next question...)

Other Interview Questions