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

Typestate protocol specification in JML

Published: 25 August 2009 Publication 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.
[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.
[3]
Jean-Raymond Abrial, Stephen A. Schuman and Bertrand Meyer. A Specification Language. In On the Construction of Programs, Cambridge University Press, 1980.
[4]
Kevin Bierhoff and Jonathan Aldrich, Lightweight Object Specification with Typestates. In Foundations of Software Engineering, September 2005.
[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.
[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
[7]
R. DeLine and M. Fähndrich. Typestates for objects. In European Conference on Object-Oriented Programming. Springer-Verlag, 2004.
[8]
C. A. R. Hoare. "An axiomatic basis for computer programming". Communications of the ACM, 12(10):576--580, 1969.
[9]
Gary T. Leavens. JML's Rich, Inherited Specifications for Behavioral Subtypes. In International Conference on Formal Engineering Methods, pp. 2--34, 2006.
[10]
S. Butkevich, M. Renedo, G. Baumgartner, and M. Young. Compiler and tool support for debugging object protocols. In Foundations of Software Engineering, 2000.
[11]
B. Meyer. Eiffel: The Language. Prentice Hall, 1992.
[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.
[13]
D. Harel. Statecharts: A visual formalism for complex systems. Sci. Comput. Programming, 8:231--274, 1987.
[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.
[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.
[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.

Cited By

View all

Recommendations

Comments

Information & Contributors

Information

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
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 25 August 2009

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. behavioral subtyping
  2. jml
  3. typestate
  4. usage protocol

Qualifiers

  • Research-article

Conference

ESEC/FSE09
Sponsor:

Acceptance Rates

Overall Acceptance Rate 37 of 46 submissions, 80%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)2
  • Downloads (Last 6 weeks)0
Reflects downloads up to 20 Jan 2025

Other Metrics

Citations

Cited By

View all

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media