Prism User Guide

Charles Zhang, Helen Shi and Hans-Arno Jacobsen
Department of Electrical and Computer Engineering

Middleware Systems Research Group, Department of Computer Science
 
University of Toronto

Overview

Prism is a plug-in for Eclipse. Prism developed by MSRG at University of Toronto. It is designed to provide powerful and easy-to-use pattern recognition for aspect mining of large projects, typically consisting of hundreds or thousands of classes. The current version is 0.1 BETA

 

Typical tasks that the Prism can well perform are:

Match language patterns: lexical pattern(regular expression), usage of types and combinations of both. 

 

The mechanism of the Prism is centred on profile-based mining. A mining profile can be considered as an analysis task for a certain interest. It consists of a task, a fingerprint and a footprint set. The following explains those sub-elements.

 

Task

A customizable assembly of Prism fingerprints which represents a more complex pattern.

 

Fingerprint

A pattern definition specified by the user.

 

Footprint

An encapsulation of the location information of a particular fingerprint.

 

How to use it?

Prism is simple and straightforward to use. The following illustrates how to use the tool.

 

Step 1: Open Prism Eclipse Plug-in

 

Start Eclipse. Select Window->Open Perspective->Prism.

 

You will see your projects in Project View. If you don’t have any project  in Eclipse, you can click Navigator view to import your project as a java project and then re-open the Prism perspective.

 

Step 2: Load project

 

Double click on the project or click the right button on mouse, select “Load Project”. You will see a progress bar showing loading project status, like follows

 

  

Step 3: Create your first fingerprint

 

Right click on fingerprint view, select New on menu. A fingerprint dialog will allows you to fill in the details of a fingerprint. You can define the fingerprint name, the set of type patterns and a list of regular expressions. You can select types from type browser or type in the class type/regular expression with following rules :

1.                  “,” as separator between signatures;

2.                  * means match any class or method name, “..” matches all parameters in the type, like java.util.*.*(..);

3.                  use “;” separator parameters.

Clicking the “Add” button will add the type/regular expression into their list. Add a wrong one? Then click on the type/expression you don’t want, right click on mouse, select “delete” from menu.

 



 Click save, your first fingerprint is created. Then you can edit the fingerprint or delete it by select the fingerprint, click right button on mouse, then select “edit” or “delete”.

 

Step 4 Create a task

 

Click on task view then click right button on mouse, select “New” on menu.  A task dialog will allows you to fill in the details of a task.

 

The Include/Exclude panel is used to specify parts of the project code space to inspect.  From the type browser fired by clicking “Add” button, you can add the Include/Exclude into the lists. Same as Fingerpint, click “Browse…” button at Fingerprint group, a fingerprint list will popup, you can select fingerprint from the list. In this example, you can see the fingerprint you just created. Also if you know fiingprints name, you can them type in. Fingerprints can be combined together with following rules:

1.                  “,” and “||” means OR relationship between fingerprints;

2.                  “&&” means AND relationship between fingerprints.

Don’t forget click “Add” button to add all fingerprints to the list.

If you add a wrong include/exclude or fingerprint, select the one you don’t want, right click on mouse, select “delete” from menu.

Click save button at the bottom after you fill all information.

 

Step 5. Run selected task

 

After saving the task, we come back to the Prism task view, where the “hashtable” task we have just created appears as an entry like the following:

 

 

Via the “Run” command on the popup menu, we can ask the tool to process the task.

 

Step 6. Checking the result

 

Upon completion of processing, the running result will show in Footprint view. The following is a snapshot of the result of the mining. It can show all footprints, degree of scattering and scattering ranking of current task by select the option in the pull down menu on action bar.

 

 

 

Double click on any footprint, the corresponding class will open in java editor at the bottom of perspective. And the line will be highlighted, a mark and a hover will created.