A Method to Construct Control Flow Graphs for Java Programs by Decoupling Exception Flow Analysis from Normal Flow Analysis

예외 흐름 분석을 정상 흐름 분석과 분리하여 Java프로그램에 대한 제어 흐름 그래프를 생성하는 방법

  • 조장우 (부산외국어대학교 컴퓨터공학부) ;
  • 창병모 (숙명여자대학교 컴퓨터과학과)
  • Published : 2004.05.01

Abstract

Control flow graph is used for Performing many Program-analysis techniques, such as data-flow and control-dependence analysis, and software-engineering techniques, such as program slicing and testings. For these analyses to be safe and useful, the CFG should incorporate the exception flows that are induced by exceptions. In previous research to construct control flow graph, normal flows and exception flows are computed at the same time, since these two flows are known to be mutually dependent. By investigating realistic Java programs, we found that the cases when these two flows are mutually dependent rarely happen. So, we can decouple exception flow analysis from normal flow analysis. In this paper we propose an analysis that estimates exception flows. We also propose exception flow graph to represent exception flows. And we show that the control flow graph that accounts for exception flows can be constructed by merging exception flow graph onto normal control flow graph.

제어 흐름 그래프는 자료 흐름 분석과 제어 종속 분석과 같은 프로그램 분석 분야와 프로그램 슬라이싱과 테스팅과 같은 소프트웨어공학 분야에서 필요로 하는 정보이다. 이러한 분석들이 안전하고 유용하기 위해서는 제어 흐름 그래프는 예외 흐름을 포함해야 한다. 기존의 방법은 예외 흐름과 정상 흐름의 상호 의존적인 관계로 인해 두 흐름을 동시에 계산하면서 제어 흐름 그래프를 생성한다. 그러나 실제 Java 프로그램을 조사해 본 결과 두 흐름이 상호 의존적으로 필요한 경우는 거의 발생하지 않음을 알 수 있었다. 그러므로 정상 흐름과 예외 흐름을 분리해서 계산할 수 있음을 알았고, 예외 흐름을 계산하는 예외 흐름 분석을 제안한다. 그리고 예외 흐름을 표현하는 예외 흐름 그래프를 제안한다. 그리고 제어 흐름 그래프는 예외 흐름 그래프와 정상 흐름 그래프를 합병함으로써 생성될 수 있음을 보인다.

Keywords

References

  1. 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. 1999
  2. S. Shinha and M. J. Harrold, 'Analysis and Testing of Programs With Exception-Handling Constructs,' IEEE Trans. on Software Engineering, Vol. 26, No. 9, 2000 https://doi.org/10.1109/32.877846
  3. J. D. Choi, D. Grove, M. Hind, and V. Sarkar, 'Efficient and precise modeling of exceptions for analysis of Java programs,' in Proceedings of PASTE '99 ACM SIGPLAN-SIGSOFT Workshop on Program Analysis for Software Tools and Engineering, Sep. 1999, pp. 21-31 https://doi.org/10.1145/316158.316171
  4. R. K. Chatterjee, et al., 'Complexity of concrete type-inference in the presence of exceptions,' Lecture Notes in Computer Science, vol. 1381, pp. 57-74, Apr. 1998 https://doi.org/10.1007/BFb0053563
  5. R. Chatterjee and B. G. Ryder, 'Data-flow-based testing of object-oriented libraries,' Tech. Rep. DCS-TR-382, Rutgers University, Mar. 1999
  6. N. Heintze, 'Set-based program analysis,' Ph.D thesis, Carnegie Mellon University, Oct. 1992
  7. 이정수, 조장우, '클래스분석에서 예외분석의 필요성,' 프로그래밍언어 논문지, 제16권, 제1호, 2002.2
  8. S. Drossopoulou and T. Valkevych, 'Java type soundness revisit,' Technical Report, Imperial College, November 1999
  9. F. Tip and J. Parlsberg, 'Scalable Propagation-Based Call Graph Consturction Algorithms,' In Proceedings of Annual Conference an Objected-Oriented Programming systems, Languages, and Applicatons, pages 281-293, Oct. 2000 https://doi.org/10.1145/353171.353190
  10. D. Bacon and P. Sweenty, 'Fast Statics Analysis of C++ Virtual Function Calls,' In Proceedings of 11th Anual Conference on Objected-Oriented Programming Systems, Languages, and Applications, pages 324-341, Jan 1994
  11. B.-M. Chang, J.-W. Jo, K. Yi, and K. Choe, 'Interproceduaral Exception Analysis for Java,' In Proceedings of 2001 ACM Symposium on Applied Computing, pages 623-625, Mar. 2001 https://doi.org/10.1145/372202.372786
  12. B. Chang and Jang-Wu Jo, 'Granularity of Constraint-Based analysis for Java,' in Proceedings of ACM SIGPLAN Conference on Principles and Practice of Declarative Programming, Sep. 2001, pp. 94-102
  13. K, Yi and S. Ryu, 'Towards a cost-effective estimation of uncaught exceptions in SML programs,' In Lecture Note n Computer Science, volume 1302, pages 98-113, Springer-Verlag, Proceedings of 4th Static Analysis Symposium, Sep, 1997 https://doi.org/10.1007/BFb0032736
  14. J.-W. Jo, B.-M. Chang, K. Yi, and K. Choe, 'An Uncaught Exception Analysis for Java,' The Journal of Systems and Software, accepted for publication https://doi.org/10.1016/S0164-1212(03)00057-8