Right click the Java file or Java project in the navigator or package explorer window in Eclipse and choose either Indus -> Slice Java file or Indus -> Slice project from the context menu. The difference is that in the former only the specified file is sliced while in the latter all the files present in the Java project are sliced.
In the slice configuration dialog that appears, pick the slice configuration and the criteria for slicing. The Additive slice display check box indicates that the new slice should be added onto the display of the previous slice. This displays the slice as the union of the previous and the new slice.
Press the Run button to start the slicing. A progress dialog indicates the progress of the slicing. After the slice is completed, open the Java file if it is not currently open. If the Kaveri decorator is enabled (Refer to Figure 10 ) the slice is automatically highlighted. Else press the Slice Toggle button (Refer to Figure 9) to highlight the slice in the editor. There are two types of highlighting that are displayed. Java statements for which all the corresponding Jimple statements have the slice tag are highlighted in once color while those in which only a part of the Jimple statements have the slice tag are highlighted in a different color. To change the color for the slice highlighting go to Window -> Preferences -> Workbench -> Editors -> Annotations from the Eclipse menu and change the color for the ' IndusSliceAnnotation for the complete slice element highlight annotation and IndusPartialSliceAnnotation for the partial slice element highlight annotation. You may have to reopen the file in the editor and toggle the slice highlight for the change in color to be updated.
Please note that in this version of Kaveri, the soot environment is not reset for performance reasons. This means that when a slice has been performed on a project, the contents of the project should not be changed until Eclipse is closed. Doing so, may lead to incorrect slice displays. For example, if among two consecutive statements 'a' and 'b', only 'a' has the slice highlight and the statements are interchanged; then, on performing the same slice operation, 'b' will be tagged with the slice highlight meant for 'a'. Thus, it is necessary that the project contents remain unchanged after using the slice on a project. If any changes are made, please press the reset toolbar button and then perform a new slice on the changed code.