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.
- J.-R. Abrial. The Specification Language Z: Syntax and Semantics. Programming Research Group, Oxford University, 1980.Google Scholar
- 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 Scholar
Digital Library
- 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 Scholar
- R. Davies and F. Pfenning. Intersection types and computational effects. In ACM International Conference on Functional Programming, pages 198--208, 2000. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- R. DeLine and M. Fähndrich. The fugue protocol checker: Is your software baroque? Technical Report MSR-TR-2004-07, Microsoft Research, 2004.Google Scholar
- R. DeLine and M. Fähndrich. Typestates for objects. In European Conference on Object-Oriented Programming. Springer-Verlag, 2004.Google Scholar
Cross Ref
- 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 Scholar
Digital Library
- J. Dunfield and F. Pfenning. Tridirectional typechecking. In ACM Symposium on Principles of Programming Languages, 2004. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- E. Gamma, R. Helm, R. Johnson, and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley, 1995. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- D. Harel. Statecharts: A visual formalism for complex systems. Sci. Comput. Programming, 8:231--274, 1987. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
- B. Meyer. Eiffel: The Language. Prentice Hall, 1992. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- B. C. Pierce. Types and Programming Languages. MIT Press, Cambridge, 2002. Google Scholar
Digital Library
- 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 Scholar
Digital Library
- 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 Scholar
Digital Library
Index Terms
- Lightweight object specification with typestates
Recommendations
Lightweight object specification with typestates
ESEC/FSE-13: Proceedings of the 10th European software engineering conference held jointly with 13th ACM SIGSOFT international symposium on Foundations of software engineeringPrevious 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 ...
Typestate protocol specification in JML
SAVCBS '09: Proceedings of the 8th international workshop on Specification and verification of component-based systemsThe Java Modeling Language (JML) is a language for specifying the behavior of Java source code. However, it can describe the protocols of Java classes and interfaces only implicitly. Typestate protocol specification is a more direct, lightweight and ...
Specification, Refinement and Verification of Concurrent Systems—An Integration of Object-Z and CSP
This paper presents a method of formally specifying, refining and verifying concurrent systems which uses the object-oriented state-based specification language Object-Z together with the process algebra CSP. Object-Z provides a convenient way of ...






Comments