skip to main content
article

Lightweight object specification with typestates

Published:01 September 2005Publication History
Skip Abstract Section

Abstract

Previous work has proven typestates to be useful for modeling protocols in object-oriented languages. We build on this work by addressing substitutability of subtypes as well as improving precision and conciseness of specifications. We propose a specification technique for objects based on abstract states that incorporates state refinement, method refinement, and orthogonal state dimensions. Union and intersection types form the underlying semantics of method specifications. The approach guarantees substitutability and behavioral subtyping. We designed a dynamic analysis to check existing object-oriented software for protocol conformance and validated our approach by specifying two standard Java libraries. We provide preliminary evidence for the usefulness of our approach.

References

  1. J.-R. Abrial. The Specification Language Z: Syntax and Semantics. Programming Research Group, Oxford University, 1980.Google ScholarGoogle Scholar
  2. S. Butkevich, M. Renedo, G. Baumgartner, and M. Young. Compiler and tool support for debugging object protocols. In SIGSOFT Symposium on the Foundations of Software Engineering, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Y. Cheon and G. T. Leavens. A runtime assertion checker for the java modeling language (jml). In International Conference on Software Engineering Research and Practice, 2002.Google ScholarGoogle Scholar
  4. R. Davies and F. Pfenning. Intersection types and computational effects. In ACM International Conference on Functional Programming, pages 198--208, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. R. DeLine and M. Fähndrich. Enforcing high-level protocols in low-level software. In SIGPLAN Conference on Programming Language Design and Implementation, pages 59--69, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. R. DeLine and M. Fähndrich. The fugue protocol checker: Is your software baroque? Technical Report MSR-TR-2004-07, Microsoft Research, 2004.Google ScholarGoogle Scholar
  7. R. DeLine and M. Fähndrich. Typestates for objects. In European Conference on Object-Oriented Programming. Springer-Verlag, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  8. R. Duke, G. Rose, and G. Smith. Object-z: A specification language advocated for the description of standards. Computer Standards and Interfaces, 17:511--533, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. J. Dunfield and F. Pfenning. Tridirectional typechecking. In ACM Symposium on Principles of Programming Languages, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. R. B. Findler and M. Felleisen. Contract soundness for object-oriented languages. In ACM Conference on Object-Oriented Programming Languages, Systems, and Applications, pages 1--15, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. R. B. Findler, M. Latendresse, and M. Felleisen. Behavioral contracts and behavioral subtyping. In SIGSOFT Symposium on the Foundations of Software Engineering, pages 229--236, 2001. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. C. Flanagan, K. R. M. Leino, M. Lillibridge, G. Nelson, J. Saxe, and R. Stata. Extended static checking for java. In SIGPLAN Conference on Programming Language Design and Implementation, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Hallem, B. Chelf, Y. Xie, and D. Engler. A system and language for building system-specific, static analyses. In SIGPLAN Conference on Programming Language Design and Implementation, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. Harel. Statecharts: A visual formalism for complex systems. Sci. Comput. Programming, 8:231--274, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. B. H. Liskov and J. M. Wing. A behavioral notion of subtyping. ACM Transactions on Programming Languages and Systems, 16(6):1811--1841, Nov. 1994. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Y. Mandelbaum, D. Walker, and R. Harper. An effective theory of type refinements. In SIGPLAN International Conference on Functional Programming, pages 213--225, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. B. Meyer. Eiffel: The Language. Prentice Hall, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. D. L. Parnas. On the criteria to be used in decomposing systems into modules. Communications of the ACM, 15(12):1053--1058, December 1972. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. B. C. Pierce. Types and Programming Languages. MIT Press, Cambridge, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. J. C. Reynolds. Separation logic: A logic for shared mutable data structures. In IEEE Symposium on Logic in Computer Science, pages 55--74, 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. R. E. Strom and S. Yemini. Typestate: A programming language concept for enhancing software reliability. IEEE Transactions on Software Engineering, 12:157--171, 1986. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Lightweight object specification with typestates

                  Recommendations

                  Comments

                  Login options

                  Check if you have access through your login credentials or your institution to get full access on this article.

                  Sign in

                  Full Access

                  • Published in

                    cover image ACM SIGSOFT Software Engineering Notes
                    ACM SIGSOFT Software Engineering Notes  Volume 30, Issue 5
                    September 2005
                    462 pages
                    ISSN:0163-5948
                    DOI:10.1145/1095430
                    Issue’s Table of Contents
                    • cover image ACM Conferences
                      ESEC/FSE-13: Proceedings of the 10th European software engineering conference held jointly with 13th ACM SIGSOFT international symposium on Foundations of software engineering
                      September 2005
                      402 pages
                      ISBN:1595930140
                      DOI:10.1145/1081706

                    Copyright © 2005 ACM

                    Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                    Publisher

                    Association for Computing Machinery

                    New York, NY, United States

                    Publication History

                    • Published: 1 September 2005

                    Check for updates

                    Qualifiers

                    • article

                  PDF Format

                  View or Download as a PDF file.

                  PDF

                  eReader

                  View online with eReader.

                  eReader