Explain Code Inspection

In contrast to code walk through, the aim of code inspection is to discover some common types of errors caused due to oversight and improper programming. In other words, during code inspection the code is examined for the presence of certain kinds of errors, in contrast to the hand simulation of code execution done in code walk throughs. For instance, consider the classical error of writing a procedure that modifies a formal parameter while the calling routine calls that procedure with a constant actual parameter. It is more likely that such an error will be discovered by looking for these kinds of mistakes in the code, rather than by simply hand simulating execution of the procedure. In addition to the commonly made errors, adherence to coding standards is also checked during code inspection. Good software development companies collect statistics regarding different types of errors commonly committed by their engineers and identify the type of errors most frequently committed. Such a list of commonly committed errors can be used during code inspection to look out for possible errors. Following is a list of some classical programming errors which can be checked during code inspection:

  • Use of uninitialized variables.
  •  Jumps into loops.
  •  Nonterminating loops.
  •  Incompatible assignments.
  •  Array indices out of bounds.
  • Improper storage allocation and deallocation.
  •  Mismatches between actual and formal parameter in procedure calls.
  •  Use of incorrect logical operators or incorrect precedence among operators.
  • Improper modification of loop variables.
  •  Comparison of equally of floating point variables, etc.

Leave a Reply