Typestate protocol specification in JML

Taekgoo Kim, Kevin Bierhoff, Jonathan Aldrich, Sungwon Kang
2009 Proceedings of the 8th international workshop on Specification and verification of component-based systems - SAVCBS '09  
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
more » ... n 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.
doi:10.1145/1596486.1596490 dblp:conf/sigsoft/KimBAK09 fatcat:hwyexutnsjh5xg2s4szbv2u3ma