Following are some of the items that we need to keep in mind while Reviewing Java Code. The following checklist holds a list of activities that needs to be carried out while Reviewing Java Code.

There are eleven different types issues that have been discussed here and the critical areas in which review should be done is also discussed below.

  1. Style-related Issues
    1. Has the standard specified in the project plan been followed?
    2. Is adequate inline documentation available?
    3. Does the file header include the following:
      1. Program header
      2. Application name
      3. Dependencies
      4. Limitations
      5. Copyright information
      6. Modification log
    4. Have meaningful naming conventions been followed? Do they reflect the hierarchy of the procedures/paras? Do they identify global, common and external functions?
    5. Has code been adequately indented?
    6. Has a common set of routines been written instead of replicating code for these routines in various programs?
    7. Is there any redundant code? (There must be no redundant code.)
  2. Labels  and  Mnemonics-related Issues
    1. Has any label not been referenced?
    2. Have meaningful mnemonics been used for constants?
    3. Is the usage of mnemonics correct? (Multiple mnemonics should not be used for the same purpose.)
  3. Arrays-related Issues
    1. Are all the array indexes within bounds?
    2. Are all the array indexes correctly initialized?
  4. Looping/Branching-related Issues
    1. Are all the branch conditions correct?
    2. Does a loop always terminate?
    3. Is the condition for terminating a loop correct?
    4. Have the divisors been tested for zero (where applicable)?
    5. Can statements placed in the loop be placed outside the loop?
  5. Structure-related Issues
    1. Have the portions of the code that the thread of execution never reaches been identified?
    2. Have too many nested ‘IF’ statements been used? (This should be avoided.)
  6. Function-related Issues
    1. Has imported data been tested for validity?
    2. Do the actual and formal interface parameters correspond?
    3. Have all variables been used? Have the output variables been assigned?
  7. Database-related Issues
    1. Do queries on tables enforce the use of indexes?
    2. Are add/modify mode screen attributes correctly set and reset?
    3. Has error status been checked after each SQL statement?
    4. Has locking been performed prior to updates?
    5. Have the following conditions been checked in expressions?
      1. Rounding off  (if required)
      2. Possibility of division by zero
  8. Performance-related Issues
    1. Will the requirements of execution time (if applicable) be met?
    2. Is there a more efficient alternative?
  9. Usability-related Issues
    1. Are information messages provided during processes that take a long time? (This is optional.)
  10. File-related Issues
    1. Have the following checks been performed?
      1. checks for empty file
      2. checks for I-O error
  11. Error Handling Issues
    1. Are the error messages understandable? Are the error messages adequate?
    2. Have all errors been trapped and handled?

Related Posts

  1. Checklist/Guidelines for ASP.Net Developers
  2. ASP.Net Developers Checklist – Security Checklist
  3. SQL Server 2005 database DBA Checklist for database administrator
  4. Java Class for Sending Email using Java API
  5. Error: SQL1263N Archive file name not valid

Tags: , ,

3 Comments to “Code Review Checklist for Java”

  1. veerabahu says:

    9. Database-related Issues & 10. File related issues – Both of this should check for proper release of connection/stream.
    Also is optimal API’s being used this also needs to be verified as part of code review process.
    Thanks for the well composed check-list

  2. Manjusha NG says:

    Security related issue and thread related issues can also be added.

  3. yty says:

    wwewe

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>