An Exception Monitoring System for Java ps lab Yun-kyung Kim.

Slides:



Advertisements
Similar presentations
CPSC 388 – Compiler Design and Construction
Advertisements

Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 8 Exceptions and Assertions.
Exceptions Ensuring program reliability. Program correctness The term program correctness refers to a program’s working as advertised; that is, it produces.
Exception Handling Chapter 15 2 What You Will Learn Use try, throw, catch to watch for indicate exceptions handle How to process exceptions and failures.
An Introduction to Java Programming and Object- Oriented Application Development Chapter 8 Exceptions and Assertions.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 15: Exception Handling.
© 2004 Pearson Addison-Wesley. All rights reserved10-1 Chapter 10 : Exceptions Intermediate Java Programming Summer 2007.
JAVA: An Introduction to Problem Solving & Programming, 6 th Ed. By Walter Savitch ISBN © 2012 Pearson Education, Inc., Upper Saddle River,
Liang, Introduction to Java Programming, Eighth Edition, (c) 2011 Pearson Education, Inc. All rights reserved Chapter 13 Exception Handling.
Chapter 16: Exception Handling C++ Programming: From Problem Analysis to Program Design, Fifth Edition.
SE-1020 Dr. Mark L. Hornick 1 More Exception Handling and Throwing Exceptions.
Chapter 12 By Tony Gaddis Modified by Elizabeth Adams Copyright © 2005 Pearson Addison-Wesley. All rights reserved.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
Exception Handling. Introduction An exception is an abnormal condition that arises in a code sequence at run time. In computer languages that do not support.
E XCEPTION H ANDLING Chapter 11 C S 442: A DVANCED J AVA P ROGRAMMING.
EXCEPTIONS Def: An exception is a run-time error. Examples include: attempting to divide by zero, or manipulate invalid data.
Liang, Introduction to Java Programming, Fifth Edition, (c) 2005 Pearson Education, Inc. All rights reserved Chapter 17 Exceptions and.
Exceptions Used to signal errors or unexpected situations to calling code Should not be used for problems that can be dealt with reasonably within local.
Chapter 8 Exceptions. Topics Errors and Exceptions try-catch throwing Exceptions Exception propagation Assertions.
©TheMcGraw-Hill Companies, Inc. Permission required for reproduction or display. COMPSCI 125 Spring 2005 Chapter 8  Errors and Exceptions Throwable class.
CS 206 Introduction to Computer Science II 01 / 23 / 2009 Instructor: Michael Eckmann.
Advanced Java Course Exception Handling. Throwables Class Throwable has two subclasses: –Error So bad that you never even think about trying to catch.
Introduction to Java Chapter 11 Error Handling. Motivations When a program runs into a runtime error, the program terminates abnormally. How can you handle.
1 Exception and Event Handling (Based on:Concepts of Programming Languages, 8 th edition, by Robert W. Sebesta, 2007)
Exceptions. Many problems in code are handled when the code is compiled, but not all Some are impossible to catch before the program is run  Must run.
Java Software Solutions Foundations of Program Design Sixth Edition
Preventing and Correcting Errors
1 Advanced Flow of Control - Introduction - zTwo additional mechanisms for controlling process execution are exceptions and threads zChapter 14 focuses.
Exception Handling. Definition  The term exception is shorthand for the phrase "exceptional event.“  An exception is an event, which occurs during the.
06 Exception Handling. 2 Contents What is an Exception? Exception-handling in Java Types of Exceptions Exception Hierarchy try-catch()-finally Statement.
CIS 270—Application Development II Chapter 13—Exception Handling.
CSM-Java Programming-I Spring,2005 Objects and Classes Overview Lesson - 1.
Java Virtual Machine Case Study on the Design of JikesRVM.
Java Programming: Guided Learning with Early Objects
Exceptions Handling Exceptionally Sticky Problems.
Java Software Solutions Lewis and Loftus Chapter 14 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Advanced Flow of Control --
Chapter 10 Exceptions. Chapter Scope The purpose of exceptions Exception messages The call stack trace The try-catch statement Exception propagation The.
Exception Handling in JAVA. Introduction Exception is an abnormal condition that arises when executing a program. In the languages that do not support.
Spring 2008 Mark Fontenot CSE 1341 Principles of Computer Science I Note Set 10.
Copyright © 2009 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Java Software Solutions Foundations of Program Design Sixth Edition by Lewis.
Exception Handling Unit-6. Introduction An exception is a problem that arises during the execution of a program. An exception can occur for many different.
Exceptions in Java. Exceptions An exception is an object describing an unusual or erroneous situation Exceptions are thrown by a program, and may be caught.
JAVA: An Introduction to Problem Solving & Programming, 5 th Ed. By Walter Savitch and Frank Carrano. ISBN © 2008 Pearson Education, Inc., Upper.
BIO Java 1 Exception Handling Aborting program not always a good idea – can’t lose messages – E-commerce: must ensure correct handling of private.
Data Structures Using Java1 Chapter 2 Inheritance and Exception Handling.
Chapter 12 Handling Exceptions and Events. Chapter Objectives Learn what an exception is Become aware of the hierarchy of exception classes Learn about.
© 2004 Pearson Addison-Wesley. All rights reserved April 24, 2006 Exceptions (part 2) ComS 207: Programming I (in Java) Iowa State University, SPRING 2006.
1 Exception Analysis for Java Byeong-Mo Chang Sookmyung Women’s Univ., Korea.
Exceptions in C++. Exceptions  Exceptions provide a way to handle the errors generated by our programs by transferring control to functions called handlers.
IRM Enforcement of Java stack Inspection Pslab YunKyung Kim.
Chapter 15: Exception Handling C++ Programming: Program Design Including Data Structures, Fifth Edition.
Programming & Debugging. Key Programming Issues Modularity Modifiability Ease of Use Fail-safe programming Style Debugging.
LECTURE 8: EXCEPTIONS CSC 212 – Data Structures. Error Handling Goals  What should we do when an error occurs?  Should alert system to the error  May.
Exception. Agenda Exception. Handling Exceptions. The finally Clause.
Throw, Throws & Try-Catch Statements Explanations and Pictures from: Reference:
Generics, Exception and Undo Command. A Generic Stack Class AStack uses generic. In the main method, we have 2 instances of AStack, each type is Integer.
The Object-Oriented Thought Process Chapter 03
Chapter 13 Exception Handling
Multithreading in Java
Haidong Xue Summer 2011, at GSU
Exceptions C++ Interlude 3
Exception Handling Chapter 9.
Advanced Java Programming
ATS Application Programming: Java Programming
Exceptions Exception handling is an important aspect of object-oriented design Chapter 10 focuses on the purpose of exceptions exception messages the.
Exception Handling Chapter 9 Edited by JJ.
Exception Handling Contents
Exceptions (part 2) December 3, 2007 ComS 207: Programming I (in Java)
Presentation transcript:

