A Test Data Generation to Raise User-Defined Exceptions in First-Order Functional Programs

주어진 프로그램에서 예외상황을 발생시키는 테스트 데이타 생성 방법

  • 류석영 (한국과학기술원 전산학과) ;
  • 이광근 (한국과학기술원 전산학과)
  • Published : 2000.04.15

Abstract

We present a static analysis method to automatically generate test data that raise exceptions in input programs. Using the test data from our analysis, a programmer can check whether the raised exceptions are correctly handled with respect to the program's specification. For a given program, starting from the initial constraint that a particular raise expression should be executed, our analysis derives necessary constraints for its input variable. Correctness of our analysis assures that any value that satisfies the derived constraints for the input variable will activate the designated raise expression. In this paper, we formally present such an analysis for a first-order language with the ML-style exception handling constructs and algebraic data values, prove its correctness, and show a set of examples.

주어진 프로그램에서 예외상황(exception)을 발생시키는 테스트 데이타를 자동으로 생성해주는 분석 방법을 제안한다. 분석 결과로 얻은 테스트 데이타를 사용하여, 프로그램 내에서 발생한 예외상황들이 프로그래머의 의도대로 처리되는지를 검사할 수 있다. 본 논문에서 제안하는 분석 방법은 입력으로 받은 프로그램에서 특정 예외상황이 발생한다는 조건을 시작으로 하여, 프로그램의 입력 값에 대한 제약식(constraints)을 만들어간다. 이 분석 방법이 옳다는 증명에 의해서, 분석 결과로 얻은 테스트 데이타를 입력으로 하여 프로그램을 수행시키면 지정한 예외상황이 항상 발생한다는 것을 보장할 수 있다.함수를 인수나 결과값으로 전달하지 않고(first-order) ML 스타일의 예외상황 관리 방법을 제공하는 언어를 대상으로 하여 테스트 데이타 생성 방법을 제안하고, 이 분석 방법이 옳다는 것을 증명한 후 몇 가지 예를 사용하여 분석 과정을 설명한다.

Keywords

References

  1. Robin Milner, Mads Tofte, Robert Harper, and David MacQueen. The Definition of Standard ML (Revised). MIT Press, 1997
  2. Luca Cardelli, J. Donahue, Michael Jordan, B. Kalsow, and Greg Nelson. The modula-3 type system. In ACM Symposium on Principles of Programming Languages, pages 202-212, Austin, TX, January 1989 https://doi.org/10.1145/75277.75295
  3. James Gosling, Bill Joy, and Guy L. Jr. Steele. The Java Language Specification (Java Series). Addison-Wesley, September 1996
  4. A. Nico Habermann and Dewayne E. Perry. Ada for Experienced Programmers. Addison-Wesley, 1983
  5. Ariane 5: Flight 501 Failure. http://www.esrin.esa.it/htdocs/tidc/Press/Press96/ariane5rep.html, July 1996
  6. Kwangkeun Yi and Sukyoung Ryu. Towards a cost-effective estimation of uncaught exceptions in SML programs. In Lecture Notes in Computer Science, volume 1302, pages 98-113. Springer-Verlag, proceedings of the 4th international static analysis symposium edition, 1997 https://doi.org/10.1007/BFb0032729
  7. Kwangkeun Yi and Sukyoung Ryu. A cost-effective esimtation of uncaught exceptions in Standard ML programs. Theoretical Computer Science, (invited submission)
  8. Francois Pessaux and Xavier Leroy. Type-based analysis of uncaught exceptions. In ACM Symposium on Principles of Programming Languages, pages 276-290, January 1999 https://doi.org/10.1145/292540.292565
  9. Kwangkeun Yi and Sukyoung Ryu. SML/NJ Exception Analyzer 0.98. http://compiler.kaist.ac.kr/pub/exna/exna-README.html, December 1998
  10. G. Kahn. Natural semantics. In K. Fuchi and M. Nivaat, editors, Programming of Future Generation Computers, pages 237-257. Elsevier Science Publishers (North-Holland), 1988
  11. Nevin Heintze and Joxan Jaffar. A finite presentation theorem for approximating logic programs. Technical Report IBM Technical Report RC 16089 (# 71415), IBM, August 1990
  12. Nevin Heintze and Joxan Jaffar. A decision procedure for a class of set constraints. Technical Report CMU-CS-91-110, Carnegie-Mellon University, February 1991
  13. Witold Charatonik and Andreas Podelski. Solving set constraints for greatest models. Technical Report MPI-I-97-2-004, Max-Planck-Institut fur Informatik, April 1997
  14. Witold Charatonik and Andreas Podelski. Co-definite set constraints. In Lecture Notes in Computer Science, volume 1379, pages 211-225.Springer-Verlag, Proceedings of the 9th International Conference on Rewriting Techniques and Applications - RTA'98 edition, 1998 https://doi.org/10.1007/BFb0052372
  15. P. Devienne, J. M. Talbot, and S. Tison. Solving classes of set constraints with tree automata. Technical Report IT-303, Laboratoire d'Informatique Fondamentale de Lille, May 1997
  16. Bokdan Korel. Automated software test data generation. IEEE Transactions on Software Engineering, 16(8):870-879, August 1990 https://doi.org/10.1109/32.57624
  17. Richard A. DeMillo and A. Jefferson Offutt. Constraint-based automatic test data generation. IEEE Transactions on Software Engineering, 17(9):900-910, September 1991 https://doi.org/10.1109/32.92910
  18. A. Jefferson Offutt, Zhenyi Jin, and Jie Pan. The dynamic domain reduction approach to test data generation. Software Practice and Experience, 1999
  19. Janis Bicevskis, Juris Borzovs, Uldis Straujums, Andris Zarins, and JR. Edward F. Miller. SMOTL - a system to construct samples for data processing program debugging. IEEE Transactions on Software Engineering, 5:60-66, January 1979 https://doi.org/10.1109/TSE.1979.226498
  20. Lori A. Clarke. A system to generate test data and symbolically execute programs. IEEE Transactions on Software Engineering, 2(3):215-222, September 1976 https://doi.org/10.1109/TSE.1976.233817
  21. William E. Howden. Symbolic testing and the DISSECT symbolic evaluation system. IEEE Transactions on Software Engineering, 4(4):266-278, 1977 https://doi.org/10.1109/TSE.1977.231144
  22. C. V. Ramamoorthy, Siu bun F. Ho, and W. T. Chen. On the automated generation of program test data. IEEE Transactions on Software Engineering, 2(4):293-300, December 1976 https://doi.org/10.1109/TSE.1976.233835
  23. Juris Borzovs, Audris Kalnins, and Inga Medvedis. Automatic construction of test sets: Practical approach. volume 502 of Lecture Notes in Computer Science, pages 360-432. 1991 https://doi.org/10.1007/BFb0019363
  24. Peter M. Maurer. Generating testing data with enhanced context-free grammars. IEEE Software, 7(4), July 1990 https://doi.org/10.1109/52.56422
  25. Jeffrey Voas, Larry Morell, and Keith Miller. Predicting where faults can hide from testing. IEEE Software, 8(2):41-58, March 1991 https://doi.org/10.1109/52.73748