Advertisement

A Type System and Analysis for the Automatic Extraction and Enforcement of Design Information

  • Patrick Lam
  • Martin Rinard
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 2743)

Abstract

We present a new type system and associated type checker, analysis, and model extraction algorithms for automatically extracting models that capture aspects of a program’s design. Our type system enables the developer to place a token on each object; this token serves as the object’s representative during the analysis and model extraction. The polymorphism in our type system enables the use of general-purpose classes whose instances may serve different purposes in the computation; programmers may also hide the details of internal data structures by placing the same token on all of the objects in these data structures.

Our combined type system and analysis provide the model extraction algorithms with sound heap aliasing information. Our algorithms can therefore extract both structural models that characterize object referencing relationships and behavioral models that capture indirect interactions mediated by objects in the heap. Previous approaches, in contrast, limited by an absence of aliasing information, have focused on control-flow interactions that take place at procedure call boundaries. We have implemented our type checker, analysis, and model extraction algorithms and used them to automatically extract design models. Our experience indicates that it is straightforward to produce the token annotations and that the extracted models provide useful insight into the structure and behavior of the program.

Keywords

Type System Object Model Token Parameter Automatic Extraction Token Variable 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Aldrich, J., Chambers, C., Notkin, D.: Archjava: Connecting software architecture to implementation. In: 24th International Conference on Software Engineering, Orlando, FL (May 2002)Google Scholar
  2. 2.
    Aldrich, J., Kostadinov, V., Chambers, C.: Alias annotations for program understanding. In: Proceedings of the 17th Annual Conference on Object-Oriented Programming Systems, Languages and Applications, Seattle, WA (November 2002)Google Scholar
  3. 3.
    Andersen, L.O.: Program Analysis and Specialization for the C Programming Language. PhD thesis, DIKU, University of Copenhagen (May 1994)Google Scholar
  4. 4.
    Bloch, J., et al.: JSR175: A metadata facility for the JavaTM programming language (April 2002)Google Scholar
  5. 5.
    Bokowski, B., Vitek, J.: Confined types. In: Proceedings of the 14th Annual Conference on Object-Oriented Programming Systems, Languages and Applications, Denver, CO (November 1999)Google Scholar
  6. 6.
    Boyapati, C., Lee, R., Rinard, M.: Ownership types for safe programming: Preventing data races and deadlocks. In: Proceedings of the 17th Annual Conference on Object-Oriented Programming Systems, Languages and Applications, Seattle, WA (November 2002)Google Scholar
  7. 7.
    Boyapati, C., Rinard, M.: A parameterized type system for race-free Java programs. In: Proceedings of the 16th Annual Conference on Object-Oriented Programming Systems, Languages and Applications, Tampa Bay, Florida (October 2001)Google Scholar
  8. 8.
    Choi, J., Burke, M., Carini, P.: Efficient flow-sensitive interprocedural computation of pointer-induced aliases and side effects. In: Conference Record of the Twentieth Annual Symposium on Principles of Programming Languages, Charleston, SC. ACM, New York (1993)Google Scholar
  9. 9.
    Clarke, D., Drossopoulou, S.: Ownership, encapsulation and disjointness of type and effect. In: Proceedings of the 17th Annual Conference on Object-Oriented Programming Systems, Languages and Applications, Seattle, WA (November 2002)Google Scholar
  10. 10.
    Clarke, D., Potter, J., Noble, J.: Ownership types for flexible alias protection. In: Proceedings of the 13th Annual Conference on Object-Oriented Programming Systems, Languages and Applications, Vancouver, Canada (October 1998)Google Scholar
  11. 11.
    Das, M.: Unification-based pointer analysis with directional assignments. In: Proceedings of the SIGPLAN 2000 Conference on Program Language Design and Implementation, Vancouver, Canada (June 2000)Google Scholar
  12. 12.
    D’Souza, D., Wills, A.: Objects, Components, and Frameworks with UML: the catalysis approach. Addison-Wesley, Reading (1998)Google Scholar
  13. 13.
    Ellson, J., Ganser, E., Koutsofios, E., North, S.: Graphviz, Available from http://www.research.att.com/sw/tools/graphviz
  14. 14.
    Emami, M., Ghiya, R., Hendren, L.: Context-sensitive interprocedural pointsto analysis in the presence of function pointers. In: Proceedings of the SIGPLAN 1994 Conference on Program Language Design and Implementation, Orlando, FL, pp. 242–256. ACM, New York (1994)CrossRefGoogle Scholar
  15. 15.
    Fahndrich, M., Foster, J., Su, Z., Aiken, A.: Partial online cycle elimination in inclusion constraint graphs. In: Proceedings of the SIGPLAN 1998 Conference on Program Language Design and Implementation, Montreal, Canada (June 1998)Google Scholar
  16. 16.
    Heintze, N., Tardieu, O.: Ultra-fast aliasing using CLA: A million lines of code in a second. In: Proceedings of the SIGPLAN 2001 Conference on Program Language Design and Implementation, Snowbird, UT (June 2001)Google Scholar
  17. 17.
    Jackson, D., Rinard, M.: The future of software analysis. In: Finkelstein, A. (ed.) The Future of Software Engineering. ACM, New York (2000)Google Scholar
  18. 18.
    Jackson, D., Waingold, A.: Lightweight extraction of object models from bytecode. In: 21st International Conference on Software Engineering, Los Angeles, CA (May 1999)Google Scholar
  19. 19.
    Kuncak, V., Lam, P., Rinard, M.: Role analysis. In: Proceedings of the 29th Annual ACM Symposium on the Principles of Programming Languages, Portland, OR, 299 (January 2002)Google Scholar
  20. 20.
    Landi, W., Ryder, B.: A safe approximation algorithm for interprocedural pointer aliasing. In: Proceedings of the SIGPLAN 1992 Conference on Program Language Design and Implementation, San Francisco, CA (June 1992)Google Scholar
  21. 21.
    Murphy, G., Notkin, D., Sullivan, K.: Software reflexion models: Bridging the gap between source and high-level models. In: Proceedings of the ACM SIGSOFT 1995 Symposium on the Foundations of Software Engineering,Washington, DC (October 1995)Google Scholar
  22. 22.
    O’Callahan, R.: Generalized Aliasing as a Basis for Program Analysis Tools. PhD thesis, School of Computer Science, Carnegie Mellon Univ., Pittsburgh, PA (November 2000)Google Scholar
  23. 23.
    O’Callahan, R., Jackson, D.: Lackwit: A program understanding tool based on type inference. In: 1997 International Conference on Software Engineering, Boston, MA (May 1997)Google Scholar
  24. 24.
    Ruf, E.: Context-insensitive alias analysis reconsidered. In: Proceedings of the SIGPLAN 1995 Conference on Program Language Design and Implementation, La Jolla, CA (June 1995)Google Scholar
  25. 25.
    Salcianu, A., Rinard, M.: Pointer and escape analysis for multithreaded programs. In: Proceedings of the 8th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming, Snowbird, UT (June 2001)Google Scholar
  26. 26.
    Shapiro, M., Horwitz, S.: Fast and accurate flow-insensitive points-to analysis. In: Proceedings of the 24th Annual ACM Symposium on the Principles of Programming Languages, Paris, France (January 1997)Google Scholar
  27. 27.
    Steensgaard, B.: Points-to analysis in almost linear time. In: Proceedings of the 23rd Annual ACM Symposium on the Principles of Programming Languages, St. Petersburg Beach, FL (January 1996)Google Scholar
  28. 28.
    Warmer, J., Kieppe, A.: The Object Constraint Language: Precise Modeling with UML. Addison-Wesley, Reading (1998)Google Scholar
  29. 29.
    Wilson, R., Lam, M.: Efficient context-sensitive pointer analysis for C programs. In: Proceedings of the SIGPLAN 1995 Conference on Program Language Design and Implementation, La Jolla, CA. ACM, New York (1995)Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2003

Authors and Affiliations

  • Patrick Lam
    • 1
  • Martin Rinard
    • 1
  1. 1.Laboratory for Computer ScienceMassachusetts Institute of TechnologyCambridgeUSA

Personalised recommendations