AMT is no longer in active development.
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.
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:
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:
AMT consists of two rather independent programs: the analyzer and the visualizer.
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.
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:
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.
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:
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.:
After the project is analyzed, you can open the the visualizer GUI by typing:
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 |
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.
java AMT.analyzer.AMTAnalyzer -argfile ajc.lst -outfile example
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!
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
|
Wiki Information |
Recent PBwiki Blog Posts |