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

Complexity of Points-To Analysis of Java in the Presence of Exceptions

Published: 01 June 2001 Publication History
  • Get Citation Alerts
  • Abstract

    At each program point, points-to analysis for statically typed object-oriented programming languages (e.g., Java, C++) determines those objects to which a reference may refer (or a pointer may point) during execution. Points-to analysis is necessary for any semantics-based software tools for object-oriented systems. Our new complexity results for points-to analysis distinguish the difficulty of intraprocedural and interprocedural points-to analyses for languages with combinations of single-level types (i.e., types with data members only of primitive type), exceptions with or without subtyping, and dynamic dispatch. Our results include: 1) The first polynomial-time algorithm for points-to analysis in the presence of exceptions that handles a robust subset of Java without threads and can be applied to C++; 2) proof that the above algorithm is safe, in general, and provably precise on programs with single-level types and exceptions without subtyping, but not dynamic dispatch, thus, this case is in P; 3) proof that an interprocedural points-to analysis problem with single-level types and exceptions with subtyping, but without dynamic dispatch, is PSPACE-hard, while the intraprocedural problem is PSPACE-complete. Other complexity characterizations of points-to analysis in programs without exceptions are presented, including an algorithm with worst-case bound of ${\rm O}(n^5)$, which improves over the ${\rm O}(n^{7})$ worst-case bound achievable from previous approaches of Reps et al. [53] and Landi and Ryder [42].

    References

    [1]
    D. Atkinson and W. Griswold, “The Design of Whole-Program Analysis Tools,” Proc. 18th Int'l Conf. Software Eng., pp. 16–27, 1996.]]
    [2]
    D. Atkinson and W. Griswold, “Effective Whole-Program Analysis in the Presence of Pointers,” Proc. ACM SIGSOFT '98 Symp. Foundations of Software Eng., pp. 46–55, Nov. 1998.]]
    [3]
    O. Agesen, “The Cartesian Product Algorithm: Simple and Precise Type Inference of Parametric Polymorphism,” Proc. European Conf. Object-Oriented Programming (ECOOP '95), 1995.]]
    [4]
    L.O. Andersen, “Program Analysis and Specialization for the C Programming Language,” PhD thesis, DIKU, Univ. of Copenhagen, 1994, also available as DIKU report 94/19.]]
    [5]
    J.M. Barth, “A Practical Interprocedural Data Flow Analysis Algorithm,” Comm. ACM, vol. 21, no. 9, pp. 724–736, 1978.]]
    [6]
    M. Burke P. Carini J.-D. Choi and M. Hind, “Flow-Insensitive Interprocedural Alias Analysis in the Presence of Pointers,” Proc. Seventh Int'l Workshop Languages and Compilers for Parallel Computing, pp. 234–250, Aug. 1994.]]
    [7]
    S. Bates and S. Horwitz, “Incremental Program Testing Using Dependence Graphs,” Conf. Record 20th Ann. ACM SIGACT/SIGPLAN Symp. Principles of Programming Languages, pp. 384–396, Jan. 1993.]]
    [8]
    D.F. Bacon and P.F. Sweeney, “Fast Static Analysis of C++ Virtual Function Calls,” Proc. ACM SIGPLAN Conf. Object-Oriented Programming Systems, Languages, and Applications, 1996.]]
    [9]
    J.-D. Choi M. Burke and P. Carini, “Efficient Flow-Sensitive Interprocedural Computation of Pointer-Induced Aliases and Side Effects,” Conf. Record 20th Ann. ACM SIGACT/SIGPLAN Symp. Principles of Programming Languages, pp. 232–245, Jan. 1993.]]
    [10]
    R. Chatterjee, “Modular Data-Flow Analysis of Statically Typed Object-Oriented Programming Languages,” PhD thesis, Dept. of Computer Science, Rutgers Univ., Oct. 1999.]]
    [11]
    P.R. Carini M. Hind and H. Srinivasan, “Flow-Sensitive Type Analysis for C++,” Research Report RC 20267, IBM T.J. Watson Research Center, 1995.]]
    [12]
    B.G. Cooper, “Ambitious Data Flow Analysis of Procedural Programs,” master's thesis, Univ. of Minnesota, May 1989.]]
    [13]
    D.S. Coutant, “Retargetable High-Level Alias Analysis,” Conf. Record 13th Ann. ACM Symp. Principles of Programming Languages, pp. 110–118, Jan. 1986.]]
    [14]
    R. Chatterjee and B. Ryder, “Scalable, Flow-Sensitive Type-Inference for Statically Typed O-O Languages,” Technical Report DCS-TR-326, Dept. of Computer Science, Rutgers Univ., 1997.]]
    [15]
    R. Chatterjee and B.G. Ryder, “Data-Flow-Based Testing of Object-Oriented Libraries,” Technical Report DCS-TR-382, Dept. of Computer Science, Rutgers Univ., Mar. 1999.]]
    [16]
    R. Chatterjee B. Ryder and W. Landi, “Complexity of Concrete Type-Inference in the Presence of Exceptions,” Proc. European Symp. Programming, Apr. 1998.]]
    [17]
    R. Chatterjee B. Ryder and W. Landi, “Relevant Context Inference,” Proc. ACM SIGPLAN/SIGACT Symp. Principles of Programming Languages, 1999.]]
    [18]
    G. DeFouw D. Grove and C. Chambers, “Fast Interprocedural Class Analysis,” Proc. ACM SIGPLAN/SIGACT Symp. Principles of Programming Languages, pp. 222–336, 1998.]]
    [19]
    A. Diwan J.E.B. Moss and K.S. McKinley, “Simple and Effective Analysis of Statically-Typed Object-Oriented Programs,” Proc. ACM SIGPLAN Conf. Object-Oriented Programming Systems, Languages, and Applications, 1996.]]
    [20]
    M. Emami R. Ghiya and L.J. Hendren, “Context-Sensitive Interprocedural Points-To Analysis in the Presence of Function Pointers,” Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, pp. 242–256, 1994.]]
    [21]
    P. Frankel and O. Iakounenko, “Further Empirical Studies of Test Effectiveness,” Proc. ACM SIGSOFT '98 Sixth Int'l Symp. Foundations of Software Eng., pp. 153–162, Nov. 1998.]]
    [22]
    P. Frankel and S. Weiss, “An Experimental Comparison of the Effectiveness of Branch Testing with Data-Flow Testing,” IEEE Trans. Software Eng., vol. 19, no. 8, pp. 774–787, Aug. 1993.]]
    [23]
    D. Grove G. DeFouw J. Dean and C. Chambers, “Call Graph Constrction in Object-Oriented Languages,” Proc. ACM SIGPLAN Conf. Object-Oriented Programing Systems, Languages, and Applications (OOPSLA '97), pp. 108–124, Oct. 1997.]]
    [24]
    R. Ghiya and L. Hendren, “Putting Pointer Analysis to Work,” Conf. Record 25th Ann. ACM SIGACT/SIGPLAN Symp. Principles of Programming Languages, pp. 121–133, 1998.]]
    [25]
    J. Gil and A. Itai, “The Complexity of Type Analysis of Object Oriented Programs,” Proc. European Conf. Object-Oriented Programming, July 1998.]]
    [26]
    J. Gosling B. Joy and G. Steele, The Java Language Specification. Addison-Wesley, 1996.]]
    [27]
    K. Gallagher and J. Lyle, “Using Program Slices in Software Maintenance,” IEEE Trans. Software Eng., vol. 17, no. 8, pp. 751–761, Aug. 1991.]]
    [28]
    R. Gupta and M.L. Soffa, “Hybrid Slicing: An Approach for Refining Static Slices Using Dynamic Information,” Proc. Third ACM SIGSOFT Symp. Foundations of Software Eng., pp. 29–40, 1996.]]
    [29]
    C.A. Guarna, “A Technique for Analyzing Pointer and Structure References in Parallel Restructuring Compilers,” Proc. Int'l Conf. Parallel Processing, pp. 212–220, 1988.]]
    [30]
    W.L. Harrison III and Z. Ammarguellat, “Parcel and Miprac: Parallelizers for Symbolic and Numeric Programs,” Proc. Int'l Workshop Compilers for Parallel Computers, pp. 329–346, Dec. 1990.]]
    [31]
    M.J. Harrold and N. Ci, “Reuse-Driven Interprocedural Slicing,” Proc. 20th Int'l Conf. Software Eng., pp. 74–83, Apr. 1998.]]
    [32]
    M. Hutchins H. Foster T. Goradia and T. Ostrand, “Experiments on the Effectiveness of Dataflow- and Controlflow-Based Test Adequacy Criteria,” Proc. 16th Int'l Conf. Software Eng., pp. 191–200, May 1994.]]
    [33]
    M. Hind and A. Pioli, “Assessing the Effects of Flow Sensitivity on Pointer Alias Analysis,” Proc. Int'l Static Analysis Symp. (SAS '98), pp. 57–81, Sept. 1998.]]
    [34]
    S. Horwitz T. Reps and D. Binkley, “Interprocedural Slicing Using Dependence Graphs,” ACM Trans. Programming Languages and Systems, vol. 12, no. 1, Jan. 1990.]]
    [35]
    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.]]
    [36]
    M.J. Harrold and M.L. Soffa, “Efficient Computation of Interprocedural Definition-Use Chains,” ACM Trans. Programming Languages and Systems, vol. 16, no. 2, pp. 175–204, Mar. 1994.]]
    [37]
    J.E. Hofcroft and J.D. Ullman, Introduction to Automata Theory, Languages and Computation. Addison-Wesley, 1979.]]
    [38]
    J.B. Kam and J.D. Ullman, “Global Data Flow Analysis and Iterative Algorithms,” J. ACM, vol. 23, no. 1, pp. 158–171, 1976.]]
    [39]
    W.A. Landi, “Interprocedural Aliasing in the Presence of Pointers,” Technical Report LCSR-TR-174 and PhD Thesis, Dept. of Computer Science, Rutgers Univ., 1992.]]
    [40]
    W.A. Landi, “Undecidability of Static Analysis,” ACM Letters on Programming Languages and Systems, vol. 1, no. 4, pp. 323–337, 1992.]]
    [41]
    L. Larsen and M.J. Harrold, “Slicing Object-Oriented Software,” Proc. 18th Int'l Conf. Software Eng., pp. 495–505, Mar. 1996.]]
    [42]
    W.A. Landi and B.G. Ryder, “Pointer-Induced Aliasing: A Problem Classification,” Proc. ACM SIGPLAN/SIGACT Symp. Principles of Programming Languages, pp. 93–103, Jan. 1991.]]
    [43]
    W.A. Landi and B.G. Ryder, “A Safe Approximation Algorithm for Interprocedural Pointer Aliasing,” Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, pp. 235–248, June 1992.]]
    [44]
    W.A. Landi B.G. Ryder and S. Zhang, “Interprocedural Modification Side Effect Analysis with Pointer Aliasing,” Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, 1993.]]
    [45]
    T.J. Marlowe W.A. Landi B.G. Ryder J. Choi M. Burke and P. Carini, “Pointer-Induced Aliasing: A Clarification,” ACM SIGPLAN Notices, vol. 28, no. 9, pp. 67–70, Sept. 1993.]]
    [46]
    K.J. Ottenstein and L.M. Ottenstein, “The Program Dependence Graph in a Software Development Environment,” Proc. ACM SIGSOFT/SIGPLAN Software Eng. Symp. Practical Software Development Environments, pp. 177–184, May 1984.]]
    [47]
    T.J. Ostrand, “Data-Flow Testing with Pointers and Function Calls,” Proc. Pacific Northwest Software Quality Conf., Oct. 1990.]]
    [48]
    C.H. Papadimitriou, Computational Complexity. Addison-Wesley, 1994.]]
    [49]
    J. Plevyak and A. Chien, “Precise Concrete Type Inference for Object Oriented Languages,” Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '94), pp. 324–340, Oct. 1994.]]
    [50]
    H.D. Pande W. Landi and B.G. Ryder, “Interprocedural Def-Use Associations for C Systems with Single Level Pointers,” IEEE Trans. Software Eng., vol. 20, no. 5, pp. 385–403, May 1994.]]
    [51]
    H. Pande and B.G. Ryder, “Data-Flow-Based Virtual Function Resolution,” Proc. Third Int'l Symp. Static Analysis, 1996.]]
    [52]
    J. Palsberg and M. Schwartzbach, “Object-Oriented Type Inference,” Proc. Conf. Object-Oriented Programming Systems, Languages, and Applications (OOPSLA '91), pp. 146–161, Oct. 1991.]]
    [53]
    T. Reps S. Horwitz and M. Sagiv, “Precise Interprocedural Dataflow Analysis via Graph Reachability,” Proc. ACM SIGPLAN/SIGACT Symp. Principles of Programming Languages, pp. 49–61, 1995.]]
    [54]
    C. Ruggieri and T. Murtagh, “Lifetime Analysis of Dynamically Allocated Objects,” Conf. Record 15th Ann. ACM Symp. Principles of Programming Languages, pp. 285–293, Jan. 1988.]]
    [55]
    M.P. Robillard and G.C. Murphy, “Analyzing Exception Flow in Java Programs,” Proc. Seventh European Software Eng. Conf. and Seventh ACM SIGSOFT Symp. Foundations of Software Eng., pp. 322–337, Sept. 1999.]]
    [56]
    T. Reps and G. Rosay, “Precise Interprocedural Chopping,” Proc. Third ACM SIGSOFT Symp. Foundations of Software Eng., pp. 41–52, 1995.]]
    [57]
    E. Ruf, “Context-Insensitive Alias Analysis Reconsidered,” Proc. SIGPLAN '95 Conf. Programming Language Design and Implementation, pp. 13–22, June 1995.]]
    [58]
    S. Sagiv N. Francez M. Rodeh and R. Wilhelm, “A Logic-Based Approach to Data Flow Analysis,” Proc. Second Int'l Workshop Programming Language Implementation and Logic Programming, pp. 277–292, Aug. 1990.]]
    [59]
    M. Shapiro and S. Horwitz, “The Effects of the Precision of Pointer Analysis,” Proc. Fourth Int'l Symp. Static Analysis (SAS '97), pp. 16–34, Sept. 1997.]]
    [60]
    M. Shapiro and S. Horwitz, “Fast and Accurate Flow-Insensitive Points-To Analysis,” Conf. Record 24th Ann. ACM SIGACT/SIGPLAN Symp. Principles of Programming Languages, pp. 1–14, Jan. 1997.]]
    [61]
    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.]]
    [62]
    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.]]
    [63]
    M. Sharir and A. Pnueli, “Two Approaches to Interprocedural Data Flow Analysis,” Program Flow Analysis: Theory and Applications, S. Muchnick and N. Jones, eds., pp. 189–234, 1981.]]
    [64]
    B. Steensgaard, “Points-To Analysis in Almost Linear Time,” Conf. Record 23rd Ann. ACM SIGACT/SIGPLAN Symp. Principles of Programming Languages, pp. 32–41, 1996.]]
    [65]
    B. Steensgaard, “Points-To Analysis in Almost Linear Time,” Proc. ACM SIGPLAN/SIGACT Symp. Principles of Programming Languages, pp. 32–41, 1996.]]
    [66]
    N. Suzuki, “Inferring Types in Smalltalk,” Proc. ACM SIGPLAN/SIGACT Symp. Principles of Programming Languages, pp. 187–199, 1981.]]
    [67]
    P. Tonella G. Antoniol R. Fiutern and E. Merlo, “Flow-Insensitive C++ Pointers and Polymorphism Analysis and Its Application to Slicing,” Proc. 19th Int'l Conf. Software Eng. (ICSE '97), pp. 433–443, 1997.]]
    [68]
    F. Tip J.-D. Choi J. Field and G. Ramalingam, “Slicing Class Hierarchies in C++,” Proc. OOPSLA '96: Conf. Object-Oriented Programming Systems, Languages, and Applications, pp. 179–197, Oct. 1996.]]
    [69]
    F. Tip, “A Survey of Program Slicing Technques,” J. Programming Languages, vol. 3, no. 3, pp. 121–189, 1996.]]
    [70]
    G.A. Venkatesh, “The Semantic Approach to Program Slicing,” Proc. SIGPLAN '91 Conf. Programming Language Design and Implementation, pp. 107–119, June 1991.]]
    [71]
    W.E. Weihl, ”Interprocedural Data Flow Analysis in the Presence of Pointers, Procedure Variables and Label Variables,” master's thesis, Massachusetts Inst. of Technology June 1980.]]
    [72]
    M. Weiser, “Program Slicing,” IEEE Trans. Software Eng., vol. 10, no. 4, pp. 352–357, July 1984.]]
    [73]
    E. Weyuker, “More Experience with Data Flow Testing,” IEEE Trans. Software Eng., vol. 19, no. 9, pp. 912–919, Sept. 1994.]]
    [74]
    R.P. Wilson and M.S. Lam, “Efficient Context-Sensitive Pointer Analysis for C Programs,” Proc. ACM SIGPLAN Conf. Programming Language Design and Implementation, pp. 1–12, 1995.]]
    [75]
    S. Zhang B.G. Ryder and W. Landi, “Program Decomposition for Pointer Aliasing: A Step Towards Practical Analyses,” Proc. Fourth Ann. ACM SIGSOFT Symp. Foundations of Software Eng., pp. 81–92, Oct. 1996.]]
    [76]
    S. Zhang B.G. Ryder and W.A. Landi, “Experiments with Combined Analysis for Pointer Aliasing,” Proc. ACM SIGPLAN Workshop Program Analysis and Software Tools for Eng., pp. 11–18, June 1998.]]

    Cited By

    View all

    Index Terms

    1. Complexity of Points-To Analysis of Java in the Presence of Exceptions

      Recommendations

      Comments

      Information & Contributors

      Information

      Published In

      cover image IEEE Transactions on Software Engineering
      IEEE Transactions on Software Engineering  Volume 27, Issue 6
      June 2001
      98 pages
      ISSN:0098-5589
      Issue’s Table of Contents

      Publisher

      IEEE Press

      Publication History

      Published: 01 June 2001

      Author Tags

      1. Java
      2. Points-to analysis
      3. complexity.
      4. exceptions

      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 10 Aug 2024

      Other Metrics

      Citations

      Cited By

      View all
      • (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
      • (2016)A review on exception analysisInformation and Software Technology10.1016/j.infsof.2016.05.00377:C(1-16)Online publication date: 1-Sep-2016
      • (2014)A constraint-weaving approach to points-to analysis for AspectJFrontiers of Computer Science: Selected Publications from Chinese Universities10.1007/s11704-013-3106-28:1(52-68)Online publication date: 1-Feb-2014
      • (2013)Tool for generating code metrics for C# source code using abstract syntax tree techniqueACM SIGSOFT Software Engineering Notes10.1145/2507288.250731238:5(1-6)Online publication date: 26-Aug-2013
      • (2013)Efficient and effective handling of exceptions in java points-to analysisProceedings of the 22nd international conference on Compiler Construction10.1007/978-3-642-37051-9_3(41-60)Online publication date: 16-Mar-2013
      • (2012)Synthesizing API usage examplesProceedings of the 34th International Conference on Software Engineering10.5555/2337223.2337316(782-792)Online publication date: 2-Jun-2012
      • (2011)Probabilistic points-to analysis for javaProceedings of the 20th international conference on Compiler construction: part of the joint European conferences on theory and practice of software10.5555/1987237.1987245(62-81)Online publication date: 26-Mar-2011
      • (2009)Exception analysis and points-to analysisProceedings of the eighteenth international symposium on Software testing and analysis10.1145/1572272.1572274(1-12)Online publication date: 19-Jul-2009
      • (2008)Contextual integration testing of classesProceedings of the Theory and practice of software, 11th international conference on Fundamental approaches to software engineering10.5555/1792838.1792862(246-260)Online publication date: 29-Mar-2008
      • (2008)Automatic documentation inference for exceptionsProceedings of the 2008 international symposium on Software testing and analysis10.1145/1390630.1390664(273-282)Online publication date: 20-Jul-2008
      • Show More Cited By

      View Options

      View options

      Media

      Figures

      Other

      Tables

      Share

      Share

      Share this Publication link

      Share on social media