Project Status

 

AMT is no longer in active development.

 

Introduction

 

Contemporary modularization techniques such as OOP, although helpful, often fail to encapsulate design decisions that crosscut the module structure. Code related to one crosscutting concern is often tangled with other code and spread out over a number of different classes. Capturing these concerns in first-order modules (Aspects) can increase the code’s modularity significantly. Consequently, many programmers find the idea of Aspect Oriented Programming (AOP) appealing but don’t know where to start: As the module structure is crosscut by these concerns, many modules have to be considered together to identify and extract Aspects.

 

The Aspect Mining Tool (AMT) provides an open multi-modal analysis framework for concern identification and system understanding. AMT offers lexical and type-based analysis techniques.

 

About the Current Version

 

This version was made public on October 29, 2001. AMT offers two analysis techniques to search for possible Aspects. More methods of analysis are possible, but since development for AMT has stopped, it is at this point unlikely that they will be added. The two implemented methods can be combined for better results:

 

  • Lexical (text-based) Analysis - This offers simple pattern matching
  • Type-Based Analysis - With type-based analysis, code tangling can be detected and modularity quality measures as coherence and coupling of the code can be visualized

 

This version of AMT is based on the AspectJ compiler for AspectJ 0.8b4. Consequently, it is suitable to analyze both plain Java systems an systems that use AspectJ constructs introduced up to and before AJC version 0.8b4. The following changes have been made:

 

Known problems

 

  • Very rarely there are naming conflicts when AspectJ is installed on the same machine. This will be solved in the next release.

 

Known limitations

 

  • For the type-based analysis we consider only 1st class objects. Primitive types (int, boolean, void, etc.) are intentionally ignored to keep the system simple.
  • Inheritance hierarchies are currently not taken into account for type-based analysis. I.e., a search for a specific type won't find sub- and superclasses of that type yet; AMT uses exact type matching
  • This version of AMT requires Java JDK1.3, and will not work with JDK 1.4 or higher. This is due to limitations of the AspectJ compiler core

 

How it works

 

AMT consists of two rather independent programs: the analyzer and the visualizer. 

 

  • The Analyzer - The analyzer uses a modified version of the AspectJ compiler as it's core. It is responsible to extract all necessary line-oriented program statistics (currently: source code and types used) and other information (currently: package and class hierarchy information). All extracted information is written to a data file.
  • The Visualizer - The data file created above is used by the visualizer to display a line-based view of the system (i.e. compilation units as collections of lines of code). It allows to query the system database (created by the visualizer from the data file) interactively. Currently, AMT supports the following kinds of queries: substring matching and regular expressions (lexical), and types used (structural). Since the line-oriented view of AMT is a "flat" one (no hierarchy information), class and package hierarchies are created that allow for additional orientation.

 

Download

 

Please keep in mind that AMT requires Java JDK 1.3. The latest version (version 0.6a) on AMT can be downloaded here:

 

 

If you are using AMT, please take the time to provide us with some feedback on your experiences with the tool. See below for contact information. 

 

Installation

 

You must have Java 2 SDK v1.3 installed to install and use AMT. Newer versions will not work (see known limitations above). The SDK can be downloaded from Sun's Java 2 SDK web page. You can find the SDK1.3 here. To install the Aspect Mining Tool, follow these three easy steps:

 

  1. Download the JAR file and extract it (AMT0.6a.jar) into a directory of your choice. [example: c:\amt]
  2. Make sure your CLASSPATH starts with the following (without quotes): ".;c:\jdk1.3\jre\lib\rt.jar;c:\jdk1.3\lib\tools.jar". This assumes your Javadirectory is "c:\jdk1.3"; adjust if you installed Java into a different directory.
  3. Add the downloaded JAR file AMT0.6a.jar to your CLASSPATH. It should be the first statement in the path if you also have AspectJ installed, otherwise it can go anywhere. Make sure you provide the right directory (the one you saved the JAR file to). [example: c:\amt\AMT0.6a.jar] AMT should be ready to run now.

 

Usage

 

In order to use the Aspect Mining Tool, you have to do two things: First, you have to let the AMTAnalyzer analyze your program sources. This step extracts all the lexical and structural information that the tool needs and writes it to a file. This step has to be performed only once. After that, you can display the collected data by loading the data file into the AMTVisualizer.

 

Step 1: Data Extraction (AMTAnalyzer)

 

To generate the type information for your project, it is necessary that the whole project is analyzed simultaneously. The extracted data will be written into a single file. Note that the analyzer does not ask for confirmation if the selected file already exists and will simply overwrite it. You can specify the name of the AMT data file created by adding the -outfile <file> option to the analyzer calls below. Otherwise, the analyzer will use a default file name (AMTResults.amt). Call the analyzer like this to analyze your sources:

 

  • java AMT.analyzer.AMTAnalyzer -argfile yourProject.lst

 

