How to integrate and use Software Quality Environment (SQE) plug-in for NetBeans IDE 6.0

Contributed and maintained by Antoni Baran

Software Quality Environment is a project that provides NetBeans integration for software quality tools. Currently, the project includes:

To find out more on SQE project go on to the SQE home page.

This tutorial takes you through installing SQE plug-in in the NetBeans IDE 6.0 and shows you the basics of using its tools.

Expected duration: xxx minutes

Prerequisites

This tutorial assumes you have some basic knowledge of, or programming experience with the NetBeans IDE.

Software Needed for the Tutorial

Before you begin, you need to install the following software on your computer:

Notations Used in the Tutorial

Tutorial Exercises


Setup SQE for NetBeans 6

Memory Leaks

Scanning a project that contains substantial amount of classes might result in OutOfMemoryError exception. If this is the case, follow the steps below:

  1. Go to the file at <NETBEANS_HOME>\etc\netbeans.conf,
  2. If the variable "netbeans_default_options" holds already the argument "-J-Xmx" then increase its value. Otherwise, insert the argument with a sample value. The variable might look then like this:
  3. netbeans_default_options variable

Install Globally or Locally

The SQE plug-in can be installed globally (i.e. for all users) or just for one user. If you want to install the plug-in for one user, skip this section.

  1. If you have your NetBeans IDE running, shut it down for a moment.
  2. Create a directory named "sqe1" at the <NETBEANS_HOME>.Your SQE plug-in will be then installed in shared location (formerly known as global installation). After that step, the directory layout should look like this:

    Directory Layout

  3. Add the "sqe1" directory to the cluster list located at <NETBEANS_HOME>/etc/netbeans.clusters simply by adding it at the end of the list.

    Cluster List

  4. Now you can start up your NetBeans IDE.

Installing SQE for NetBeans IDE 6.0

In order to install SQE plug-in follow the steps:

  1. From the menu choose Tools > Plugins,

    Menu Plugins

  2. Now the Plugin Manager is open. Select the last tab named "Settings" to add another Update Center.
  3. Press the button "Add" located on the right side to insert new entry.

    Plugin Manager

  4. When the window "Update Center Customizer" shows up, enter the following data:

    • in the field "Name" enter: SQE
    • in the field "URL" enter: https://sqe.dev.java.net/updatecenters/sqe/catalog.xml
    • Update Center Customizer

  5. Press OK to close the window.
  6. If you are installing the plug-in globally, select the "Install into shared directories" checkbox (at the bottom of the Plugin Manager window).
  7. Install into Shared Directory

  8. Select the "New Plugins" tab on the Plugin Manager window. In the left panel you should be able to see the module "Software Quality Environment(SQE)".
  9. SQE Module

  10. Check in the "install" checkbox and press the "install" button.
  11. When the installation process succeeds, close the "Plugin Manager".
After successful installation, you will have additional SQE tools toolbar. The icons stand for (from the left) Dependency Finder, SQE (runs all SQE tools), FindBugs, PMD, CheckStyle.

SQE Toolbar

Basics of SQE

Where to Find SQE in NetBeans

There are two ways to access the SQE tools:

  1. Through toolbar icons
  2. Through context menu on a project: SQE > CodeDefects > Check Quality

SQE Access

Where to Find SQE Results

The output after running SQE tools is printed in the "SQE Result" window. Inside, you can specify for which quality tool you want to see the results (provider combo box). Then, in the area "Result" bugs and underneath its locations in classes are listed. On the right side of the window, you can see bugs explanation and suggestions for improvements. On the left side of the window, you can find refresh options as well as display preferences.

Palette

SQE Statistics

Besides the "SQE Result" window, there are two additional windows provided by the SQE plug-in. It is:

  1. SQE History: shows found bugs per run and tool, (Window > Quality > SQE History)
  2. SQE Codedefect Dashboard: shows harmfulness of bugs categoriezed into 3 groups (Window > Quality > SQE Codedefect Dashboard).
All of SQE windows can be accessed from the menu Window > Quality ...

SQE Windows Access

Configuration of SQE Tools

Quality tools that SQE consist of may be configured (bug patterns, bug detectors). In order to do that:

  1. From the menu choose: Tools > Options,
  2. When the "Options" window shows up, click the "Quality" icon,
  3. + here comes a screenshot

  4. Now click on the tool you want to configure and progress.

Task List Integration

SQE is also integrated into the "Task List" window.

  1. Select a project,
  2. From the menu choose: Window > Task List,
  3. + here comes a screenshot


Using SQE

Important Notice: make sure your code has been newly compiled because FindBugs analysis is conducted on bytecode.

  1. Select the project you want to be scanned with SQE tools,
  2. Now you have got two options:
    • If you want to scan your code using all of the SQE tools:
      • press the "Check Quality" icon on the SQE toolbar,
      • or

      • choose from the context menu SQE > CodeDefects > Check Quality,
      • SQE Check Quality

    • If you want to scan your code using one of the SQE tools choose the tool you want to from the SQE toolbar or from the context menu SQE > CodeDefects >....

Depending on your choice, now the SQE tools or tool are scanning your code. When it is finished, we can analyze the report.

  1. Go to the "SQE Result" window (pops up automatically when scanning),
  2. Click on the result and then on the class name beneath,
  3. On the right side of the window bug or improvement suggestion appears,
  4. SQE Results

  5. Double-click on the class name navigates you to the class,
  6. If you chose "Check Quality" option (all SQE tools) , change the provider and review its results too.
  7. SQE Tools Combobox


Summary

In this tutorial you integreted the SQE plug-in in Netbeans 6 and learn basic steps how to use it.