An Exception Monitoring System for Java ps lab Yun-kyung Kim.

Contents.  1. Introduction  2. Preliminary  3. Design Considerations  4. Implementation  5. Experiment

1. Introduction  Uncaught exceptions 은 program 의 실행을 abort => run-time 에 exception 이 적절히 handling 되어져야함.  Programmer 가 exception 을 effectively trace, handling 하는 것이 쉽지 않음.

 Static exception analysis  모든 가능한 exception 에 접근.  unchecked exception 은 고려하지 않음.  Static analysis information 은 method header 에 정의된 uncaught(checked) exception 을 check 하 는데 사용됨.  단점 : 실제 run-time 시에 exception 이 어떻게 thrown, caught, propagate 되는지에 대한 정보를 보여주지는 못함. => 따라서 Java program execution 시에 효율적으 로 exception propagation, handling 을 trace, monitor 하기 위한 system 개발이 필요.

 Dynamic exception monitoring system  trace  Option selection  profile information  Code inlining

2. Preliminary  Java exception : be defined by classes, instantiated, assinged to variable, passed as parameters.  throw e o  try S 1 catch(C x) S 2  throws

main() m1() m2 () try{ m1( )} catch(E1 x) {..} throws E1 throw E1 main()m3 () throws E2 throw E2 throws E2 throw E2

3. Design Considerations  Inlines reference monitor : reference monitor 의 functionality 를 include 하도록 application 을 modify

4. Implementation  Barat  Front-end for a Java compiler  AST 구성 => type, name analysis information 제 공  AST 를 traverse 할 수 있는 interface 제공  DescendingVisitor : 모든 AST node 를 depth first order 로 방문  OutputVisitor : AST node 를 traverse 함으로써 input program 을 output

 Implementation  descendingVisitor 를 확장하여 static analysis 구현 => exception- related construct 를 extract  OutputVisitor 를 확장하여 transformer 구현 => TransformVisitor

Figure 7. Transformed program

5. Experiment Figure 8. Trace of Check program Transformed program 을 수행할 때 thrown exception 의 handling, propagation Information 을 보여줌.

Figure 9. Profile of Check program 수행이 끝나면, 각 method 별로 thrown, caught, propagated exception 들의 Name, number 등을 보임.

propagated exception 은 각 method 별로 propagated exception 이 있을 때 마다, count 됨.