Eines personals
Esteu aquí: Inici Enginyeria i Arquitectura Software quality. Quality audit and certification Java Code Inspection Checklist

Java Code Inspection Checklist

Accions del document
  • Imprimeix-ho
  • Bookmarks

Click here to get the file

Size 4.8 kB - File type text/html

File contents

<!DOCTYPE html PUBLIC "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
  <meta http-equiv="Content-Type"
 content="text/html; charset=iso-8859-1">
  <meta name="Author" content="John Dalbey">
  <meta name="GENERATOR"
 content="Mozilla/4.7 [en]C-CCK-MCD NSCPCD47  (Win95; I) [Netscape]">
  <title>Java Code Inspection Checklist</title>
</head>
<body>
<dl>
  <center>
  <h3> Java Code Inspection Checklist</h3>
  </center>
  <p><br>
1. Specification / Design </p>
&nbsp;&nbsp;&nbsp;&nbsp; Is the functionality described in the
specification fully implemented by the code? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Is only specified functionality implemented
with no additional functionality
added?<br>
&nbsp;&nbsp;&nbsp;&nbsp; Is the program interface implemented as
described in the javadocs? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Are the javadocs complete, including DBC or
Error checking specs as appropriate?<br>
&nbsp;&nbsp;&nbsp;&nbsp; Does the code conform to the class coding
standard?<br>
&nbsp;&nbsp;&nbsp;&nbsp; Is the code correct? Does the code implement
the detailed design provided? (Suggestion: perform a hand trace of the
execution to verify correctness.<br>
&nbsp;&nbsp;&nbsp;&nbsp; Does the implementation avoid <a
 href="http://www.csc.calpoly.edu/%7Ejdalbey/SWE/CodeSmells/bonehead.html">bonehead
programming</a>?<br>
&nbsp;&nbsp;&nbsp;&nbsp; Is the code free of "smells?" (Duplicate
code, long methods, big classes, breaking encapsulation, etc.) <br>
</dl>
<dl>
  <p>2. Initialization and Declarations </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; Are variables and class members of the
correct type and appropriate mode <br>
&nbsp;&nbsp;&nbsp;&nbsp; Are variables declared in the proper scope? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Is a constructor called when a new object is
desired? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Are all object references initialized before
use? </p>
  <p>3. Method Calls </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; Are parameters presented in the correct
order? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Is the correct method being called, or should
it be a different method with a similar name? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Are method return values used properly? </p>
  <p>4. Arrays </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; Are there no off-by-one errors in array
indexing? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Hav all array (or other collection) indexes
been prevented from going
out-of-bounds? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Is a constructor called when a new array item
is desired? </p>
  <p>5. Object Comparision </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; Are all objects (including Strings)&nbsp;
compared with "equals" and not "=="? </p>
  <p>7. Output Format </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; Are displayed output free of spelling and
grammatical
errors? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Are error messages comprehensive and provide
guidance as to how to correct the problem? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Is the output formatted correctly in terms of
line stepping and spacing? </p>
  <p>8. Computation, Comparisons and Assignments </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; Check order of computation/evaluation,
operator precedence and parenthesising <br>
&nbsp;&nbsp;&nbsp;&nbsp; Are all denominators of a division prevented
from being
zero? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Is integer arithmetic, especially division,
used appropriately to avoid causing unexpected truncation/rounding? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Are the comparison and boolean operators
correct? <br>
&nbsp;&nbsp;&nbsp;&nbsp; If the test is an error-check, can the error
condition actually be legitimate in some cases? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Is the code free of any implicit type
conversions? </p>
  <p>8. Exceptions </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; Are all relevant exceptions caught? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Is the appropriate action taken for each catch
block? </p>
  <p>9. Flow of Control </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; In a switch statement, are all cases by
break or return? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Do all switch statements have a default
branch? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Are all loops correctly formed, with the
appropriate initialization, increment and termination expressions? </p>
  <p>10. Files </p>
  <p>&nbsp;&nbsp;&nbsp;&nbsp; Are all files properly declared and
opened? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Are all files closed properly, even in the
case of an error? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Are EOF conditions detected and handled
correctly? <br>
&nbsp;&nbsp;&nbsp;&nbsp; Are all file exceptions caught? </p>
  <p> </p>
<hr>
Would someone like to merge the items in 
<a href="http://users.csc.calpoly.edu/~jdalbey/SWE/JavaPitfalls.html">
Java Pitfalls</a>
into this checklist?

  <hr width="100%">Revised 2/20/05 so all questions should be answered
YES<br>
CPE 308 <a href="http://www.csc.calpoly.edu/%7Ejdalbey/205">Home</a>
</dl>
</body>
</html>
Copyright 2010, Autors i col·laboradors. Cite/attribute Resource. Java Code Inspection Checklist. (2013, February 07). Retrieved October 21, 2019, from Recursos educatius - UdL OpenCourseWare Web site: http://ocw.udl.cat/enginyeria-i-arquitectura/software-quality/java-code-inspection-checklist. This work is licensed under a Creative Commons License Creative Commons License
Reuse Course
Download this course