Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
research-article

Analysis and Testing of Programs with Exception Handling Constructs

Published: 01 September 2000 Publication History

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.

References

[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. Reading, Mass.: Addison-Wesley, 1986.
[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 of goto Statements,” 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, vol. 13, no. 4, pp. 450–490, 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, July 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 Trans. Software Eng., vol. 19, no. 8, pp. 774–787, Aug. 1993.
[16]
P.G. Frankl and E.J. Weyuker, “Provable Improvements on Branch Testing,” IEEE Trans. Software Eng., vol. 19, no. 10, 962–975, Oct. 1993.
[17]
J. Gosling B. Joy and G. Steele, The Java Language Specification. Reading, Mass.: Addison-Wesley, 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,” ACM Computing Surveys, vol. 7, no. 3, pp. 114–128, Sept. 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 Interprocedural Pointer Aliasing,” Proc. SIGPLAN '92 Conf. Programming Language Design and Implementation, pp. 235–248, June 1992.
[29]
L. Larsen and M.J. Harrold, “Slicing Object-Oriented Software,” Proc. 18th 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 Technology, 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.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

Published In

cover image IEEE Transactions on Software Engineering
IEEE Transactions on Software Engineering  Volume 26, Issue 9
September 2000
102 pages
ISSN:0098-5589
Issue’s Table of Contents

Publisher

IEEE Press

Publication History

Published: 01 September 2000

Author Tags

  1. Exception handling
  2. control dependence analysis
  3. control flow analysis
  4. data flow analysis
  5. program slicing
  6. structural testing.

Qualifiers

  • Research-article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)0
  • Downloads (Last 6 weeks)0
Reflects downloads up to 03 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2024)Towards automatic labeling of exception handling bugs: A case study of 10 years bug-fixing in Apache HadoopEmpirical Software Engineering10.1007/s10664-024-10494-029:4Online publication date: 5-Jun-2024
  • (2023)SLocator: Localizing the Origin of SQL Queries in Database-Backed Web ApplicationsIEEE Transactions on Software Engineering10.1109/TSE.2023.325370049:6(3376-3390)Online publication date: 1-Jun-2023
  • (2023)Excluding code from test coverage: practices, motivations, and impactEmpirical Software Engineering10.1007/s10664-022-10259-728:1Online publication date: 1-Jan-2023
  • (2023)Constructing exception handling chains for testing Java virtual machine implementationsJournal of Software: Evolution and Process10.1002/smr.256236:4Online publication date: 15-Apr-2023
  • (2022)Which Exception Shall We Throw?Proceedings of the 37th IEEE/ACM International Conference on Automated Software Engineering10.1145/3551349.3556895(1-12)Online publication date: 10-Oct-2022
  • (2021)Distribution-Aware Testing of Neural Networks Using Generative ModelsProceedings of the 43rd International Conference on Software Engineering10.1109/ICSE43902.2021.00032(226-237)Online publication date: 22-May-2021
  • (2021)Assessing exception handling testing practices in open-source librariesEmpirical Software Engineering10.1007/s10664-021-09983-326:5Online publication date: 1-Sep-2021
  • (2020)Is Exceptional Behavior Testing an Exception?Proceedings of the 24th International Conference on Evaluation and Assessment in Software Engineering10.1145/3383219.3383237(170-179)Online publication date: 15-Apr-2020
  • (2019)Modeling and Coverage Analysis of Programs with Exception HandlingProceedings of the 12th Innovations in Software Engineering Conference (formerly known as India Software Engineering Conference)10.1145/3299771.3299785(1-11)Online publication date: 14-Feb-2019
  • (2019)Test coverage in python programsProceedings of the 16th International Conference on Mining Software Repositories10.1109/MSR.2019.00027(116-120)Online publication date: 26-May-2019
  • Show More Cited By

View Options

View options

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media