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

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.

Note: The SQE plug-in for NetBeans IDE 6.0 is still under development likewise is NetBeans IDE 6.0. Therefore, there may be some stability issues or some functionality which may not be fully implemented. If any are discovered, please file an issue or bug at the SQE Project Issue Tracker.

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: 20 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:

  • NetBeans IDE 6.0 Beta 1 or later (download).

Notations Used in the Tutorial

  • <NETBEANS_HOME> - the NetBeans IDE installation directory.

Tutorial Exercises


Setup SQE for NetBeans 6

Potential Issues

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

  • Go to the file at <NETBEANS_HOME>\etc\netbeans.conf,
  • If the variable "netbeans_default_options" holds already the argument "-J-Xmx" then increase its value. Otherwise, insert the argument with a sample value. Be aware that the NetBeans 6.0 starter automatically sets the maximum heap size to 25% of installed memory if it is not explicitly specified. The variable might look then like this:
  • netbeans_default_options variable

    Installing SQE for NetBeans IDE 6.0

    First of all, in order to get the SQE plug-in it is necessary to specify where it can be downloaded from i.e. the update center. There are two ways to configure the update center:
    1. Manual: in settings, you type where the update center located is and then download it as well as the SQE plug-in itself,
    2. Automatic: You download and install the SQE update center module and then obtain the SQE plug-in that SQE update center made available for you.

    Installing SQE : Manually

  • From the menu choose Tools > Plugins,

    Menu Plugins

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

    Plugin Manager

  • 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.java.net/updatecenters/sqe/updates.xml
  • Update Center Customizer

  • Press OK to close the window.
  • If you don't want to install this plug-in for all users, unselect the "Install into shared directories" checkbox (at the bottom of the Plugin Manager window).By default it is selected. When installing into shared directory, the module is automatically installed in sqe1 directory.
  • Install into Shared Directory

  • Select the tab "Available Plugins" on the Plugin Manager window. In the left panel you should be able to see the following modules:
    • SQE Java,
    • SQE Platform,
    • SQE Update Center.
    Tip: type "sqe" in the search field to quickly locate these modules.
  • SQE Module

  • Check in the "install" checkbox for these 3 modules and press the "install" button.
  • Follow installation instructions. When the installation process succeeds, close the "Plugin Manager".
  • Now, the installation process is complete.

    Installing SQE : Automatically

    1. Download the SQE Update Center module (the one in charge of downloading and updating the SQE plug-in).You can get it from here.

  • From the menu choose Tools > Plugins,

    Menu Plugins

  • Now the Plugin Manager is open. Select the tab named "Downloaded" in there,
  • Press "Add Plugins" button and locate the downloaded plug-in,
  • Select the checkbox for SQE Update Center plug-in and press the "Install" button.

    Install SQE Update Center

  • Select the tab "Available Plugins" in Plugins window,
  • Select the install checkbox for the following modules,
    • SQE Java,
    • SQE Platform.

    Tip: type "sqe" in the search field to quickly locate these modules.

  • Press the "Install" button to install SQE plug-in.

    Install SQE Plug-in

  • Follow installer instructions. When the installation process succeeds, close the "Plugin Manager".
  • Now, the installation process is complete.

    Basics of SQE

    Where to Find SQE in NetBeans

    There are two ways to access the SQE tools:

  • Through toolbar icons,
  • SQE Toolbar

  • 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.

    SQE Result

    SQE Statistics

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

  • SQE History: shows found bugs per run and tool, (Window > Quality > SQE History)
  • SQE Codedefect Dashboard: shows harmfulness of bugs categorized 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:

  • From the menu choose: Tools > Options,
  • When the "Options" window shows up, click the "Quality" icon,
  • Options in SQE

  • Now click on the tool you want to configure and progress.
  • The configuration may be also set for projects (all NetBeans ant based java projects).

  • Right-click on a project,
  • From the popup menu choose "Properties" menu,
  • In the window "Project Properties" select the node "SQE",
  • In the main view shows up the configuration panel where you can modify setting according to your needs,
  • Project Properties

    Task List Integration

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

  • Select a project,
  • From the menu choose: Window > Task List,
  • Your project is now being scanned using SQE tools. The result will be displayed along with TODOs, warnings, etc. in the "Task List" window.

    SQE Tasklist Integration


    Using SQE

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

  • Select the project you want to be scanned with SQE tools,
  • 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,
  • 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.

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

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


    Summary

    In this tutorial you integrated the SQE plug-in in Netbeans 6 and learn basic steps how to use it.
    Terms of Use; Privacy Policy; Copyright ©2008-2012 (revision 20120430.2938d5f)
     
     
    Close
    loading
    Please Confirm
    Close