Up: The DRE Project - The Tool

Using DRE v2.05 - Standard Mode

The Tool

The DRE Tool was initially created by Margie Price as part of the work for her dissertation in 1996. Since that first version, teams of undergraduate and graduate students have continued to develop, enhance, and solidify the DRE tool. Currently in version 2.05, the tool comes neatly packaged in a Java jar file and has the following requirements:

Help Topics

Click on a topic or scroll down to view the help information.

Working With Projects

DRE allows you to organize your work into Projects. A Project is defined as a grouping of source classes that constitute one application. A user of DRE can use Projects effectively by defining a series of classes and making all markings (generality and relation) on those classes. For future measurements of reuse potential, the user can then reopen the project, which has preserved the class contents and user markings.

When DRE begins, a new Project is automatically created. The user can added classes and make markings, and these actions are applied to this new Project (and are explained further in this help file). When the user believes that the Project definitions are relatively complete, he can save the current project by selecting "Save" from the "Project" drop-down menu, or by clicking on the floppy diskette icon. A "Save File" dialog appears, instructing the user to save the project file (defaulting to a standard projects directory).

Once Projects are saved, the user can retrieve them by selecting "Open" from the "Project" menu (or by clicking on the corresponding open-folder icon). Projects are stored in text-based files, with a filename consisting of the name of the project with the extension ".dre". Opening a Project automatically parses through the source files that are identified by the Project file, and any missing source files will be flagged to the user. The user can then run metrics or alter the contents of the opened Project. (NOTE that if the user makes changes to the Project contents, he MUST save the project again, using the procedure outlined above, or the changes will not be persistant.)

A few other actions are available for working with Projects. A user can create a new project by choosing "New" from the "Project" menu (or clicking on the blank-paper icon). Creating a new Project will reset DRE into the same state as starting the application for the first time. A user can close the current project (and open a new project) by choosing the "Close" command from the Project Menu. The user can also save the current Project definitions as another Project name by selecting "Save As".

Working With Source Files

DRE operates by parsing through source files and using user-defined generality and relation markings to create and classify the coupling lists that populate the reuse markings. Before any of this happens, however, the user must identify the source files that contain the classes that are to be parsed through. After a project has been opened (either the default, "new" project, or a previously-defined one), a user can add classes to it by selecting the plus icon. A "Select Source Files" dialog will appear, that allows the user to select the .java files that contain the classes that are to be measured for reuse potential. The source files are opened immediately, the contained classes identified and parsed, and the left-hand side Explorer Pane populated with the classes, contained in their associated packages.

In this image, the class "gui" has been previously added to this new Project. The user is currently in the process of adding the file "person.java" to the Project. DRE will parse through this file, and add class "person" to the Explorer Pane.

You can also remove classes from a Project. Select the project that you wish to remove from the project, and click on the minus icon on the ToolBar. This will remove the selected class from the project, ensuring that it is not part of any metrics that are run.

Setting Generality of Classes

The DRE requires that the user determine how general or specific his classes are. To this end, each class in the explorer pane should be set with some level of generality. By default, all classes are completely specific. To change the generality level of a class, simply right-click on that class. From the menu that pops up, highlight "Set Generality" and the available levels of generality are listed. Choose the appropriate level.

Setting Relationships Between Classes

In addition to setting generality levels, the user is required to define all relations that exist between classes. All relations are one-way markers, so that if two classes are supposed to be related completely to each other (both ways), then two separate relations must be created, A to B, and B to A.

To create relations, select one or more classes in the Project. Right-click, and choose "Relate To" to bring up the relation chooser dialog. This dialog consists of a drop-down list of all selected classes, and a checkbox panel that allows the user to select all possible destinations of the relations. To specify the relations for a particular class, choose that class in the drop-down list and select the checkbox next to each possible destination. Relations that have been defined previously can also be removed by unselecting the particular checkbox.

The action "Remove Relation" brings up the same dialog box, and allows the user to both remove and create relations in the same way. The one other "Relate All" action that appears on the context menu is a shortcut that creates a relation from the selected classes to each other class in the system. This relate-all function may be useful for specific classes that are related to a multitude of other classes (as a shortcut).

Calculate the Reusability Metrics

When all classes have been parsed, all generality levels have been set, and all relationships have been signalled, it is time to run the reusability metrics. To do so, click on the right-pointing arrow icon on the toolbar. All couplings will be counted and calculated, and the information will be on display in the right-hand side of the screen. Click on a particular element in the explorer pane to see its coupling information. The summary information is placed in the top summary table, showing the counts for each of the coupling types. The main panel displays the actual couplings. To view couplings of a particular type, select the type in the selection button at the bottom of the screen. The final choice, ALL TYPES, displays all of the couplings for the selected object. Note that the granularity extends upwards and downwards through the explorer pane objects, so that couplings can be viewed per package or per method as desired.

The entries of the explorer pane entries that are followed by a number sequence such as (X/Y) contain couplings. The Y value is the total number of couplings that belong to that entry (whether a class name/package name/method name/data member name). Bad couplings, those of Types II, III, and IV, are counted and signalled in the explorer pane as the X value, and by turning their containers' names to have a red font. In this way, a quick perusal of the explorer pane can alert the developer to bad couplings.

As a shortcut, the user can also click on a category in the summary table at the top of the application window to pull to the corresponding entries in the coupling table.

Simluate Changes

After the results of a metrics calculation, the user can identify possible changes that will increase the reusability potential of the classes in the system. The user selects an individual coupling from the center coupling panel. Right-clicking the mouse presents a context menu with all the possible changes that will improve that particular coupling. After the user has selected improvements for as many couplings as desired, he chooses the "Simulate" button on the lower control panel to recalculate the project's couplings after affecting the simulated changes. The original couplings still are accessible, but the lower row of the summary table is used to view the simulated results.

Run the Framework Analysis

Once a project has been specified and all generality/relation information has been specified, the DRE Framework analysis may be run to offer a better configuration of the system in order to meet reuse criteria. The "Framework Analysis" button on the main DRE window brings up the Framework analysis frame.

The left-hand portion of the analysis window describes the various options that are available for improving the reusability factors of the various couplings in the project.

The right-hand portion of the analysis window displays all couplings that exist between methods and classes. A value of 0 indicates no coupling exists. Any other numerical value displays the type of coupling that exists between the two nodes on the two axes of the table.

To run the Framework, the user must specify a coupling that he wishes to improve, and the option with which he wishes to improve it. If that particular combination of coupling and re-factoring option will indeed produce a reusability improvement, the ?p value will change from 0 to a positive improvement number. The option can then be activated by selecting the relevant control button. Alternatively, if the user does not care which improvement option is applied, he can select "Find the best option" and the application will determine the optimum option to apply to fix the couplings.

When Framework analysis is complete, the user can get a printout of all changes that are to be made to the system by selecting the appropriate button on the control panel.

Last Modified: 17 July 2002