Jtest logo




Contents  Previous  Next  Index

Performing Static Analysis


Jtest performs static analysis, along with all other appropriate types of testing, each time that you test a class or set of classes. Traditional static analysis (checking static analysis rules that are not in the Global Static Analysis category) can only be performed on classes whose .java source files are available. Global static analysis can be performed as long as .class files are available.

To perform static analysis:

  1. Open the appropriate UI for your test. The Class Testing UI is used to test a single class; the Project Testing UI is used to test a set of classes.
    • The Class Testing UI opens by default when Jtest is launched.
    • The Project Testing UI can be opened by clicking the Class Testing UI's Project button.
  2. If a class or set of classes is already loaded into the UI you are using, click the New button to clear the previous test.
  3. Use the Browse button to indicate what class or set of classes you want to test.
  4. Test the class or project by clicking the Start button.
    • If you only want to perform static analysis, right-click the Start button, then choose Static Analysis from the shortcut menu.
    • If you only want to enforce a particular set of rules, right-click the Start button, then choose Dynamic Analysis> <type of rules you want enforced> from the shortcut menu.

Jtest will then run all requested tests.

Uncaught runtime exceptions found will be reported in the Static Analysis Violations branch of the Errors Found Panel (if you tested a single class) or the Results Panel (if you tested a project).

A description of each rule, as well as an example violation and suggested repair, appears in the Rules section of the Reference Guide. You can also see a description of a rule by right-clicking the rule's violation message (the line with the bug icon), then choosing View Rule Description from the shortcut menu.

Related Topics

About Static Analysis

Creating Your Own Static Analysis Rules

Viewing Class and Project Metrics

Tracking Metrics Over Time

Customizing Static Analysis

Jtest Tutorials


Contents  Previous  Next  Index

ParaSoft logo
(888) 305-0041 info@parasoft.com Copyright © 1996-2001 ParaSoft