Indexing Workspace
It's time to create our first program graph (index)! Remember a program graph is an abstraction to represent the essential aspects of a program's syntax and semantics (structure, control flow, and data flow), which are required to reason about software. Atlas uses a heterogeneous, attributed, directed graph data structure, which will become clear as we progress through upcoming tutorials.
For this tutorial series we have created a few simple projects to get you started learning Atlas. The Eclipse projects are available on Github at https://github.com/EnSoftCorp/LearningAtlas. Clone a copy of the repository by running the following command on your command line.
git clone https://github.com/EnSoftCorp/LearningAtlas.git
If you need to install Git on your system visit http://git-scm.com/downloads. Alternatively you could download a zip file of the latest LearningAtlas repository archive here https://github.com/EnSoftCorp/LearningAtlas/archive/master.zip.
Contents
Step 1) Create/Import Projects to Index
Import an Eclipse Java project into the workspace by navigating to File
> Import
> General
> Existing Projects into Workspace
and browsing to an existing project. If the project is a zip archive, you will want to check the Select archive file
radio button, otherwise check the Select root directory
radio button.
Alternatively you could create a new Java project by navigating to File
> New
> Java Project
and creating a new Java project. If you create a new Java project, you will want to add some Java code so you have something to index and analyze.
For this tutorial import the HelloWorld
project you just downloaded into the Eclipse workspace.
Step 2) Set Indexing Preferences
If you haven't already check your Indexing Preferences. For this tutorial let's use the Index only used classes in jars
indexing option.
Step 3) Select Projects to Index
Atlas will index any open projects in the Eclipse workspace that you have selected for indexing. To select and deselect projects for indexing navigate to Atlas
> Manage Project Settings
. The Do no index pane on the left lists projects that will not be indexed, and the Index pane on the right lists projects you wish to have indexed. Be mindful of your analysis task and include any necessary dependent projects and exclude projects you don't need or projects that should not be analyzed (ex: projects with analysis utilities you will use during your analysis).
In this tutorial, make sure the HelloWorld
project is selected for indexing. The screenshot below shows that some additional projects (the toolbox.analysis
and toolbox.shell
projects) will not be indexed, but the HelloWorld
project will be indexed. Note that Atlas conveniently provides a memory estimate for the projects you are about to index. If you need adjust your Eclipse Memory Settings to accommodate the size of the index (program graph), then you should do so now.
Step 4) Run Indexer
TODO
Step 5) Perform Analysis
TODO