Parasoft Jtest9 Getting Started Guide
Parasoft Jtest9 Getting Started Guide
Introduction
Parasoft Jtest is an integrated solution for automating a broad range of practices proven to improve software development team productivity and software quality. It focuses on practices for validating Java code and applications, and it seamlessly integrates with Parasoft SOAtest to enable end-to-end functional and load testing of todays complex, distributed applications and transactions. Jtest facilitates: Static analysis: Static code analysis, data flow static analysis, and metrics analysis Peer code review: Preparation, notification, and tracking Unit testing: JUnit and Cactus test creation, execution, optimization, and maintenance Runtime error detection: Race conditions, exceptions, resource & memory leaks, security attack vulnerabilities, and more
This provides teams a practical way to prevent, expose, and correct errors in order to ensure that their Java code works as expected. To promote rapid remediation, each problem detected is prioritized based on configurable severity assignments, automatically assigned to the developer who wrote the related code, and distributed to his or her IDE with direct links to the problematic code and a description of how to fix it. Development teams use Jtest to: Prevent errors that impact security, reliability, and performance Comply with internal or regulatory quality initiatives Ensure consistency across large and distributed teams Increase productivity by automating tedious yet beneficial development practices Successfully implement popular development methods like TDD, Agile, and XP
Prerequisites
Windows 2000, XP, 2003, Vista, or 7 (x86 or x86_64) Sun Microsystems JRE 1.3 or higher Note that the IBM JRE conflicts with Jtest. See Preventing Conflicts with the IBM JRE, page 716 for details and workarounds. Intel Pentium III 1.0 GHZ minimum; Intel Pentium IV Single Core 3.0 GHZ recommended SVGA 800x600 display minimum; 1280x1024 recommended 1 GB RAM minimum; 2 GB RAM recommended A mouse or an alternative pointing device
Hardware
Installation
To install the standalone version of Jtest on a Windows system: 1. In Windows Explorer, locate and double-click the self extracting archive (parasoft_jtest_9.0_<arch>.exe). 2. Click Yes when a dialog asks whether you want to install Jtest. 3. Click Yes after you have read and agreed with the license information. 4. Click Next after you have read the readme file. 5. Enter the desired installation directory in the Installation Location dialog box, then click Next. Jtest will then start copying files. A dialog box with a progress indicator will open and indicate installation progress. When the installation is complete, a notification dialog box will open. 6. Click the OK button to close the notification dialog box. Jtest will be installed in the specified installation directory; by default, this is C:\Program Files\Parasoft\Jtest\9.0\.
Startup
To start Jtest: Double-click the Jtest 9.0 desktop icon or choose Programs> Parasoft> Jtest 9.0> Jtest 9.0 from the Windows Start menu.
Note: You must install a license (as described in Installing a Jtest License, page 13) before you begin using Jtest.
Prerequisites
Windows 2000, XP, 2003, Vista, or 7 (x86 or x86_64) Eclipse 3.2 - 3.6; IBM Rational Application Developer 7.0, 7.5 Sun Microsystems JRE 1.3 or higher Note that the IBM JRE conflicts with Jtest. See Preventing Conflicts with the IBM JRE, page 716 for details and workarounds. Intel Pentium III 1.0 GHZ minimum; Intel Pentium IV Single Core 3.0 GHZ recommended SVGA 800x600 display minimum; 1280x1024 recommended 1 GB RAM minimum; 2 GB RAM recommended A mouse or an alternative pointing device
Hardware
Installation
To install the Jtest plugin on a Windows system: 1. In Windows Explorer, locate and double-click the self extracting archive (parasoft_jtest_9.0_<arch>_eclipse_plugin.exe). 2. Click Yes when a dialog asks whether you want to install Jtest. 3. Click Yes after you have read and agreed with the license information. 4. Click Next after you have read the readme file. 5. Enter the desired destination directory for the Jtest Extension files, then click Next. The default destination directory is C:\Program Files\Parasoft\JtestExtension. 6. Enter your Eclipse installation directory, then click OK. 7. Close the IDE (Eclipse, Application Developer) if it is open, then click OK to close the dialog reminding you to close this program. Jtest will then start copying files and installing the necessary files into the workbench. A dialog box with a progress indicator will open and indicate installation progress. When the installation is complete, a notification dialog box will open. 8. Click the OK button to close the notification dialog box. Jtest will be installed in the specified installation directory; by default, this is C:\Program Files\Parasoft\Jtest Extension\9.0\.
Startup
To start Jtest: 1. Start the IDE (Eclipse, Application Developer) by double-clicking the appropriate desktop icon or choosing the appropriate menu item from the Windows Start menu. 2. Open the Jtest perspective by choosing Window> Open Perspective> Other, then choosing Jtest in the Select Perspective dialog that opens. 3. If the Parasoft menu is not visible in the IDE toolbar, choose Window> Reset Perspective. If the Parasoft menu still is not visible, ensure that you have the latest version of Jtest by choosing Help> Software Updates> Pending Updates and installing any pending updates. Note: You must install a license (as described in Installing a Jtest License, page 13) before you begin using Jtest.
Prerequisites
Operating System
Linux: Red Hat Enterprise Linux 3, 4, 5 (glibc version 2.3.2 or higher, package compat-libstdc++-33 installed); Linux 32-bit and 64-bit (x86_64 specifically not Itanium) are supported Solaris: Solaris 10 Windowing system: Motif xServer or OpenWin (Solaris) or GTK (Linux) Sun Microsystems JRE 1.3 or higher Note that the IBM JRE conflicts with Jtest. See Preventing Conflicts with the IBM JRE, page 716 for details and workarounds. Linux: Intel Pentium III 1.0 GHZ minimum; Intel Core 2 Duo 2.0 GHz or higher recommended Solaris: UltraSPARC processor 1.0 GHZ minimum; 2 UltraSPARC processors 1.5 GHz or higher recommended SVGA (800x600) display minimum; 1280 x 1024 or higher recommended 1 GB RAM minimum; 2 GB RAM recommended A mouse or an alternative pointing device
Software
Hardware
Installation
To install the standalone version of Jtest on a UNIX system: 1. Copy the installation file (parasoft_jtest_9.0_linux.sh or parasoft_jtest_9.0_solaris.sh) to the directory where you would like to install Jtest. Choose a directory that is writable for the user who will be installing the license. 2. Change directories to the directory where you are going to install Jtest. 7
3. Set "execute" permissions on the installer: Linux: chmod +x parasoft_jtest_9.0_linux.sh Solaris: chmod +x parasoft_jtest_9.0_solaris.sh Linux:
4. Execute the installer, then follow the onscreen instructions to complete the installation.
./parasoft_jtest_9.0_linux.sh
Solaris: ./parasoft_jtest_9.0_solaris.sh
A /home/username/parasoft/jtest/9.0/ directory will be created; this directory will contain the program files needed to run Jtest. A new workspace will be created at <user_home_dir>/parasoft/workspace (e.g., /home/username/
parasoft/workspace).
Startup
To start Jtest: Run the ./jtest command. Note: You must install a license (as described in Installing a Jtest License, page 13) before you begin using Jtest.
Prerequisites
Operating System
Linux: Red Hat Enterprise Linux 3, 4, 5 (glibc version 2.3.2 or higher, package compat-libstdc++-33 installed); Linux 32-bit and 64-bit (x86_64 specifically not Itanium) are supported Solaris: Solaris 10 Windowing system: Motif xServer or OpenWin (Solaris) or GTK (Linux) Eclipse 3.2 - 3.6; IBM Rational Application Developer 7.0, 7.5 Sun Microsystems JRE 1.3 or higher Note that the IBM JRE conflicts with Jtest. See Preventing Conflicts with the IBM JRE, page 716 for details and workarounds. Linux: Intel Pentium III 1.0 GHZ minimum; Intel Core 2 Duo 2.0 GHz or higher recommended Solaris: UltraSPARC processor 1.0 GHZ minimum; 2 UltraSPARC processors 1.5 GHz or higher recommended SVGA (800x600) display minimum; 1280 x 1024 or higher recommended 1 GB RAM minimum; 2 GB RAM recommended A mouse or an alternative pointing device
Software
Hardware
Installation
To install the Jtest plugin on a UNIX system: 1. Copy the installation file (parasoft_jtest_9.0_solaris_eclipse_plugin.sh or parasoft_jtest_9.0_linux_eclipse_plugin.sh) to the directory where you would like to install Jtest. Choose a directory that is writable for the user who will be installing the license. 2. Change directories to the directory where you are going to install Jtest. 3. Set "execute" permissions on the installer: Linux: chmod +x parasoft_jtest_9.0_linux_eclipse_plugin.sh Solaris: chmod +x parasoft_jtest_9.0_solaris_eclipse_plugin.sh
4. Execute the installer, then follow the onscreen instructions to complete the installation.
Linux:
./parasoft_jtest_9.0_linux_eclipse_plugin.sh
Solaris: ./parasoft_jtest_9.0_solaris_eclipse_plugin.sh
A /home/username/parasoft/jtest-extension/9.0/ directory will be created; this directory will contain the program files needed to run Jtest. Note: The Jtest plugin can be uninstalled by deleting the links directory that was created at the top-level of the Eclipse installation directory.
Startup
To start Jtest: 1. Start the IDE (Eclipse, Application Developer) in the normal manner. 2. Open the Jtest perspective by choosing Window> Open Perspective> Other, then choosing Jtest in the Select Perspective dialog that opens. 3. If the Parasoft menu is not visible in the IDE toolbar, choose Window> Reset Perspective. If the Parasoft menu still is not visible, ensure that you have the latest version of Jtest by choosing Help> Software Updates> Pending Updates and installing any pending updates. Note: You must install a license before you begin using Jtest. Note: You must install a license (as described in Installing a Jtest License, page 13) before you begin using Jtest.
10
Prerequisites
Mac OS X Mac OS X 10.5 or higher Eclipse 3.4 - 3.6 Intel Xeon 2.0 GHz or higher recommended SVGA (800x600) display minimum (1024 x 768 recommended) 1 GB RAM minimum; 2 GB RAM recommended A mouse or an alternative pointing device
Hardware
Installation
To install Jtest on a Mac system: 1. Copy the installation file (parasoft_jtest_9.0_updatesite_p2.zip) to a local folder. 2. Open the Eclipse update manager by choosing Help> Install New Software. 3. Open the file browser by clicking Add and then Archive. 4. Locate the zip file from step 1 and click Open, then OK, then Finish. 5. Check Parasoft Jtest (Required), Parasoft Jtest for Mac OS X, and Parasoft Test (Required) then click Next. 6. Accept the license agreement, then click Next. 7. Click Finish, then Install All, then Yes to restart Eclipse. Jtest program files will be extracted to the Eclipse directory.
Startup
To start Jtest: 1. Start Eclipse in the normal manner. 2. Open the Jtest perspective by choosing Window> Open Perspective> Other, then choosing Jtest in the Select Perspective dialog that opens. 3. If the Jtest menu is not visible in the IDE toolbar, choose Window> Reset Perspective. Note: You must install a license (as described in Installing a Jtest License, page 13) before you begin using Jtest.
Important Notes
It may help to increase the memory settings for Eclipse with Jtest installed. Change the shortcut to Eclipse to use 11
Symbolic test generation is not available on Mac OS X. JUnit tests will be generated with default inputs only. The recommended approach is to generate JUnit tests on another platform, commit to source control, then check out and execute the JUnit tests on Mac OS X.
12
5. Enter your license expiration date and password in the Manual License section of the License preferences page. 6. Click Apply. The License preferences page will display the Jtest features that you are licensed to use. 7. Click OK to set and save your license.
7.
13
If your organization needs additional licenses or updated licenses, the manager or architect should contact Parasoft to obtain these licenses, then add these licenses to LicenseServer as described in the LicenseServer documentation.
Tip If you want to deactivate a LicenseServer license, choose Parasoft> Deactivate License. To reactivate it, choose Parasoft> Activate License. If you want to have a LicenseServer license automatically deactivated after 30 minutes of inactivity, enable the Start deactivated, release automatically when idle option. To change this behavior, disable this option. When the license is deactivated: The Parasoft Test views are disabled and results are cleared from the Quality Tasks view. The products LicenseServer license is released. All of the licensed Parasoft Test views are restored and the Quality Tasks view will display results (if available).
14
Using Jtest
Testing Basics
Jtest is equipped to identify a wide variety of errors and potential coding problems that affect functionality, reliability, security, performance, and maintainability. To start identifying these problems, you run a test based on a default or custom test scenario, which defines the precise nature and scope of Jtests analysis. These test scenarios are called "Test Configurations," and they define test scope, static analysis, test case generation, and test case execution settings. All preconfigured Test Configurations are described in the Built-in Test Configurations Jtest Users Guide topic. The procedure for creating a custom Test Configuration is described in the Creating Custom Test Configurations Jtest Users Guide topic.
Prerequisite Before you can test a class with Jtest, that class must be added to a Java project in the Eclipse workbench. For instructions on creating a new project, see Project-Building Basics, page 16.
To run a test: 1. In the Package Explorer for the Jtest perspective, select the resource(s) that you want to test. You can use Ctrl + click or Shift + click to select multiple resources. 2. Do one of the following: To run a test with the Default Configuration (by default, a test scenario which checks coding standards, then generates and executes unit tests), perform one of the following actions: Click the Test Code button in the toolbar. Press Ctrl + Alt+ T. Right-click the resource, then choose Parasoft> Test Using [Default Configuration] from the shortcut menu. Choose the appropriate Test Configuration from the Test Using section of the Test Code buttons pull-down menu. Choose the appropriate Test Configuration from the Parasoft> Test Using menu in the menu bar. Choose the appropriate Test Configuration from the Parasoft> Test History menu in the menu bar. Note that this menu contains only the most recently-run Test Configurations.
To run a test with another Test Configuration, perform one of the following actions:
Jtest will then run the test scenario defined by the selected Test Configuration. Test progress and results summaries will be reported in the Testing panel that Jtest opens when it starts the test. Detailed results will be reported in the Jtest view in the Jtest perspective. Drill down to see details about the test findings.
15
Configuration Basics
A Test Configuration is a collection of settings that define a test scenario that you want to run with Jtest. Each time Jtest runs a test-- in the GUI or from the command line interface-- it uses the designated Test Configuration (or the Default Test Configuration, if no Test Configuration was explicitly selected). The Test Configuration determines all test parameters. For example, it determines parameters such as: The type of analysis/testing performed (static analysis, test case generation, test case execution, runtime error detection, etc.) The rules checked during static analysis The parameters for automatic test case generation Which test cases executed during test case execution Which defects are detected during runtime error detection The scope of each test (what lines to cover, what cutoff date to use, etc.) The metrics calculated
Jtest includes a set of preconfigured "built-in" Test Configurations representing most common test sce-narios. You can further customize these configurations as needed by copying and modifying the built-in configurations, or by creating new user-defined configurations from scratch. User-defined Test Configurations can be placed in the User-defined or Team category. User-defined Test Configurations are stored on the local machine and are available for all tests performed by the local Jtest installation. Team Test Configurations are stored on the teams Team Configuration Manager and can be accessed by all team members. To change how Jtest performs unit testing, static analysis, or metric calculation, you edit an existing Test Configuration or create a new one, then run a test using the modified/new Test Configuration. Test Configurations and all related parameters can be viewed, edited, and modified in the Test Configurations dialog. To open this dialog, choose Parasoft> Test Configurations from the workbench menu bar.
Project-Building Basics
Before you can start testing your own classes with Jtest, those classes must be available in a Java project in the Jtest Eclipse workbench. Use the following table to determine which project creation/importation method is best suited to your circumstances.
If you have this A JBuilder project A Together Control Center project An Ant build file Source files stored in a single directory
Do this Import the project with the JtestJBuilder migration program Import the project with the JtestTogether migration program Use the Import wizard to generate a project based on that build file Create a new project with the Create Project Detecting Existing Layout wizard, which can be opened by choosing Create Project by Detecting Existing Layout from the Create Project buttons pull-down menu
Reference Importing projects from JBuilder Jtest Users Guide topic Importing projects from Together Jtest Users Guide topic Importing projects from Ant build files Jtest Users Guide topic Creating projects from existing project directories Jtest Users Guide topic
16
Do this Create a new project with the Create Project Specifying Source Folders wizard, which can be opened by choosing Create Project by Specifying Source Folders from the Create Project buttons pull-down menu
Reference Creating projects from distributed source directories Jtest Users Guide topic
Capability
Static Code Analysis
Description
Facilitates regulatory compliance (FDA, PCI, etc.). Ensures that the code meets uniform expectations around security, reliability, performance, and maintainability. Eliminates entire classes of programming errors by establishing preventive coding conventions. Detects complex runtime errors related to resource leaks, exceptions, SQL injections, and other security vulnerabilities without requiring test cases or application execution. Identifies complex code, which is more error-prone and difficult to maintain. Enables the team to start verifying reliability and functionality before the complete system is ready, reducing the length and cost of downstream processes such as debugging.
Reference
Parasoft Jtest Users Guide> Static Code Analysis
Parasoft Jtest Users Guide> Data Flow Static Analysis with BugDetective
Metrics Analysis Unit Test Generation and Execution (Including Coverage & Regression Testing) Runtime Error Detection
Parasoft Jtest Users Guide> Metrics Calculation Parasoft Jtest Users Guide> Test Generation and Execution
Exposes critical defects (such as race conditions, exceptions, resource & memory leaks, and security attack vulnerabilities) as the application is exercised during unit testing or at the application level. Automates and manages the peer code review workflow- including preparation, notification, and tracking- and reduces overhead by enabling remote code review on the desktop.
17
Capability
Task Management
Description
Requirements and issues are converted into actionable, measurable work tasks. These are distributed directly to the responsible team member's IDE. Without interrupting the workflow, Parasoft works behind the scenes correlating related tasks and artifacts as well as tracking how much time is spent working on these items. Parasoft's change-based testing helps you optimize your testing efforts by identifying and executing only the test cases directly related to your most recent source code modifications. Not having to test the entire system after each modification yields tremendous productivity improvements. In addition to graphically reporting requirement and defect status as indicated by developers, Parasoft Concerto traces requirements and defects back to test cases. At a glance, the team can gain an objective assessment of which requirements are actually working as expected, which defects are resolved, and which still requirements and defects need testing. This real-time visibility into true requirement and defect status helps you prevent late-cycle surprises that threaten to derail schedules and budgets. Adds consistency and repeatability to the manual testing process; also enables change-based testing by identifying the manual test cases impacted by daily source code modifications.
Reference
Parasoft Test Users Guide> Project Task Management
Change-Based Testing
Manual Testing
18
Documentation Library
The Jtest documentation library includes the following items: Jtest Users Guide: Explains how to use the Jtest functionality that is built upon Eclipse (if you have the standalone version of Jtest) or that is added to Eclipse (if you have the Jtest plugin). To access this guide from the Eclipse help system, choose Help> Help Contents, then open the Parasoft Jtest Users Guide book. The PDF is available in the manuals directory within the Jtest installation directory. RuleWizard Users Guide: Explains how to modify, create, and save custom rules. Note that RuleWizard requires a special license. To access this guide from the Eclipse help system, choose Help> Help Contents, then open the Parasoft Jtest RuleWizard Users Guide book The PDF is available in the Jtest installation directory. Static Analysis Rules Guide: Describes all of the coding standards rules included with Jtest. To access this guide from the Eclipse help system, choose Help> Help Contents, then open the Parasoft Jtest Static Analysis Rules book.
Additional user guides in the Eclipse help system (for example, Workbench User Guide, Java Development User Guide, etc.) describe native Eclipse functionality and strategies.
Search Tips The Eclipse help system provides search functionality. However, by default, it searches for the entered term in all available documentation-- including Eclipse documentation. If you want to restrict your searches to the Jtest documentation, perform the following steps: 1. 2. 3. 4. 5. 6. 7. 8. Choose Help> Help Contents. Click the Search Scope link in the help viewer. Click the New button in the Select Search Scope dialog. Enter Jtest in the New Search List dialog List name field. Check the boxes for the books you want to search (for example, Jtest User's Guide, RuleWizard Users Guide, and/or Jtest Static Analysis Rules). Click OK. Select the Search only the following topics button. Click OK.
The PDF is fully searchable. Popular PDF readers provide both search and find functionality to help you locate the information you are looking for.
19
Contacting Parasoft
Parasoft is committed to providing you with the best possible product support for Jtest. If you have any trouble installing or using Jtest, please contact us in one of the ways listed below.
France
Tel: (33 1) 64 89 26 00 E-mail: [email protected]
Germany
Tel: +49 731 880309-0 E-mail: [email protected]
UK
Tel: +44 208 263 6005 E-mail: [email protected]
Asia
Tel: +886 2 6636-8090 E-mail: [email protected]
Other Locations
See http://www.parasoft.com/contacts.
20