Using IBM Wala’s Slicer for CSCI578 HW3

Slides:



Advertisements
Similar presentations
The map and reduce functions in MapReduce are easy to test in isolation, which is a consequence of their functional style. For known inputs, they produce.
Advertisements

Developing in CAS. Why? As distributed you edit CAS 3 with Eclipse and build with Maven 2 – Best Practice for Release Engineering – Difficult edit-debug.
1 eclipse Tips. 2 What is eclipse? Eclipse is a popular IDE (Integrated Development Environment) that we will use to create, compile, execute, and test.
Developing CAS in Eclipse
Georgia Institute of Technology DrJava Appendix A Barb Ericson Georgia Institute of Technology May 2006.
Get android development environment running. Install – Get and install JDK 5 or 6 (see link in the.
MC365 Ant. Today We Will Cover: Overview of Ant Installing Ant Using the Ant command line tool Various Ant commands available Using Ant in Eclipse.
Integrated Development Environments. Today We Will: Go over more advanced functionality of Eclipse. Break up into teams to work on presentation and final.
20-Jun-15 Eclipse. Most slides from: 2 About IDEs An IDE is an Integrated Development Environment.
Eclipse Introduction Dwight Deugo Nesa Matic
INF 123: Software Architectures, Distributed Systems, and Interoperability Discussion Session Week 1 - Spring 2008 Instructor: Prof. Richard N. Taylor.
03 Using Eclipse. 2 IDE Overview An IDE is an Interactive Development Environment Different IDEs meet different needs BlueJ and DrJava are designed as.
Introduction to Eclipse. Overview Eclipse Background Obtaining and Installing Eclipse Creating a Workspaces / Projects Creating Classes Compiling and.
JSP and Servlets Lecture notes by Theodoros Anagnostopoulos.
A First Program Using C#
1 eclipse Tips. 2 What is eclipse? Eclipse is a popular IDE (Integrated Development Environment) that we will use to create, compile, execute, and test.
Using Eclipse. What is Eclipse? The Eclipse Platform is an open source IDE (Integrated Development Environment), created by IBM for developing Java programs.
Introduction to Android. Android as a system, is a java based operating system that runs on the Linux kernel. The system is very lightweight and full.
© 2005 Pearson Education, Inc., Upper Saddle River, NJ. All rights reserved. Data Structures for Java William H. Ford William R. Topp Appendix E The EZJava.
ITEC 370 Lecture 14 Implementation. Review Questions? Draft of design document on F Brief 3-5 minute work update on F (will continue except for mid-term)
Plug-in Development Environment. Session Outline Tools Installation Configuration New Project Basic Debugging Remote Debugging.
SENG 301 – Tutorial 1 Introduction to Eclipse, Subclipse, and JUnit Slides: Theodore D. Hellmann.
INF 123: Software Architectures, Distributed Systems, and Interoperability Discussion Session Week 1 - Spring 2008 Instructor: Prof. Richard N. Taylor.
CPSC1301 Computer Science 1 Overview of Dr. Java.
Introduction to Eclipse CSC 216 Lecture 3 Ed Gehringer Using (with permission) slides developed by— Dwight Deugo Nesa Matic
JCreator Tonga Institute of Higher Education. Programming with the command line and notepad is difficult. DOS disadvantages  User Interface (UI) is not.
Eclipse Eclipse An IDE is an Integrated Development Environment Different IDEs meet different needs – BlueJ, DrJava are designed as teaching.
Creating and running a Java program. Eclipse Interactive Development Environment (IDE)  Eclipse is an Interactive Development Environment (IDE) for Java.
9/2/ CS171 -Math & Computer Science Department at Emory University.
Android Development Environment Environment/tools Windows Eclipse IDE for Java Developers (v3.5 Galileo) Java Platform (JDK 6 Update 18) Android.
Topic Java EE installation (Eclipse, glassfish, etc.) Eclipse configuration for EE Creating a Java Web Dynamic Project Creating your first servlet.
Level 1 Tutorial Project How to put a movie player on your Weebly website using an HTML code.
1 Getting Started with C++. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Visual Studio 2008.
Managed by UT-Battelle for the Department of Energy Kay Kasemir ORNL/SNS 2011, October at CEA Saclay, France Control System Studio.
Version Control CSC 517 John Slankas. Version Control Managing files and directories, and the changes made to them over time. - Adapted from “Version.
ECE 122 Feb. 1, Introduction to Eclipse Java Statements Declaration Assignment Method calls.
Using This PowerPoint This PowerPoint presentation assumes your Computer Science teacher has provided you with the InstallingJava folder, which contains.
Surya Bahadur Kathayat Outline  Ramses  Installing Ramses  Ramses Perspective (Views and Editors)  Importing/Exporting Example.
1 Installing Java on Your PC. Installing Java To develop Java programs on your PC: Install JDK (Java Development Kit) Add the directory where JDK was.
Introduction to Eclipse Programming with an Integrated Development Environment.
Loader Tutorial Set Up. Requirements Java 7 Eclipse IvyIDE plugin Git Optional: Ant Maven.
TOOLS FOR DESIGN AND DEVELOPMENT ENVIRONMENTS. Case study - ECLIPSE Lecture notes 5.
Time to apply stuff… Faculty of Mathematics and Physics Charles University in Prague 5 th October 2015 Workshop 1 – Java Wrestling.
Eclipse 27-Apr-17.
Netbeans QuickStart. Creating a project File->New Project –For now you want General->Java Application –Then fill in the project details.
Editing and Debugging Mumps with VistA and the Eclipse IDE Joel L. Ivey, Ph.D. Dept. of Veteran Affairs OI&T, Veterans Health IT Infrastructure & Security.
Java IDE Dwight Deugo Nesa Matic
Development of the EDEX plug-in Ingest overview Manual Endpoint LDM DistributionSrv Plugin decoder Plugin Data Object PersistIndexSrv NotificationSrv.
ML-Dev: SML Plug-in for Eclipse Yevgeniy Bangiyev 02/07/07 Yevgeniy Bangiyev 02/07/07.
Debugging RTC CLI in Eclipse
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Introduction to Eclipse
ATS Application Programming: Java Programming
Appendix A Barb Ericson Georgia Institute of Technology May 2006
Java on the LEGO Mindstorms EV3
SENG 301 – Tutorial 1 Introduction to Eclipse, Subclipse, and JUnit
Eclipse Navigation & Usage.
Setting up Eclipse Locally
Install Ruby If you are running on Mac OS X, Ruby is preinstalled.
How to Run a Java Program
JavaTeaching and Importing a github repository
JCreator Settings Only
Using Eclipse.
CSCI N207 Data Analysis Using Spreadsheet
Java IDE Dwight Deugo Nesa Matic Portions of the notes for this lecture include excerpts from.
CMPE212 – Reminders Assignment 2 due today, 7pm.
Printing Interim Reports
Workshop for Programming And Systems Management Teachers
Presentation transcript:

Using IBM Wala’s Slicer for CSCI578 HW3 By Joshua Garcia

Some Requirements Eclipse IDE SVN or Git Plugin for Eclipse (e.g. Subclipse at http://subclipse.tigris.org/)

Getting the IBM Wala code Check out all com.ibm.wala* projects form the trunk of the repository EXCEPT for com.ibm.wala.core.tests Import com.ibm.wala.core.tests from the zip file we provide Reference A more general guide to starting with Wala: http://wala.sourceforge.net/wiki/index.php/UserGuide:Getting_Started

Possible Building Problems Some of the projects will have errors. I have errors in the following Wala projects: com.ibm.wala.cast.js.rhino.test com.ibm.wala.cast.js.test com.ibm.wala.ide.jsdt com.ibm.wala.ide.tests However, you won’t be using all the code so it shouldn’t be a problem However, you should set your JDK compiler compliance level to 1.6 Click Window -> Preferences Java -> Compiler Set Compiler compliance level to 1.6

Configuring Properties Files Go to this page: http://wala.sourceforge.net/wiki/index.php/UserGuide:Getting_Started Follow the section called “Configuring WALA properties” Wait there’s more and it’s IMPORTANT – You need to set some properties in dat/wala.examples.properties as well Just copy the wala.example.properties.sample file and rename it

A Little About Slicing Before We Continue Given a statement and a subset of its variables, you can perform forward or backward slicing A slice is a set of statements that affect or are affected by the selected statement Forward slicing gives you the statements affected by your selected statement Backward slicing gives you the statements that affect the given statement

More on slicing, If You Are Interested http://www.grammatech.com/research/papers/slicing/slicingWhitepaper.html http://en.wikipedia.org/wiki/Program_slicing

Time To Slice Some Programs You should be able to run our customized PDFSliceMod drivers There are three launcher configuration you can modify and run as needed (one for each DEB application): PDFSliceMod KLAX PDFSliceMod specjms from stmts file PDFSliceMod stoxx Simple way to get to these launcher configurations Click Run -> Run Configurations Under Java Application select the appropriate launcher configuration

Customizing the launcher configuration The launcher configuration takes a few arguments You can see these arguments from the Arguments tab of the launcher configuration For example, for PDFSliceMod KLAX, here are the arguments -appJar ${workspace_loc}/com.ibm.wala.core.tests/apps/c2fw-original.jar -sliceCritFiles "${workspace_loc}/com.ibm.wala.core.tests/c2fw-mda-task0-search-deps-stmts.txt" -dd "no_base_no_heap" -cd "none" -dir "backwards" -pkgIncludes "Lc2/apps/klax" The arguments and what they do appJar, the jar of the DEB application (no need to change it) srcCaller, the method you will create the slice from sliceCritFiles, file name of the file containing the input statements to the slicer dir, “forward” or “backward” slice pkgIncludes, which packages to analyze and show for output For the remaining options take a look at http://wala.sourceforge.net/wiki/index.php/UserGuide:Slicer You may not need to change dd or cd, unless you think it will give you more accurate results Changing dd or cd can make your program running for a very long time A slicer on our DEB applications can take minutes to run

Understanding the console output The slicer’s analysis starts from entry points in your program, which are set to all the methods of your selected class One statement can be broken up into multiple IR statements. For example line 70 of KLAX’s ChuteArtist class is made up of these statements (and some null statements): 70 18 = invokevirtual < Application, Lc2/fw/Notification, getParameter(Ljava/lang/String;)Ljava/lang/Object; > 2,16 @22 exception:17 70 19 = checkcast <Application,Ljava/lang/Integer>18 <Application,Ljava/lang/Integer> 70 21 = invokevirtual < Application, Ljava/lang/Integer, intValue()I > 19 @28 exception:20

More on console output You get the statements of the slice and corresponding line numbers (if applicable): Printing slice with node number and line number: SLICE: 1, -1 NORMAL_RET_CALLER:Node: < Application, Lc2/apps/klax/comp/ChuteArtist, handle(Lc2/fw/Notification;)V > Context: Everywhere[1]5 = invokevirtual < Application, Lc2/fw/Notification, name()Ljava/lang/String; > 2 @1 exception:4 2, 66 NORMAL handle:8 = invokevirtual < Application, Ljava/lang/String, equals(Ljava/lang/Object;)Z > 5,6 @8 exception:7 Node: < Application, Lc2/apps/klax/comp/ChuteArtist, handle(Lc2/fw/Notification;)V > Context: Everywhere 3, -1 PARAM_CALLER:Node: < Application, Lc2/apps/klax/comp/ChuteArtist, handle(Lc2/fw/Notification;)V > Context: Everywhere[5]8 = invokevirtual < Application, Ljava/lang/String, equals(Ljava/lang/Object;)Z > 5,6 @8 exception:7 v5 4, 74 NORMAL handle:12 = invokevirtual < Application, Ljava/lang/String, equals(Ljava/lang/Object;)Z > 5,10 @56 exception:11 Node: < Application, Lc2/apps/klax/comp/ChuteArtist, handle(Lc2/fw/Notification;)V > Context: Everywhere 5, -1 PARAM_CALLER:Node: < Application, Lc2/apps/klax/comp/ChuteArtist, handle(Lc2/fw/Notification;)V > Context: Everywhere[29]12 = invokevirtual < Application, Ljava/lang/String, equals(Ljava/lang/Object;)Z > 5,10 @56 exception:11 v5 Node 2 corresponds to line 66 of ChuteArtist Some IR statements have no corresponding line number Node Numbers

How to read your slice Class Name Line No. Printing slice with selected statements only: Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH:306 NORMAL handleMessage:4 = instanceof 2 <Application,Ljavax/jms/TextMessage> Node: < Application, Log/spec/jms/eventhandler/sp/SP_CallForOffersEH, handleMessage(Ljavax/jms/Message;)V > Context: Everywhere Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH:306 NORMAL handleMessage:conditional branch(eq) 4,5 Node: < Application, Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH, handleMessage(Ljavax/jms/Message;)V > Context: Everywhere Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH:308 NORMAL handleMessage:19 = checkcast <Application,Ljavax/jms/TextMessage>2 <Application,Ljavax/jms/TextMessage> Node: < Application, Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH, handleMessage(Ljavax/jms/Message;)V > Context: Everywhere Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH:308 NORMAL handleMessage:21 = invokeinterface < Application, Ljavax/jms/TextMessage, getText()Ljava/lang/String; > 19 @12 exception:20 Node: < Application, Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH, handleMessage(Ljavax/jms/Message;)V > Context: Everywhere Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH:308 NORMAL handleMessage:invokevirtual < Application, Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH, parseMessage(Ljava/lang/String;)V > 1,21 @17 exception:22 Node: < Application, Lorg/spec/jms/eventhandler/sp/SP_CallForOffersEH, handleMessage(Ljavax/jms/Message;)V > Context: Everywhere Class Name Line No.

More Stuff You Might Need to Know How slices map to line numbers: http://wala.sourceforge.net/wiki/index.php/UserGuide:MappingToSourceCode#From_Slices_to_source_line_numbers Understanding the IR: http://wala.sourceforge.net/wiki/index.php/UserGuide:IR

Eclipse’s Reference-finding Feature Right click on method, variable, class, etc. Select References -> Project, Hierarchy, Workspace, or Working Set You get list of references to your selection Or simply highlight the method, variable, class etc. Press Ctrl+Shift+G