Abstract
The Java Modeling Language (JML) recently switched to an assertion semantics based on “strong validity” in which an assertion is taken to be valid precisely when it is defined and true. Elsewhere we have shared our positive experiences with the realization and use of this new semantics in the context of ESC/Java2. In this paper, we describe the challenges faced by and the redesign required for the implementation of the new semantics in the JML Runtime Assertion Checker (RAC) compiler. Not only is the new semantics effective at helping developers identify formerly undetected errors in specifications, we also demonstrate how the realization of the new semantics is more efficient—resulting in more compact instrumented code that runs slightly faster. More importantly, under the new semantics, the JML RAC can now compile sizeable JML annotated Java programs (like ESC/Java2) which it was unable to compile before.
Access provided by Autonomous University of Puebla. Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
Keywords
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.
References
Burdy, L., Cheon, Y., Cok, D.R., Ernst, M.D., Kiniry, J.R., Leavens, G.T., Leino, K.R.M., Poll, E.: An Overview of JML Tools and Applications. International Journal on Soft-ware Tools for Technology Transfer (STTT) 7(3), 212–232 (2005)
Chalin, P.: Reassessing JML’s Logical Foundation. In: Proceedings of the 7th Workshop on Formal Techniques for Java-like Programs (FTfJP 2005), Glasgow, Scotland (July 2005)
Chalin, P.: Are the Logical Foundations of Verifying Compiler Prototypes Matching User Ex-pectations? Formal Aspects of Computing 19(2), 139–158 (2007)
Chalin, P.: A Sound Assertion Semantics for the Dependable Systems Evolution Verifying Compiler. In: Proceedings of the Int’l Conf. on Soft. Eng. (ICSE), pp. 23–33 (2007)
Chalin, P., James, P.R.: Non-null References by Default in Java: Alleviating the Nullity Annotation Burden. In: Proceedings of the ECOOP, pp. 227–247 (2007)
Chalin, P., Kiniry, J., Leavens, G.T., Poll, E.: Beyond Assertions: Advanced Specification and Verification with JML and ESC/Java2. In: de Boer, F.S., Bonsangue, M.M., Graf, S., de Roever, W.-P. (eds.) FMCO 2005. LNCS, vol. 4111, pp. 342–363. Springer, Heidelberg (2006)
Cheon, Y.: A Runtime Assertion Checker for the Java Modeling Language., Iowa State Uni-versity, Ph.D. Thesis, also TR #03-09 (April 2003)
Cheon, Y., Leavens, G.T.: A Simple and Practical Approach to Unit Testing: The JML and JUnit Way. In: Proceedings of the ECOOP, pp. 231–255. Springer, Heidelberg (2002)
Cheon, Y., Leavens, G.T.: A Contextual Interpretation Of Undefinedness For Runtime Assertion Checking. In: Proc. Int’l Symp. on Automated Analysis-driven Debugging (2005)
Clarke, L.A., Rosenblum, D.S.: A Historical Perspective on Runtime Assertion Checking in Software Development. ACM SIGSOFT SEN 31(3), 25–37 (2006)
Cok, D.R., Kiniry, J.R.: ESC/Java2: Uniting ESC/Java and JML. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 108–128. Springer, Heidelberg (2005)
Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Ob-ject-Oriented Software. Addison-Wesley, Reading (1995)
Gary, T.L., Albert, L.B., Clyde, R.: Preliminary Design of JML: A Behavioral Interface Specification Language for Java. SIGSOFT Softw. Eng. Notes 31(3), 1–38 (2006)
Hoare, C.A.R.: An axiomatic basis for computer programming. Commun. ACM 12(10), 576–580 (1969)
Hoare, C.A.R.: Assertions: A Personal Perspective. IEEE Annals of the History of Comput-ing 25(2), 14–25 (2003)
Jones, C.B.: The early search for tractable ways of reasoning about programs. IEEE Annals of the History of Computing 25(2), 26–49 (2003)
Leavens, G.T., Baker, A.L., Ruby, C.: JML: A Notation for Detailed Design. In: Haim Kilov, B.R., Simmonds, I. (eds.) Behavioral Specifications of Businesses and Systems, pp. 175–188. Kluwer, Dordrecht (1999)
Leavens, G.T., Cheon, Y.: Design by Contract with JML (2006), http://www.jmlspecs.org
Leavens, G.T., Cheon, Y., Clifton, C., Ruby, C., Cok, D.R.: How the design of JML ac-commodates both runtime assertion checking and formal verification. Science of Com-puter Programming 55(1-3), 185–208 (2005)
Leavens, G.T., Poll, E., Clifton, C., Cheon, Y., Ruby, C., Cok, D., Müller, P., Kiniry, J., Chalin, P.: JML Reference Manual (2007), http://www.jmlspecs.org
Lindholm, T., Yellin, F.: The Java Virtual Machine Specification. Prentice-Hall, Englewood Cliffs (1999)
Meyer, B.: Applying Design by Contract. Computer 25(10), 40–51 (1992)
Rioux, F.: Effective and Efficient Design by Contract for Java. M.Comp.Sc. thesis, Concordia University, Montréal, Québec (2006)
Robby, E., Rodríguez, M.B., Dwyer, M.B., Hatcliff, J.: Checking JML specifications using an extensible software model checking framework. International Journal on Software Tools for Technology Transfer (STTT) 8(3), 280–299 (2006)
Sagiv, M., Reps, T., Wilhelm, R.: Parametric shape analysis via 3-valued logic. ACM To-PLaS 24(3), 217–298 (2002)
SAnToS, SpEx Website (2003), http://spex.projects.cis.ksu.edu
Author information
Authors and Affiliations
Editor information
Rights and permissions
Copyright information
© 2008 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Chalin, P., Rioux, F. (2008). JML Runtime Assertion Checking: Improved Error Reporting and Efficiency Using Strong Validity. In: Cuellar, J., Maibaum, T., Sere, K. (eds) FM 2008: Formal Methods. FM 2008. Lecture Notes in Computer Science, vol 5014. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-68237-0_18
Download citation
DOI: https://doi.org/10.1007/978-3-540-68237-0_18
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-68235-6
Online ISBN: 978-3-540-68237-0
eBook Packages: Computer ScienceComputer Science (R0)