|
Table of Contents
Get a printable version of this User's Guide (In some browsers you may need to right-click this link and choose Save Target As or Save Link As from the shortcut menu that opens).
Introduction
- Introduction
- Installation, Startup & Licensing
- Contacting ParaSoft
Testing With Jtest
- Quick Start Guide
- Testing a Single Class
- Testing a Class - Example
- Understanding the Errors Found Panel
- Exploring & Customizing Class Test Results
- Testing a Set of Classes
- Testing a Set of Classes - Example
- Understanding the Results Panel
- Exploring & Customizing Project Test Results
- Loading One of a Project's Classes in the Class Testing UI
- Editing Class Test Parameters from the Project Testing UI
- Running Jtest in Batch Mode
- Testing a Large Project
Static Analysis
- About Static Analysis
- Performing Static Analysis
- Viewing Class and Project Metrics
- Customizing Static Analysis
- Creating Your Own Static Analysis Rules
Dynamic Analysis
- About Dynamic Analysis
- Performing Dynamic Analysis
- Customizing Dynamic Analysis
- Testing Classes That Reference External Resources
- Using Custom Stubs
- Setting an Object to a Certain State
White-Box Testing
- About White-Box Testing
- Performing White-Box Testing
Black-Box Testing
- About Black-Box Testing
- Performing Black-Box Testing (From Class Testing UI)
- Performing Black-Box Testing (From Project Testing UI)
- Adding Method Inputs
- Using Test Classes
- Specifying Imports
Regression Testing
- About Regression Testing
- Performing Regression Testing
Test-Related Tasks
- Saving and Restoring Tests Parameters
- Viewing Test History
- Viewing Context-Sensitive Help
- Viewing, Editing, or Compiling a Source
- Viewing and Validating Test Cases
- Viewing a Report of Results
- Viewing the Contents of a Results Directory
Customizing Your Test
- Customizing Test Parameters
- Sharing Project Test Parameters
- Customizing Reporting of Violations
- Static Analysis Suppressions
- Dynamic Analysis Suppressions
- Customizing System Settings
Jtest UI Help
- Jtest UI Overview
- Trees
- Cursors
Class Testing UI
- Class Testing UI
- Class Testing UI Menu Bar
- Class Testing UI Tool Bar
- Class Name Panel
- Test Progress Panel
- Errors Found Panel
Project Testing UI
- Project Testing UI
- Project Testing UI Menu Bar
- Project Testing UI Tool Bar
- Controls Panel
- Project Testing UI Results Panel
Test Parameters Windows
- Global Test Parameters
- Global Test Parameters - Static Analysis
- Global Test Parameters - Dynamic Analysis
- Global Test Parameters - Common Parameters
- Class Test Parameters
- Class Test Parameters - Static Analysis
- Class Test Parameters - Dynamic Analysis
- Class Test Parameters - Common Parameters
- Project Test Parameters
- Project Test Parameters - Static Analysis
- Project Test Parameters - Dynamic Analysis
- Project Test Parameters - Common Parameters, Search Parameters, Classes in Project
Tools
- Find Classes UI
Reference
- Jtest Tutorials
- Jtest FAQs
- Fixing Errors Found
- Built-in Static Analysis Rules
Possible Bugs Rules
- PB.SBC: "switch" statement with bad "case"
- PB.FEB: Avoid "for" statements with empty bodies
- PB.IEB: Avoid "if" statements with empty bodies
- PB.IMO: Make sure that the intended method is overridden
- PB.UEI: Use `equals()' instead of "==" when comparing Strings
- PB.ADE: Avoid dangling "else" statements
- PB.CLP: Don't cast primitive datatypes to lower precision
- PB.TLS: Don't use text labels in "switch" statements
- PB.AUO: Avoid using an object to access "static" fields or methods
- PB.DNCSS: Do not call 'setSize()' in 'ComponentListener. componentResized()'
- PB.ASI: Avoid assignments within an "if" condition
- PB.PDS: Provide "default:" for each "switch" statement
- PB.NEA: Do not use embedded assignment
- PB.DCF: Do not compare floating point types
- PB.FLVA: Don't assign to loop control variables in the body of a "for" loop
- PB.AECB: Avoid "catch" statements with empty bodies
- PB.CTOR: Avoid package-private classes with "public" constructors
- PB.EQL: Prefer 'getClass()' in 'equals()' method implementation
- PB.NAMING: Method's name should not be same as its container class's unless it's a constructor
- PB.MRUN: Missing 'run()' method in Thread class
- PB.MPC: Avoid using method parameter names that conflict with the class member names
- PB.DCP: Do not confuse the "+" operator for String concatenation
Object Oriented Programming Rules
- OOP.AHSM: Avoid hiding inherited "static" member methods
- OOP.LEVEL: Avoid more than two levels of nesting classes
- OOP.AHF: Avoid hiding inherited instance fields
- OOP.OPM: Do not `override' a private method
- OOP.AIC: An inner "class" should only be used if it is going to associate with and be visible to the class that contains it
- OOP.APPF: Avoid "public" or package-private instance fields
- OOP.APROF: Avoid "protected" instance fields
- OOP.LPF: List all "public" and package-private methods/data first
- OOP.IIN: Implement interfaces non-trivially or "abstract"
Unused Code Rules
- UC.AAI: Avoid unnecessary modifiers in "interface"
- UC.AUV: Avoid unused local variables
- UC.PF: Avoid unused "private" fields
- UC.PM: Avoid unused "private" methods
- UC.UP: Avoid unused parameters
- UC.DIL: Don't explicitly "import" java.lang.* "package"
Initialization Rules
- INIT.SF: Explicitly initialize all "static" fields
- INIT.CSI: Constructor should explicitly initialize all fields
Coding Standard Rules
- CODSTA.VDT: Do not declare multiple variables of different types in one statement
- CODSTA.OGM: Order group members with the same name together
- CODSTA.USN: Use symbolic names for constants
- CODSTA.NCAC: Never call an "abstract" method from a constructor in an "abstract" class
- CODSTA.OVERRIDE: If you override 'Object.equals()', also override 'Object.hashCode()'
- CODSTA.SMC: Avoid "switch" statements with many cases
- CODSTA.PML: Put the `main()' method last
- CODSTA.NTX: Never "throw" class `Exception' directly
- CODSTA.NCE: Never use `Exception', RuntimeException', or `Throwable' in "catch" statement
- CODSTA.NTE: Never "throw" an `Error' directly
- CODSTA.DCTOR: Define a default constructor whenever reasonable
- CODSTA.DCI: Define constants in an "interface"
- CODSTA.LONG: Use `L' instead of `l' to express "long" integer constant
- CODSTA.MAIN: The 'main()' method must be "public", "static" and "void"
Naming Convention Rules
- NAMING.NCL: Enforce name format of classes
- NAMING.NITF: Enforce name format of interfaces
- NAMING.NE: Enforce name format of exceptions
- NAMING.NM: Enforce name format of methods
- NAMING.NSF: Enforce name format of "static" fields
- NAMING.NSM: Enforce name format of "static" methods
- NAMING.NMP: Enforce name format of method parameters
- NAMING.NIF: Enforce name format of instance fields
- NAMING.NLV: Enforce name format of local variables
- NAMING.USF: Use only uppercase letters for "final" "static" fields
- NAMING.IRB: Use `is...' for naming methods that return a "boolean"
- NAMING.GETA: Accessor methods name should start with 'get'
- NAMING.GETB: Getter methods name should start with 'is'
- NAMING.IFV: Use uppercase letters for "interface" fields
- NAMING.SETA: Setter methods name should start with 'set'
- NAMING.CVN: Use conventional variable names
Javadoc Comment Rules
- JAVADOC.MAJDT: Missing '@author' Javadoc tag in a "class" Javadoc comment
- JAVADOC.MVJDT: Missing '@version' Javadoc tag
- JAVADOC.BT: Bad tag in Javadoc comment
- JAVADOC.MJDC: Missing Javadoc comments
Portability Rules
- PORT.ENV: Do not use "System.getenv()"
- PORT.LNSP: Do not hardcode `\n', or `\r' as a line separator
- PORT.PEER: Do not use `java.awt.peer.*' interfaces directly
- PORT.EXEC: Do not use `Runtime.exec()'
- PORT.NATV: Do not use user defined "native" methods
Optimization Rules
- OPT.CS: Close stream in "finally" block
- OPT.IRB: Use `System.arraycopy ()' instead of using a loop to copy an array
- OPT.MAF: Make accessor methods for instance fields "final"
- OPT.UISO: Avoid unnecessary "instanceof" evaluations
- OPT.UNC: Avoid unnecessary casting
- OPT.AAS: Use abbreviated assignment operators
- OPT.SDIV: Use shift operator on 'a / b' expressions
- OPT.SMUL: Use shift operator on 'a * b' expressions
- OPT.STR: Use ' ' instead of " " for one character string concatenation
- OPT.SYN: Never call a "synchronized" method in a loop
- OPT.TRY: Place "try/catch" blocks outside of loops
- OPT.UEQ: Avoid unnecessary equality operations with booleans
- OPT.USC: Use 'String' instead of 'StringBuffer' for constant strings
- OPT.USB: Use `StringBuffer' instead of `String' for non-constant strings
- OPT.CEL: Avoid using complex expressions in loop condition statement
- OPT.IF: Use conditional operator for "if (cond) return; else return;" statements
- OPT.IFAS: Use conditional assignment operator for "if (cond) a = b; else a = c;" statements
- OPT.LOOP: Avoid instantiating variables in the loop body
- OPT.USV: Use `stack' variables whenever possible
- OPT.DIC: Define initial capacities for 'Vectors' and 'Hashtables'
- OPT.DUN: Don't use the negation operator frequently
- OPT.INSOF: Test "instanceof" to an interface
Garbage Collection Rules
- GC.FM: 'finalize()' method should not unregister listeners
- GC.FCF: Make sure that `finalize ()' calls `super.finalize ()'
- GC.AUTP: Avoid unnecessary temporaries when converting primitive types to String
- GC.OSTM: Be aware of memory leaks due to `ObjectStream' usage
- GC.IFF: Invoke `super.finalize()' in the `finally' blocks of `finalize()' methods
- GC.DUD: Do not use `Date[]'; use `long[]' instead
- GC.NCF: Never call `finalize()' explicitly
- GC.STV: Avoid "static" collection; it can grow without bounds
- GC.GCB: Reuse objects, 'getClipBounds()' should not be called too often
Threads and Synchronization Rules
- TRS.WAIT: The condition test should always be in a loop
- TRS.THRD: Do not call 'Thread.resume()', 'Thread.stop()', or 'Thread.suspend()'
- TRS.ANF: Do not use 'notify()'; use 'notifyAll()' instead
- TRS.RUN: Methods implementing 'Runnable.run()' should be "synchronized"
- TRS.UWNA: Use 'wait()' and 'notifyAll()' instead of polling loops
- TRS.NSM: Do not use the "synchronized" modifier
Enterprise Java Bean Rules
- EJB.CDP: Bean "class" should be declared as "public"
- EJB.CNDA: Bean "class" cannot be declared as "abstract"
- EJB.CNDF: Bean "class" cannot be declared as "final"
- EJB.CRTE: ejbCreate() must be "public", and cannot be "static" or "final"
- EJB.FNDM: Finder methods cannot be "final" or "static" and must be "public"
- EJB.IECM: Bean "class" implements one or more `ejbCreate()' methods
- EJB.IEPM: EntityBean "class" requires one or more `ejbPostCreate()'
- EJB.MNDF: Bean "class" must not define the `finalize()' method
- EJB.PCRTE: `ejbPostCreate()' must be "public", and cannot be "static" or "final"
- EJB.RT: Finder methods' "return" type must be the primary key or a collection of primary keys
- EJB.RTC: SessionBean's `ejbCreate()' methods' "return" type must be "void"
- EJB.RTP: `ejbPostCreate()' method's "return" type must be "void"
- EJB.ACCF: Always access JavaBeans properties through accessors
Class Metrics
- METRICS.CIHL: "class" or "Interface" inheritance level
- METRICS.CTNL: Number of lines in a "class" or "interface"
- METRICS.NOF: Number of fields
- METRICS.NOM: Number of methods
- METRICS.NPKGF: Number of package-private fields
- METRICS.NPKGM: Number of package-private methods
- METRICS.NPRIF: Number of "private" fields
- METRICS.NPRIM: Number of "private" methods
- METRICS.NPROF: Number of "protected" fields
- METRICS.NPROM: Number of "protected" methods
- METRICS.NPUBF: Number of "public" fields
- METRICS.NPUBM: Number of "public" methods
- METRICS.PJDC: Percentage of Javadoc comments(%)
- METRICS.TCC: Cyclomatic Complexity
- METRICS.TNLM: Number of lines in a method
- METRICS.TNMC: Number of method calls
- METRICS.TNOP: Number of parameters
- METRICS.TRET: Number of "return" statements
Project Metrics
- PMETRICS.NB: Number of bytes
- PMETRICS.NC: Number of classes
- PMETRICS.NJF: Number of Java source files
- PMETRICS.NL: Number of lines
- PMETRICS.NPAC: Number of packages
- PMETRICS.NPKGC: Number of package-private classes
- PMETRICS.NPRIC: Number of "private" classes
- PMETRICS.NPROC: Number of "protected" classes
- PMETRICS.NPUBC: Number of "public" classes
Miscellaneous Rules
- MISC.HMF: Avoid hiding member fields in member methods
- MISC.PIF: Provide incremental segment/part in "for" loop or use "while" loop
- MISC.PCF: Provide condition in "for" loop
- MISC.CLONE: A `clone()' method should invoke `super.clone()' in the body
- MISC.CTOR: Use care when calling non-"final" methods from constructors
- MISC.EFB: Each "for" statement should have a block
- MISC.AFP: Avoid assignment to method parameters
Global Static Analysis Rules
- GLOBAL.UPAF: Avoid globally unused package-private fields
- GLOBAL.UPAM: Avoid globally unused package-private methods
- GLOBAL.UPAC: Avoid globally unused package-private classes
- GLOBAL.DPAF: Declare package-private fields as inaccessible as possible
- GLOBAL.DPAM: Declare package-private methods as inaccessible as possible
- GLOBAL.DPAC: Declare package-private classes as inaccessible as possible
- GLOBAL.UPPF: Avoid globally unused public/protected fields
- GLOBAL.UPPM: Avoid globally unused "public"/"protected" methods
- GLOBAL.UPPC: Avoid globally unused "public"/"protected" classes
- GLOBAL.DPPF: Declare "public"/"protected" fields as inaccessible as possible
- GLOBAL.DPPM: Declare public/protected methods as inaccessible as possible
- GLOBAL.DPPC: Declare "public"/"protected" classes as inaccessible as possible
Index
- Index
Jtest License agreement
|
|