Academia.eduAcademia.edu

Outline

Encapsulating objects with confined types

2007, ACM Transactions on Programming Languages and Systems

Abstract

Object-oriented languages provide little support for encapsulating objects. Reference semantics allows objects to escape their defining scope, and the pervasive aliasing that ensues remains a major source of software defects. This paper presents Kacheck/J, a tool for inferring object encapsulation properties of large Java programs. Our goal is to develop practical tools to assist software engineers, thus we focus on simple and scalable techniques. Kacheck/J is able to infer confinement -the property that all instances of a given type are encapsulated in their defining package. This simple property can be used to identify accidental leaks of sensitive objects, as well as for compiler optimizations. We report on the analysis of a large body of code and discuss language support and refactoring for confinement.

References (42)

  1. Jonathan Aldrich, Valentin Kostadinov, and Craig Chambers. Alias annotations for program un- derstanding. In Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Appplications (OOPSLA), pages 311-330, November 2002.
  2. Paulo Sérgio Almeida. Balloon types: Controlling sharing of state in data types. In Mehmet Aksit and Satoshi Matsuoka, editors, ECOOP'97-Object-Oriented Programming, 11th European Conference, volume 1241 of LNCS, pages 32-59, Jyväskylä, Finland, 9-13 June 1997. Springer-Verlag.
  3. Paulo Sérgio Almeida. Type-checking balloon types. Electrical Notes in Theoretical Computer Science, 20, 1999.
  4. Anindya Banerjee and David A. Naumann. Representation independence, confinement and access control. In Proceedings of POPL'02, SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 166-177, 2002.
  5. Michael Barnett, Robert DeLine, Manuel Fähndrich, K. Rustan M. Leino, and Wolfram Schulte. Verification of object-oriented programs with invariants. Journal of Object Technology, 3(6):27-56, 2004. Preliminary version in Proceedings of Fifth Workshop on Formal Techniques for Java-like Programs, 2003.
  6. Bruno Blanchet. Escape analysis for object oriented languages. application to Java. In OOPSLA'99 ACM Conference on Object-Oriented Systems, Languages and Applications, volume 34(10) of ACM SIGPLAN Notices, pages 20-34, Denver, CO, October 1999. ACM Press.
  7. Bruno Blanchet. Escape analysis for Java: Theory and practice. ACM Transactions on Programming Languages and Systems, 25(6):713-775, 2003.
  8. Jeff Bogda and Urs Hölzle. Removing unnecessary synchronization in Java. In OOPSLA'99 ACM Conference on Object-Oriented Systems, Languages and Applications, volume 34(10) of ACM SIG- PLAN Notices, pages 35-46, Denver, CO, October 1999. ACM Press.
  9. Boris Bokowski. CoffeeStrainer: Statically-checked constraints on the definition and use of types in Java. In Proceedings of ESEC/FSE'99, pages 355-374, Toulouse, France, September 1999.
  10. Boris Bokowski and Jan Vitek. Confined types. In Proceedings 14th Annual ACM SIGPLAN Confer- ence on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'99), pages 82-96, Denver, Colorado, USA, November 1999.
  11. Chandrasekhar Boyapati, Robert Lee, and Martin Rinard. Ownership types for safe programming: Preventing data races and deadlocks. In Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Appplications (OOPSLA), pages 211-230, November 2002.
  12. Chandrasekhar Boyapati, Alexandru Salcianu, William Beebee, and Martin Rinard. Ownership types for safe region-based memory management in real-time Java. In ACM Conference on Programming Language Design and Implementation, pages 324-337, June 2003.
  13. John Boyland. Alias burying: Unique variables without destructive reads. Software-Practice and Experience, 31(6):533-553, 2001.
  14. John Boyland, James Noble, and William Retert. Capabilities for aliasing: A generalisation of uniqueness and read-only. In ECOOP'01 -Object-Oriented Programming, 15th European Confer- ence, number 2072 in Lecture Notes in Computer Science, pages 2-27, Berlin, Heidelberg, New York, 2001. Springer.
  15. Dave Clarke, Michael Richmond, and James Noble. Saving the world from bad Beans: Deployment- time confinement checking. In Proceedings of the ACM Conference on Object-Oriented Programming, Systems, Languages, and Appplications (OOPSLA), pages 374-387, Anaheim, CA, November 2003.
  16. David Clarke. Object Ownership and Containment. PhD thesis, School of Computer Science and Engineering, University of New South Wales, Sydney, Australia, 2001.
  17. David Clarke and Tobias Wrigstad. External uniqueness. In 10th Workshop on Foundations of Object-Oriented Languages (FOOL), New Orleans, LA, January 2003.
  18. David G. Clarke, John M. Potter, and James Noble. Ownership types for flexible alias protection. In OOPSLA '98 Conference Proceedings, volume 33(10) of ACM SIGPLAN Notices, pages 48-64. ACM, October 1998.
  19. Ian Clarke, Scott G. Miller, Theodore W. Hong, Oskar Sandberg, and Brandon Wiley. Protecting free expression online with freenet. IEEE Internet Computing, 6(1):40-49, 2002.
  20. Ian Clarke, Oscar Sandberg, Brandon Wiley, and Theodore W. Hong. Freenet: A Distributed Anony- mous Information Storage and Retrieval System. In Workshop on Design Issues in Anonymity and Unobservability, number 2009 in Lecture Notes in Computer Science, pages 46-66. Springer-Verlag, 2000.
  21. David Detlefs, K. Rustan M. Leino, and Greg Nelson. Wrestling with rep exposure. Technical report, Digital Equipment Corporation Systems Research Center, 1996.
  22. Alain Deutsch. Semantic models and abstract interpretation techniques for inductive data struc- tures and pointers. In Proceedings of the ACM SIGPLAN Symposium on Partial Evaluation and Semantics-Based Program Manipulation, pages 226-229, La Jolla, California, June 21-23, 1995.
  23. William F. Dowling and Jean H. Gallier. Linear-time algorithms for testing the satisfiability of propositional horn formulae. Journal of Logic Progamming, 1(3):267-84, October 1984.
  24. Martin Fowler, Kent Beck, John Brant, William Opdyke, and Don Roberts. Refactoring: Improving the Design of Existing Code. Addison-Wesley, 1999.
  25. Erich Gamma, Richard Helm, Ralph E. Johnson, and John Vlissides. Design Patterns. Addison- Wesley, 1994.
  26. Daniela Genius, Martin Trapp, and Wolf Zimmermann. An approach to improve locality using Sandwich Types. In Proceedings of the 2nd Types in Compilation workshop, volume LNCS 1473, pages 194-214, Kyoto, Japan, March 1998. Springer Verlag.
  27. Stephan Herrmann. Object Teams: Improving modularity for crosscutting collaborations. In Ob- jects, Components, Architectures, Services, and Applications for a Networked World, number 2591 in Lecture Notes in Computer Science, pages 248-264. Springer-Verlag, 2003.
  28. John Hogg. Islands: Aliasing Protection in Object-Oriented Languages. In Proceedings of the OOP- SLA '91 Conference on Object-Oriented Programming Systems, Languages and Applications, pages 271-285, November 1991. Published as ACM SIGPLAN Notices, volume 26, number 11.
  29. John Hogg, Doug Lea, Alan Wills, Dennis de Champeaux, and Richard Holt. The Geneva convention on the treatment of object aliasing. OOPS Messenger, 3(2):271-285, April 1992.
  30. Atsushi Igarashi, Benjamin C. Pierce, and Philip Wadler. Featherweight Java: a minimal core calculus for Java and GJ. ACM Transactions on Programming Languages and Systems, 23(3):396-450, May 2001.
  31. Stuart Kent and Ian Maung. Encapsulation and Aggregation. In Proceedings of TOOLS PACIFIC 95 (TOOLS 18), pages 227-238. Prentice Hall, 1995.
  32. K. Rustan M. Leino and Peter Müller. Object invariants in dynamic contexts. In Proceedings of ECOOP'04, 16th European Conference on Object-Oriented Programming, pages 491-516, 2004.
  33. Sun Microsystems. Support for extensions and applications in the version 1.2 of the Java platform. http://java.sun.com/products/jdk/1.2/docs/guide/extensions/spec.html, 2000.
  34. Peter Müller. Modular Specification and Verification of Object-Oriented Programs. PhD thesis, FernUniversität Hagen, 2001. Also as LNCS 2262, Springer-Verlag, 2002.
  35. Peter Müller and Arnd Poetzsch-Heffter. Universes: A type system for controlling representation exposure. In A. Poetzsch-Heffter and J. Meyer, editors, Programming Languages and Fundamentals of Programming. Fernuniversität Hagen, 1999.
  36. James Noble, Jan Vitek, and John Potter. Flexible alias protection. In Eric Jul, editor, ECOOP'98- Object-Oriented Programming, volume 1445 of Lecture Notes In Computer Science, pages 158-185, Berlin, Heidelberg, New York, July 1988. Springer-Verlag.
  37. Alex Potanin, James Noble, Dave Clarke, and Robert Biddle. Featherweight generic confinement. In Workshop on Foundations of Object-Oriented Languages, 2004.
  38. Christian Skalka and Scott F. Smith. Static use-based object confinement. International Journal on Information Security, 4(1-2):87-104, 2005. Preliminary version in Proceedings of Foundations of Computer Security, volume 02-12 of DIKU technical reports, pages 117-126.
  39. Jan Vitek and Boris Bokowski. Confined types in Java. Software Practice and Experience, 31(6):507- 532, 2001.
  40. Ayal Zaks, Vitaly Feldman, and Nava Aizikowitz. Sealed calls in Java packages. In OOPSLA '2000 Conference Proceedings, ACM SIGPLAN Notices, pages 83-92. ACM, October 2000.
  41. Tian Zhao, James Noble, and Jan Vitek. Scoped types for real-time Java. In Proceedings of 25th IEEE Real-Time Systems Symposium, pages 241-251, 2004.
  42. Tian Zhao, Jens Palsberg, and Jan Vitek. Type-based confinement. Journal of Functional Program- ming, 16(1):83-128, 2006. Preliminary version, entitled "Lightweight confinement for Featherweight Java", in Proceedings of OOPSLA'03, ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications, pages 135-148, Anaheim, California, October 2003.