«An Exception Monitoring System for Java Heejung Ohe and Byeong-Mo Chang Department of Computer Science, Sookmyung Women’s University, Seoul ...»
method, through which it is propagated back. So a propagated exception can be counted multiply.
The listed ﬁgures of Jess represents propagation of a thrown exception when an input with wrong syntax is given. The listed ﬁgures of Rex also represents propagation of a thrown exception when a wrong option is given. The listed ﬁgures of Check represents the many numbers of thrown, handled and propagated exceptions.
80 H. Ohe and B.-M. Chang 6 Related Works In [10, 11], the usage patterns of exception-handling constructs in Java programs were studied to show that exception-handling constructs are used frequently in Java programs and more accurate exception ﬂow information is necessary.
Exception analyses have been studied actively based on static analysis framework [2, 3, 12, 9]. Static exception analyses analyze input programs before execution and provide approximate information about all possible uncaught exceptions of each method. In Java, the JDK compiler ensures, by an intraprocedural analysis, that clients of a method either handle the exceptions declared by that method, or explicitly specify them at method header. In , a tool called Jex was developed to analyze uncaught exceptions in Java. It can extract the uncaught exceptions in Java programs, and generate views of the exception structure.
In our previous work [2, 12], we proposed interprocedural exception analysis that estimates uncaught exceptions independently of programmers’s speciﬁed exceptions. We compared our analysis with JDK-style analysis by experiments on realistic Java programs. We also have shown that our analysis can detect uncaught exceptions, unnecessary catch and throws clauses eﬀectively.
Static analysis techniques, however, cannot provide information about actual execution. So, dynamic analysis techniques have also been studied to provide information about actual execution [4, 13, 14]. Several dynamic analysis tools are developed for Java including J2ME Wireless Toolkit  and AdaptJ . Recent J2ME Wireless Toolkit can trace method calls, exceptions and class loading as well as memory usage using JVMPI. However, it provides just the names of exceptions whenever exceptions are thrown. Moreover, JVMPI imposes heavy burden on performance overhead, which makes execution speed too slow. It is hard to trace interesting parts of programs eﬀectively, because all codes including libraries are included in the trace. AdaptJ don’t provide any exception-related information during execution.
Our current work diﬀers from the previous static works in that the previous works focus on estimating uncaught exceptions rather than providing information on the propagation paths of thrown exceptions. Our monitoring system can trace in real-time how thrown exceptions including unchecked exceptions are handled and propagated during execution. This trace function has not been supported by any dynamic systems yet.
7 Conclusion We have developed a dynamic exception monitoring system, which can help programmers trace and handle exceptions eﬀectively. Using this system, programmers can examine exception handling process in more details by tracing only interesting exceptions, and can handle exceptions more eﬀectively. To reduce performance overhead, we have designed the system based on inlined reference monitor. We are extending this system in two directions. The ﬁrst one is to visualize exception trace and proﬁle information, which can give more insights to An Exception Monitoring System for Java 81 programmers. The second one is to adapt this system to J2ME programs, which are widely used in mobile environment.
1. B. Bokowski, Andre Spiegel. Barat A Front-End for Java. Technical Report B-98-09 December 1998.
2. B.-M. Chang, J. Jo, K. Yi, and K. Choe, Interprocedural Exception Analysis for Java, Proceedings of ACM Symposium on Applied Computing, pp 620-625, Mar.
3. J.-D. Choi, D. Grove, M. Hind, and V. Sarkar, Eﬃcient and precise modeling of exceptions for analysis of Java programs, Proceedings of ’99 ACM SIGPLANSIGSOFT Workshop on Program Analysis for Software Tools and Engineering, September 1999, pp. 21-31.
4. B. Dufour, K. Driesen, L. Hendren and C. Verbrugge. Dynamic Metrics for Java.
Proceedings of ACM OOPSLA ’03, October, 2003, Anaheim, CA.
5. S. Drossopoulou, and T. Valkevych, Java type soundness revisited. Techical Report, Imperial College, November 1999. Also available from: http://wwwdoc.ic.ac.uk/ scd.
6. U. Erlingsson, The inlined reference monitor approach to secure policy enforcement, Ph.D thesis, Cornell University, January 2004.
7. E. Gamma, R. Helm, R. Johnson and J. Vlissides, Design Patterns:Elements of Reusable Object-Oriented Software, Addison-Wesley,1995.
8. J. Gosling, B. Joy, and G. Steele, The Java Programming Language Speciﬁcation, Addison-Wesley,1996.
9. M. P. Robillard and G. C. Murphy, Analyzing exception ﬂow in Java programs, in Proc. of ’99 European Software Engineering Conference and ACM SIGSOFT Symposium on Foundations of Software Engineering, pp. 322-337.
10. B. G. Ryder, D. Smith, U. Kremer, M. Gordon, and N. Shah, A static study of Java exceptions using JESP, Tech. Rep. DCS-TR-403, Rutgers University, Nov.
11. S. Sinha and M. Harrold, Analysis and testing of programs with exception-handling constructs, IEEE Transations on Software Engineering 26(9) (2000).
12. K. Yi and B.-M. Chang Exception analysis for Java, ECOOP Workshop on Formal Techniques for Java Programs, June 1999, Lisbon, Portugal.
13. AdaptJ:A Dynamic Application Proﬁling Toolkit for Java, http://www.sable.mcgill.ca/ bdufou1/AdaptJ