CIS895: Bogor - Environment for Vision Document V2.0 November 3, 2005

PROJECT: BOGOR-JAVA ENVIRONMENT FOR ECLIPSE

DELIVERABLE: VISION DOCUMENT

Version: 2.0 Date: November 3, 2005

Prepared by: Yong Peng Major Professor: Robby Kansas State University

1 CIS895: Bogor - Java Environment for Eclipse Vision Document V2.0 November 3, 2005

Table of Content

1. INTRODUCTION ...... 3 1.1. BACKGROUND ...... 3 1.2. MOTIVATION ...... 3 2. PROJECT OVERVIEW ...... 3 2.1. INTRODUCTION ...... 3 2.2. GOAL ...... 4 2.3. PURPOSE ...... 4 3. REQUIREMENTS SPECIFICATION ...... 4 3.1. USE CASE 1: I NCREMENTAL COMPILATION ...... 5 3.1.1. SR1.1 (Critical requirement) - Incremental Compilation ...... 6 3.1.2. SR1.2 (Critical requirement) – Add a new nature into Java project ...... 6 3.2. USE CASE 2: M ODEL CHECK COMPILED FILES ...... 6 3.2.1. SR2.1 (Critical requirement) – Create a launcher ...... 6 3.2.2. SR2.2 (Critical requirement) – Create a main tab ...... 6 3.2.3. SR2.3 (Critical requirement) – Create a properties configuration tab ...... 6 3.2.4. SR2.4 – Output model check result into Eclipse console ...... 6 3.3. USE CASE 3: T RACE ERRORS ...... 6 3.3.1. SR3 (Critical requirement) – Trace errors in Java program ...... 7 3.4. USE CASE 4: V IEW BIR F ILES ...... 7 3.4.1. SR4.1 (Critical requirement) – Create a viewer to display compiled BIR ...... 8 3.4.2. SR4.2 - Highlight Java in java editor ...... 8 3.4.3. SR4.3 - Highlight BIR in Bogor VM Viewer ...... 8 4. ASSUMPTIONS ...... 8 5. CONSTRAINTS ...... 8 6. ENVIRONMENT ...... 8 7. REFERENCE ...... 8

2 CIS895: Bogor - Java Environment for Eclipse Vision Document V2.0 November 3, 2005

1. Introduction

1.1. Background

The tool to be developed in this project will build on top of Eclipse Platform, which is an open extensible IDE for anything and nothing in particular from eclipse.org . The new tool will incorporate with Bogor and BB to do model checking on Java programs. BB , the abbreviation of -to-BIR developed by Dr. Robby , is a compiler that compiles Java Bytecode into BIR. Bogor , a software model checking framework developed in SanToS lab, and supports both general purpose and domain-specific software model checking.

1.2. Motivation

The motivation of this project comes from the need to develop new eclipse plug-ins that is able to analyze Java programs using Bogor. Unlike Java testing tools, model checker explores all paths where testing tools only explore one path. Thus, it can consistently find concurrency bugs such as deadlocks, race conditions, etc. Bogor is an extensible software model-checking framework with state of the art software model checking algorithms, visualizations, and user interface designed to support both general purpose and domain-specific software model checking.

2. Project Overview

2.1. Introduction

This project involves the development of Eclipse plug-ins that allows developer to fully utilize Bogor functions to do model checking on Java programs.

Figure 2.1 presents a high level structure of the Eclipse Platform and plug-ins that will be developed. The plug-ins provide developers with the capability of Java programs model-checking. After coding Java programs, developers are able to view the corresponding BIR files, do a model checking on Java programs, and trace error visually in Java programs.

3 CIS895: Bogor - Java Environment for Eclipse Vision Document V2.0 November 3, 2005

Bytecode -

Eclipse Platform to-BIR

Viewer

Depends on

Incremental compilation

BIR Error Trace in Launcher Java

Figure 2.1

2.2. Goal

There are four goals of this project. (1) Providing incremental compilation of Java bytecode to BIR in Eclipse that is synchronized with Eclipse JDT build process. (2) Providing a view to display incremental compiled BIR. (3) Providing a launcher in Eclipse to invoke Bogor and check the compiled code. (4) Building a Java counter example display on top of Bogor's counter example display.

2.3. Purpose

To develop new Eclipse’s plug-ins in order to convert Java programs to BIR and to do a model checking on these BIR files.