This assumes that you want reuse your project's argfile (.lst file) to analyze your sources. If you do not have an argfile (or if you do not know what an argfile is), you need to list all the project files specifically, e.g.:

 

  • java AMT.analyzer.AMTAnalyzer /project_part_1/*.java /project_part_2/*.java ...

     

Step 2: Data Visualization (AMTVisualizer)

 

After the project is analyzed, you can open the the visualizer GUI by typing:

 

  • java AMT.visualizer.AMTVisualizer <AMT data file>

 

For very large projects, reading the data file may take a few seconds, so please be patient.

 

Using AMT to analyze and display your system is easy. The visualizer is rather self-expanatory and all GUI components have tooltip text as a further aid. Once the type and line information from your sources is extracted, you can start the GUI. This is approximately what you will see:

 

 

These are the GUI components: 

 

Component Functionality
Menu Bar File: Load and change the current data file (not yet implemented)
Settings: Load/Store/Reset your current search
Classes: Adjust display options of the class representations (width and spacing) or mask out lines unaffected by the current search criteria.
Lines: Adjust display settings for line representation (height and spacing)
Help: Display the helpfile and about AMT information
Settings Buttons Here you can load, save, and reset your favorite search settings
RegExpr Button This button will turn regular expressions for the lexical analysis on and off. If regular expressions are enabled, the Visualizer will be slowed down a bit by the extra computations needed for the pattern matching algorithms. If regular expressions are disabled, all lexical searches will be interpreted in a substring-matching manner instead
Mask Button By clicking on this button, you can mask out all classes that do not match your current search criteria
Class Representations In this scroll panel, you can see a graphical representation of your classes (compilation units). Each class is shown as a rectangle made of horizontal strips. Each of these strips represents a line of source code (without comments)
Mouse Pointer By placing the mouse pointer over a compilation unit, you can get information about the CU's name, and the current line (see Current Position Indicator below). Not shown in the figure above.
Current Position Indicator In this row you can see the name of the current CU, the number of the current line and the line itself (without comments and leading whitespaces). "current" refers to you mouse pointer position (see above)
Color Selectors These pull-down menus offer choices for how to color lines that match you searches
Multi-Modal Search Fields These pull-down menus contain all types used in your system. By selecting one, the system finds (and marks, with the appropriate color) all lines that use that type. If you type in a search string, it is treated as an expression and all lines are colored that contain this expression
Mode Indicators These non-editable fileds show whether a search field displays a type name or an expression
Context Menu (not shown) By right-clicking on one of the compilation units, a context menu is displayed:
CU: Shows the name on the selected compilation unit. This menu item is inactive
Show Original Source: Displays the source file as it was written
Show Purified Source: Displays the source without comments or empty lines (the way AMT views sources)
Show Help: Displays the help file. It contains information about known limitations of AMT and changes made in the last updates
Hierarchy Panels These panels display the class and package hierarchy of the system. Right-clicking on a class in one of the hierarchies allows you to add/remove that class to/from the workspace. It is also possible to select whole subtrees of the hierarchy in this matter

 

Example Usage

 

 

As an example to see how AMT works, it will be used to analyze and display the AspectJ compiler part of itself. The compiler conveniently comes with an argfile that can be used by AMT. To try this example, make sure you have set up the tool correctly as described in the installation section above. Also make sure that you are in the src directory of AMT. The argfile ajc.lst can be replaced by any other argfile, if desired. If you are working with a computer where insufficient memory can be an issue, try one of the other argfiles.

 

Step 1: Analyzing the system

 

java AMT.analyzer.AMTAnalyzer -argfile ajc.lst -outfile example

 

Step 2: Visualizing the results

java AMT.visualizer.AMTVisualizer

 

This will bring up the AMTVisualizer. Now select the proper data file (named example.amt) and AMT will display all compilation units belonging to the system. Happy investigating!

 

Publications

 

  • Overcoming the Prevalent Decomposition of Legacy Code, Hannemann, J. and Kiczales, G., Workshop on Advanced Separation of Concerns at the International Conference on Software Engineering (ICSE) 2001 in Toronto.

 

Contact

 

Please note that AMT is no longer in active development. Questions realted to running AMT in other configurations than the one described above can not be answered. Please send all other questions, suggestions, bug reports, etc. to the contact address on the main page of this Wiki.

 

 

 


 

Last updated: 2007/10/16;


Page Information

  • 10 months ago [history]
  • View page source
  • You're not logged in
  • No tags yet learn more

Wiki Information

Recent PBwiki Blog Posts