Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
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 eo
try S1 catch(C x) S2
throws
main()
try{ m1( )}
catch(E1 x) {..}
main()
m1()
throws E1
m3 ()
throws E2
throw E2
m2 ()
throws E1
throw E1
m3 ()
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됨.