3. Requirements Specification

This section includes a high-level use-case diagram and text descriptions of four use cases that will be addressed in this project.

Figure 3 is a high-level use-case diagram. The use cases, “Compile Java Files” and “Compile Java Bytecode to BIR File”, are not in the scope of this project.

4 CIS895: Bogor - Java Environment for Eclipse Vision Document V2.0 November 3, 2005

<> Compile Java Files

Incremental compilation

View BIR Files <> Developer

Compile Java Bytecode to BIR File Trace Errors

Model Check Compiled Files

Figure 3. High Level Use Case Diagram

3.1. Use Case 1: Incremental Compilation

Description : Generate BIR files using Bytecode-to-BIR ( BB ) compiler. Actors : Developer Specializes : None Includes : Compile Java Bytecode to BIR Extends : None Pre-Conditions : 1. Java files compiled to class files. 2. Class files reside in project output folder. Details : 1. Java developer edits and compiles java program. 2. New/updated Java classes are generated into output folder. 3. BB is invoked to produce BIR files into BIR folder. Post-Conditions : Generated BIR files are saved into project BIR folder.

5 CIS895: Bogor - Java Environment for Eclipse Vision Document V2.0 November 3, 2005

Exceptions : None Constraints : None Variants : None Comments : None

3.1.1. SR1.1 (Critical requirement) - Incremental Compilation

3.1.2. SR1.2 (Critical requirement) – Add a new nature into Java project

3.2. Use Case 2: Model Check Compiled Files

Description : Launcher collects all required BIR files into a final BIR file. And then Bogor is invoked to check the final BIR file. Actors : Developer Specializes : None Includes : None Extends : None Pre-Conditions : BIR files reside in project BIR folder. Details : 1. Developer calls the launcher. 2. Launcher collects all required BIR files. 3. Launcher generates a final BIR files. 4. Launcher calls Bogor. 5. Bogor generates counter examples if any. 6. An output prints out in the console. Post-Conditions : Final BIR file is generated, and counter example is generated if any. Exceptions : None Constraints : None. Variants : None Comments : None

3.2.1. SR2.1 (Critical requirement) – Create a launcher

3.2.2. SR2.2 (Critical requirement) – Create a main tab

3.2.3. SR2.3 (Critical requirement) – Create a properties configuration tab

3.2.4. SR2.4 – Output model check result into Eclipse console

3.3. Use Case 3: Trace Errors

Description : Trace errors in Java programs.

6 CIS895: Bogor - Java Environment for Eclipse Vision Document V2.0 November 3, 2005

Actors : Developer Specializes : None Includes : None Extends : None Pre-Conditions : Bogor generates counter example trace. Details : 1. Developer clicks on the error in the counter example trace. 2. The line of problem code in Java program will be highlighted. Post-Conditions : The code in Java program is highlighted. Exceptions : None Constraints : None Variants : None Comments : None

3.3.1. SR3 (Critical requirement) – Trace errors in Java program

3.4. Use Case 4: View BIR Files

Description : View BIR files in a view. Actors : Developer Specializes : None Includes : None Extends : None Pre-Conditions : 1. Java files compiled into Class files. 2. Class files reside in project output folder. Details : 1. Developer compiles java program. 2. Developer opens the BIR viewer. 3. Developer clicks on the Java program in Java editor. 4. BIR file displays in the BIR viewer. Post-Conditions : Selected BIR file displays in the BIR Viewer. Exceptions : None Constraints : None Variants : None Comments : None

7 CIS895: Bogor - Java Environment for Eclipse Vision Document V2.0 November 3, 2005

3.4.1. SR4.1 (Critical requirement) – Create a view to display compiled BIR

3.4.2. SR4.2 - Highlight Java in java editor

3.4.3. SR4.3 - Highlight BIR in Bogor VM Viewer

4. Assumptions

User system shall install Eclipse V3.1, JRE 1.5, and Bogor Plug-ins.

5. Constraints

N/A

6. Environment

This project will be using the following IDE and Frameworks • IDE: Eclipse Version 3.1 • Frameworks: SWT (Standard Widget Toolkit), Jface

7. Reference BB: http://www.cis.ksu.edu/~robby/ Bogor: http://bogor.projects.cis.ksu.edu/ SanTos Lab: http://www.cis.ksu.edu/santos/ Eclipse: http://www.eclipse.org/

8