【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

时间:2023-04-19 10:48:20

Preparations:

1. IDE : eclipse (my version is luna)

2. maven (my version is 3.5.0)

3. git

4. JAVA 1.7

Main Steps:

a. git clone WALA from GitHub : 

b. collect dependency (.class)

c. run the example

Follows are the steps to generate System Dependency Graph by WALA :

a. git clone WALA from GitHub : 

1. create a folder named “WALA_Test”, for me, its path is /Users/xubowen/Downloads/WALA_Test

2. open terminal, cd to the direction and execute git clone https://github.com/wala/WALA.git

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

3.import project to eclipse, you will see some errors. It’s ok, just skip it. We will fix it later.

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

Then, based on the https://github.com/wala/WALA/wiki/Getting-Started, we need to do some configurations for WALA:

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

From http://wala.sourceforge.net/wiki/index.php/UserGuide:Getting_Started, we can know how to configure the path of Wala.properties:

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

And configure the proper path of pdfview_exe and dot_ext, since sometimes the default settings are not correct.

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

b. collect dependency

You will notice that the project without bin folder, such as com.ibm.wala.core

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

1.check the stable version of WALA :

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

final, you will see :

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

After it, you will see a bin folder in the project :

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

c. run the example 

1.check launcher : PDFSDG.launch

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

check out the output sdg.pdf:

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

check it out : http://files.cnblogs.com/files/XBWer/sdg.pdf

check out the output dot file:

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

【IBM-WALA】Step by Step : use WALA to generate System Dependency Graph PDF and Dot File (Mac)

That’s all.

You can also run some other launchers to generate what you want.