... | ... | @@ -2,37 +2,37 @@ |
|
|
|
|
|
### **Quality Criteria and Inspection Items Checklist:**
|
|
|
|
|
|
**Completeness (of reflection by code of requirements)**
|
|
|
1. **Completeness (of reflection by code of requirements)**
|
|
|
* a. Each required function is provided as a public method
|
|
|
* b. Each such method has appropriate parameters
|
|
|
|
|
|
**Consistency (of layout, name choice, and code organization)**
|
|
|
2. **Consistency (of layout, name choice, and code organization)**
|
|
|
* a. Placement of braces ({ and }) done consistently throughout.
|
|
|
* b. Indentation is used, consistently, to indicate block structure within braces.
|
|
|
* c. Block comments precede the code they describe.
|
|
|
* d. The same names or abbreviations are used consistently for the same concept (e.g. not next, nextNode, and nxtn in three places in the same class).
|
|
|
* e. Naming conventions for classes, class members (methods and variables), constants, and local variables, are distinct and consistent (e.g.ClassName, classMethod, CLASS_CONSTANT, and local_variable).
|
|
|
|
|
|
**Anomaly Management (of inputs and contexts which the requirements didn't anticipate)**
|
|
|
3. **Anomaly Management (of inputs and contexts which the requirements didn't anticipate)**
|
|
|
* a. Input parameters to public methods, and inputs read from files, are checked explicitly for all unacceptable values.
|
|
|
* b. Unacceptable public input produces error output (System. err) and/or throws exceptions
|
|
|
* c. Unacceptable public input produces a documented result (e.g. zero, null, the empty String ...) when there is no exception thrown.
|
|
|
* d. Input parameters to private methods are assumed acceptable and are not checked
|
|
|
* e. Input to protected methods is consistently assumed either private or public as above
|
|
|
|
|
|
**Efficient Processing (using as little processing time as is reasonable)**
|
|
|
4. **Efficient Processing (using as little processing time as is reasonable)**
|
|
|
* a. Loops contain complex code, or other loops, only when necessary.
|
|
|
* b. Array processing (especially search) contains loop exit code to execute when the condition is found
|
|
|
|
|
|
**Efficient Storage**
|
|
|
5. **Efficient Storage**
|
|
|
* a. All local and instance variables are actually used somewhere
|
|
|
|
|
|
**Simplicity**
|
|
|
6. **Simplicity**
|
|
|
* a. No method is longer than one page (about 60 lines including comments).
|
|
|
* b. Math expressions, control expressions (in ifs, whiles, fors, and switches) are as simple as possible.
|
|
|
* c. Standard coding idioms (e.g. for (int i=0; i<array.length; ++i)) are used where appropriate. Short private methods are preferred to repeating the same code over and over in different places.
|
|
|
|
|
|
**Self-Description**
|
|
|
7. **Self-Description**
|
|
|
* a. Comments are provided whenever the purpose or reason for doing something in the code is obscure.
|
|
|
* b. Comments are provided to describe every method, however briefly.
|
|
|
* c. Comments are provided to describe the purpose, restrictions, and relationships between all instance variables in a class.
|
... | ... | @@ -40,17 +40,17 @@ |
|
|
* e. Constants (static final) are used instead of magic numbers. (e.g. Don't write 42, write static final ULT_ANS = 42; and then use ULT_ANS instead.)
|
|
|
* f. Booleans are not compared to boolean constants. (e.g. if (!found) is preferred to if (found == false))
|
|
|
|
|
|
**Reusability**
|
|
|
8. **Reusability**
|
|
|
* a. Public methods are as general-purpose as is consistent with the design
|
|
|
* b. Public method headers do not reveal the known usage of the class by code outside the class
|
|
|
|
|
|
**Modularity**
|
|
|
9. **Modularity**
|
|
|
* a. Instance variables are not public
|
|
|
* b. Variables are declared as locally as possible
|
|
|
* c. Public method headers don't reveal the internal design of the class
|
|
|
* d. System.exit is not called directly
|
|
|
|
|
|
**Instrumentation**
|
|
|
10. **Instrumentation**
|
|
|
* a. Every class has a parameterless toString method which returns a String containing a dump or summary of an instance of the class.
|
|
|
|
|
|
|
... | ... | |