This Article 
   
 Share 
   
 Bibliographic References 
   
 Add to: 
 
Digg
Furl
Spurl
Blink
Simpy
Google
Del.icio.us
Y!MyWeb
 
 Search 
   
Analysis and Testing of Programs with Exception Handling Constructs
September 2000 (vol. 26 no. 9)
pp. 849-871

Abstract—Analysis techniques, such as control flow, data flow, and control dependence, are used for a variety of software engineering tasks, including structural and regression testing, dynamic execution profiling, static and dynamic slicing, and program understanding. To be applicable to programs in languages such as Java and C++, these analysis techniques must account for the effects of exception occurrences and exception handling constructs; failure to do so can cause the analysis techniques to compute incorrect results and, thus, limit the usefulness of the applications that use them. This paper discusses the effects of exception handling constructs on several analysis techniques. The paper presents techniques to construct representations for programs with explicit exception occurrences—exceptions that are raised explicitly through throw statements—and exception handling constructs. The paper presents algorithms that use these representations to perform the desired analyses. The paper also discusses several software engineering applications that use these analyses. Finally, the paper describes empirical results pertaining to the occurrence of exception handling constructs in Java programs and their effect on some analysis tasks.

[1] H. Agrawal, “On Slicing Programs with Jump Statements,” Proc. ACM SIGPLAN '94 Conf. Programming Language Design and Implementation, pp. 302–312, June 1994.
[2] A.V. Aho, R. Sethi, and J.D. Ullman, Compilers, Principles, Techniques and Tools.New York: Addison-Wesley, 1985.
[3] D.F. Bacon and P.F. Sweeney, “Fast Static Analysis of C++ Virtual Function Calls,” Proc. 11th Ann. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 324–341, Oct. 1996.
[4] T. Ball and S. Horwitz, “Slicing Programs with Arbitrary Control Flow,” Proc. First Int'l Workshop Automated and Algorithmic Debugging, pp. 206–222, Nov. 1993.
[5] G. Bilardi and K. Pingali, “A Framework for Generalized Control Dependence,” Proc. ACM SIGPLAN '96 Conf. Programming Language Design and Implementation, pp. 291–300, May 1996.
[6] R. Chatterjee and B.G. Ryder, “Data Flow-Based Testing of Object-Oriented Libraries,” Technical Report DCS-TR-382, Rutgers Univ., Mar. 1999.
[7] R. Chatterjee, B.G. Ryder, and W.A. Landi, “Complexity of Concrete Type-Inference in the Presence of Exceptions,” Proc. European Symp. Programming, pp. 57–74, Apr. 1998.
[8] J.D. Choi and J. Ferrante, “Static Slicing in the Presence ofgotoStatements,” ACM Trans. Programming Languages and Systems, vol. 16, no. 4, pp. 1,097–1,113, July 1994.
[9] J.D. Choi, D. Grove, M. Hind, and V. Sarkar, “Efficient and Precise Modeling of Exceptions for Analysis of Java Programs,” Proc. PASTE '99 ACM SIGPLAN–SIGSOFT Workshop Program Analysis for Software Tools and Eng., pp. 21–31, Sept. 1999.
[10] R. Cytron, J. Ferrante, B.K. Rosen, M.N. Wegman, and F.K. Zadeck, "Efficiently Computing Static Single Assignment Form and the Control Dependence Graph," ACM Trans. Programming Languages and Systems, Oct. 1991.
[11] R. Cytron, J. Ferrante, and V. Sarkar, “Compact Representations for Control Dependence,” Proc. ACM SIGPLAN '90 Conf. Programming Language Design and Implementation, pp. 337–351, June 1990.
[12] A. Diwan, J.E.B. Moss, and K.S. McKinley, “Simple and Effective Analysis of Statically-Typed Object-Oriented Programs,” Proc. 11th Ann. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 292–305, Oct. 1996.
[13] J. Ferrante,K.J. Ottenstein,, and J.D. Warren,“The program dependence graph and its use in optimization,” ACM Trans. Programming Languages and Systems, vol. 9, no. 3, pp. 319-349, June 1987.
[14] P. Frankl and E.J. Weyuker, “An Applicable Family of Data Flow Testing Criteria,” IEEE Trans. Software Eng., vol. 14, no. 10, pp. 1,483–1,498, Oct. 1988.
[15] P.G. Frankl and S.N Weiss,“An experimental comparison of the effectiveness of branch testing and data flow testing,” IEEE Transactions on Software Engineering, vol. 19, no. 8, Oct. 1993, pp. 774-787.
[16] P.G. Frankl and E.J. Weyuker,“Provable improvements on branch testing,” IEEE Transactions on Software Engineering, vol. 19, no. 10, Oct. 1993, pp. 962-975.
[17] J. Gosling, B. Joy, and G. Steele, The Java Language Specification, Addison-Wesley, Reading, Mass., 1996.
[18] M.J. Harrold and N. Ci, “Reuse-Driven Interprocedural Slicing,” Proc. 20th Int'l Conf. Software Eng., pp. 74–83, Apr. 1998.
[19] M.J. Harrold and G. Rothermel, “Aristotle: A System for Research On and Development of Program-Analysis-Based Tools,” Technical Report OSU-CISRC-3/97-TR17, Ohio State Univ., Mar. 1997.
[20] M.J. Harrold, G. Rothermel, and S. Sinha, “Computation of Interprocedural Control Dependence,” Proc. 1998 Int'l Symp. Software Testing and Analysis, pp. 11–20, Mar. 1998.
[21] M.J. Harrold and M.L. Soffa, “Interprocedural Data Flow Testing,” Proc. ACM SIGSOFT '89 Third Symp. Software Testing, Analysis, and Verification, pp. 158–167, Dec. 1989.
[22] M.J. Harrold and M.L. Soffa, “Selecting and Using Data for Integration Testing,” IEEE Software, vol. 8, no. 2, pp. 58–65, Mar. 1991.
[23] S. Horwitz, T. Reps, and D. Binkley, “Interprocedural Slicing Using Dependence Graphs,” ACM Trans. Programming Languages and Systems. vol. 12, no. 1, pp. 26-60, Jan. 1990.
[24] W.E. Howden, “Methodology for the Generation of Program Test Data,” IEEE Trans. Computers, vol. 24, no. 5, pp. 554–559, May 1975.
[25] J.C. Huang, "An Approach to Program Testing," Computer Surveys, pp. 113-128, 1975.
[26] B. Korel, “Automated Software Test Data Generation,” IEEE Trans. Software Eng., vol. 16, no. 8, pp. 870–879, Aug. 1990.
[27] D. Kung, N. Suchak, J. Gao, P. Hsia, Y. Toyoshima, and C. Chen, “On Object State Testing,” Proc. COMPSAC '94 18th Int'l Computer Software and Applications Conf., pp. 222–227, Nov. 1994.
[28] W. Landi and B.G. Ryder, "A Safe Approximate Algorithm for Pointer-Induced Aliasing," Proc. ACM SIGPLAN'92 Conf. Programming Language Design and Implementation (PLDI'92), pp. 235-248, 1992. published as SIGPLAN Notices, vol. 27, no. 7.
[29] L. Larsen and M.J. Harrold, ”Slicing Object-Oriented Software,” Proc. Int'l Conf. Software Eng., pp. 495–505, Mar. 1996.
[30] J.W. Laski and B. Korel, “A Data Flow Oriented Program Testing Strategy,” IEEE Trans. Software Eng., vol. 9, no. 3, pp. 347–354, May 1983.
[31] D. Liang and M.J. Harrold, “Slicing Objects Using System Dependence Graphs,” Proc. Int'l Conf. Software Maintenance, pp. 358–367, Nov. 1998.
[32] J.P. Loyall and S.A. Mathisen, “Using Dependence Analysis to Support the Software Maintenance Process,” Proc. Conf. Software Maintenance, pp. 282–291, Sept. 1993.
[33] T.J. McCabe, “A Complexity Measure,” IEEE Trans. Software Eng., vol. 2, no. 4, pp. 308–320, Dec. 1976.
[34] D. Melski and T. Reps, “Interprocedural Path Profiling,” Proc. Eighth Int'l Conf. Compiler Construction, pp. 47–62, Mar. 1999.
[35] G.C. Murphy and D. Notkin, “Lightweight Lexical Source Model Extraction,” ACM Trans. Programming Languages and Systems, vol. 5, no. 3, pp. 262–292, July 1996.
[36] S. Ntafos, “On Required Elements Testing,” IEEE Trans. Software Eng., vol. 10, no. 6, pp. 795–803, Nov. 1984.
[37] S. Ntafos, “A Comparison of Some Structural Testing Strategies,” IEEE Trans. Software Eng., vol. 14, no. 6, pp. 868–874, June 1988.
[38] J. Palsberg and M. Schwartzbach, “Object-Oriented Type Inference,” Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 146–161, Oct. 1991.
[39] K. Pingali and G. Bilardi, “APT: A Data Structure for Optimal Control Dependence Computation,” Proc. Conf. Programming Language Design and Implementation, pp. 32–46, June 1995.
[40] J. Plevyak and A. Chien, “Precise Concrete Type Inference for Object-Oriented Languages,” Proc. Ninth Ann. Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 324–340, Oct. 1994.
[41] S. Rapps and E.J. Weyuker, “Selecting Software Test Data Using Data Flow Information,” IEEE Trans. Software Eng., vol. 11, no. 4, pp. 367–375, Apr. 1985.
[42] M.P. Robillard and G.C. Murphy, “Analyzing Exception Flow in Java Programs,” Proc. ESEC/FSE '99 Seventh European Software Eng. Conf. and Seventh ACM SIGSOFT Symp. Foundations of Software Eng., pp. 322–337, Sept. 1999.
[43] G. Rothermel and M.J. Harrold, “A Safe, Efficient Regression Test Selection Technique,” ACM Trans. Software Eng. and Methodology, vol. 6, no. 2, pp. 173-210, Apr. 1997.
[44] B.G. Ryder, D. Smith, U. Kremer, M. Gordon, and N. Shah, “A Static Study of Java Exceptions Using JSEP,” Technical Report DCS-TR-403, Rutgers Univ., Nov. 1999.
[45] C.F. Schaefer and G.N. Bundy, “Static Analysis of Exception Handling In Ada,” Software—Practice and Experience, vol. 23, no. 10, pp. 1,157–1,174, Oct. 1993.
[46] S. Sinha and M.J. Harrold, “Analysis of Programs That Contain Exception Handling Constructs,” Proc. Int'l Conf. Software Maintenance, pp. 348–357, Nov. 1998.
[47] S. Sinha and M.J. Harrold, “Control Flow Analysis of Programs With Exception Handling Constructs,” Technical Report OSU-CISRC-7/98-TR25, Ohio State Univ., July 1998.
[48] S. Sinha and M.J. Harrold, “Criteria for Testing Exception Handling Constructs in Java Programs,” Proc. Int'l Conf. Software Maintenance, pp. 265–274, Sept. 1999.
[49] S. Sinha and M.J. Harrold, “Analysis and Testing of Programs With Exception Handling Constructs,” Technical Report GIT-CC-00-04, College of Computing, Georgia Inst. of Tech nology, Feb. 2000.
[50] S. Sinha, M.J. Harrold, and G. Rothermel, “System-Dependence-Graph-Based Slicing of Programs with Arbitrary Interprocedural Control Flow,” Proc. 21st Int'l Conf. Software Eng., pp. 432–441, May 1999.
[51] M. Weiser, “Program Slicing,” IEEE Trans. Software Eng., vol. 10, no. 4, pp. 352–357, July 1984.

Index Terms:
Exception handling, control flow analysis, control dependence analysis, data flow analysis, program slicing, structural testing.
Citation:
Saurabh Sinha, Mary Jean Harrold, "Analysis and Testing of Programs with Exception Handling Constructs," IEEE Transactions on Software Engineering, vol. 26, no. 9, pp. 849-871, Sept. 2000, doi:10.1109/32.877846
Usage of this product signifies your acceptance of the Terms of Use.