skip to main content
10.1145/1596486.1596490acmconferencesArticle/Chapter ViewAbstractPublication PagesfseConference Proceedingsconference-collections
research-article

Typestate protocol specification in JML

Published:25 August 2009Publication History

ABSTRACT

The 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 abstract way of documenting usage protocols for object-oriented programs. In this paper, we propose a technique for incorporating the typestate concept into JML for specifying protocols of Java classes and interfaces, based on our previous research on typestate protocol specifications [4]. This paper presents a set of formal translation rules for encoding typestate protocol specifications into pre/post-condition specifications. It shows how typestate protocol specifications can be mixed with pre/post-condition specifications and how violations of code contracts in inheritance can be handled. Finally, our proposed technique is demonstrated within the Java/JML environment to show its effectiveness.

References

  1. G. T. Leavens, A. L. Baker, and C. Ruby. Preliminary design of JML: A behavioral interface specification language for Java. Technical Report 98-06-rev28, Iowa State University Department of Computer Science, July 2005.Google ScholarGoogle Scholar
  2. Gary T. Leavens, Erik Poll, Curtis Clifton, Yoonsik Cheon, Clyde Ruby, David Cok, Peter Müller, Joseph Kiniry, Patrice Chalin, and Daniel M. Zimmerman. JML reference manual. Available at http://www.eecs.ucf.edu/~leavens/JML/jmlrefman/, retrieved June 2009.Google ScholarGoogle Scholar
  3. Jean-Raymond Abrial, Stephen A. Schuman and Bertrand Meyer. A Specification Language. In On the Construction of Programs, Cambridge University Press, 1980.Google ScholarGoogle Scholar
  4. Kevin Bierhoff and Jonathan Aldrich, Lightweight Object Specification with Typestates. In Foundations of Software Engineering, September 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Edmund M. Clarke, Jeannette M. Wing, et al., Formal Methods: State of the Art and Future Directions. ACM Computing Surveys, Vol. 28, No. 4, December 1996. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. 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
  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. C. A. R. Hoare. "An axiomatic basis for computer programming". Communications of the ACM, 12(10):576--580, 1969. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Gary T. Leavens. JML's Rich, Inherited Specifications for Behavioral Subtypes. In International Conference on Formal Engineering Methods, pp. 2--34, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. S. Butkevich, M. Renedo, G. Baumgartner, and M. Young. Compiler and tool support for debugging object protocols. In Foundations of Software Engineering, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. B. Meyer. Eiffel: The Language. Prentice Hall, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. 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
  13. D. Harel. Statecharts: A visual formalism for complex systems. Sci. Comput. Programming, 8:231--274, 1987. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Mike Barnett, K. Rustan M. Leino, and Wolfram Schulte. The Spec# programming system: An overview. In Construction and Analysis of Safe, Secure, and Interoperable Smart Devices, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Cheon, Y., Perumendla, A. 2005. Specifying and checking method call sequences in JML. In: Arabnia, H. R., Reza, H. (eds.), Proceedings of the 2005 International Conference on Software Engineering Research and Practice (SERP'05). vol. II, June 27-29, 2005, Las Vegas, Nevada, CSREA Press, pp. 511--516.Google ScholarGoogle Scholar
  16. Kevin Bierhoff, Nels E. Beckman, and Jonathan Aldrich. Practical API Protocol Checking with Access Permissions. In Proceedings of the 23rd European Conference on Object-Oriented Programming (ECOOP'09) (Genova, Italy, July 2009). to appear. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Typestate protocol specification in JML

                  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
                  • Published in

                    cover image ACM Conferences
                    SAVCBS '09: Proceedings of the 8th international workshop on Specification and verification of component-based systems
                    August 2009
                    42 pages
                    ISBN:9781605586809
                    DOI:10.1145/1596486

                    Copyright © 2009 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: 25 August 2009

                    Permissions

                    Request permissions about this article.

                    Request Permissions

                    Check for updates

                    Qualifiers

                    • research-article

                    Acceptance Rates

                    Overall Acceptance Rate37of46submissions,80%

                    Upcoming Conference

                    FSE '24

                  PDF Format

                  View or Download as a PDF file.

                  PDF

                  eReader

                  View online with eReader.

                  eReader