Abstract
Runtime assertion checking (RAC) is a convenient set of techniques that lets developers abstract away the process of verifying the correctness of their programs by writing formal specifications and automating their verification at runtime.
In this work, we present ortac, a runtime assertion checking tool for OCaml libraries and programs. OCaml is a functional programming language in which idioms rely on an expressive type system, modules, and interface abstractions. ortac consumes interfaces annotated with type invariants and function contracts and produces code wrappers with the same signature that check these specifications at runtime. It provides a flexible framework for traditional assertion checking, monitoring misbehaviors without interruptions, and automated fuzz testing for OCaml programs.
This paper presents an overview of ortac features and highlights its main design choices.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
afl-fuzz—American fuzzy lop. https://lcamtuf.coredump.cx/afl/
Barnett, M.: Code contracts for .NET: runtime verification and so much more. In: Barringer, H., et al. (eds.) RV 2010. LNCS, vol. 6418, pp. 16–17. Springer, Heidelberg (2010). https://doi.org/10.1007/978-3-642-16612-9_2
Barnett, M., Leino, K.R.M., Schulte, W.: The Spec# programming system: an overview. In: Barthe, G., Burdy, L., Huisman, M., Lanet, J.-L., Muntean, T. (eds.) CASSIS 2004. LNCS, vol. 3362, pp. 49–69. Springer, Heidelberg (2005). https://doi.org/10.1007/978-3-540-30569-9_3
Barnett, M., Schulte, W.: Contracts, components, and their runtime verification on the.net platform. Technical report MSR-TR-2002-38, April 2002. https://www.microsoft.com/en-us/research/publication/contracts-components-and-their-runtime-verification-on-the-net-platform/
Barnett, M., Schulte, W.: Runtime verification of .NET contracts, vol. 65, pp. 199–208. Elsevier (2003). https://www.microsoft.com/en-us/research/publication/runtime-verification-of-net-contracts/
Baudin, P., Cuoq, P., Filliâtre, J.C., Marché, C., Monate, B., Moy, Y., Prevosto, V.: ACSL: ANSI/ISO C specification language (2008)
Burdy, L., et al.: An overview of JML tools and applications. Electron. Notes Theor. Comput. Sci. 80, 75–91 (2003). https://doi.org/10.1016/S1571-0661(04)80810-7. https://www.sciencedirect.com/science/article/pii/S1571066104808107. www.jmlspecs.org Eighth International Workshop on Formal Methods for Industrial Critical Systems (FMICS 2003)
Chalin, P.: JML support for primitive arbitrary precision numeric types: definition and semantics. J. Object Technol. 3, 57–79 (2004)
Charguéraud, A., Filliâtre, J.C., Lourenço, C., Pereira, M.: GOSPEL -providing OCaml with a formal specification language. In: FM 2019–23rd International Symposium on Formal Methods, Porto, Portugal, October 2019. https://hal.inria.fr/hal-02157484
Cheon, Y., Leavens, G.: A runtime assertion checker for the java modeling language (JML), January 2002
Cok, D.R.: OpenJML: JML for Java 7 by extending OpenJDK. In: Bobaru, M., Havelund, K., Holzmann, G.J., Joshi, R. (eds.) NFM 2011. LNCS, vol. 6617, pp. 472–479. Springer, Heidelberg (2011). https://doi.org/10.1007/978-3-642-20398-5_35
Delahaye, M., Kosmatov, N., Signoles, J.: Common specification language for static and dynamic analysis of C programs. In: Proceedings of the ACM Symposium on Applied Computing, pp. 1230–1235, March 2013. https://doi.org/10.1145/2480362.2480593
Filliâtre, J.-C., Paskevich, A.: Why3—where programs meet provers. In: Felleisen, M., Gardner, P. (eds.) ESOP 2013. LNCS, vol. 7792, pp. 125–128. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-37036-6_8
Kosmatov, N., Petiot, G., Signoles, J.: An optimized memory monitoring for runtime assertion checking of C programs. In: Legay, A., Bensalem, S. (eds.) RV 2013. LNCS, vol. 8174, pp. 167–182. Springer, Heidelberg (2013). https://doi.org/10.1007/978-3-642-40787-1_10. https://hal-cea.archives-ouvertes.fr/cea-01834990
Kosmatov, N., Maurica, F., Signoles, J.: Efficient runtime assertion checking for properties over mathematical numbers. In: Deshmukh, J., Ničković, D. (eds.) RV 2020. LNCS, vol. 12399, pp. 310–322. Springer, Cham (2020). https://doi.org/10.1007/978-3-030-60508-7_17
McCormick, J.W., Chapin, P.C.: Building High Integrity Applications with SPARK. Cambridge University Press, Cambridge (2015)
Meyer, B.: Applying “design by contract’’. Computer 25(10), 40–51 (1992). https://doi.org/10.1109/2.161279
Pottier, F.: Strong automated testing of OCaml libraries. In: Journées Francophones des Langages Applicatifs (JFLA), February 2021. http://cambium.inria.fr/~fpottier/publis/pottier-monolith-2021.pdf
Signoles, J., Cuoq, P., Kirchner, F., Kosmatov, N., Prevosto, V., Yakobowski, B.: Frama-C: a software analysis perspective, vol. 27 (2012). https://doi.org/10.1007/s00165-014-0326-7
Signoles, J., Kosmatov, N., Vorobyov, K.: E-ACSL, a runtime verification tool for safety and security of C programs (tool paper). In: RV-CuBES (2017). https://doi.org/10.29007/fpdh
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2021 Springer Nature Switzerland AG
About this paper
Cite this paper
Filliâtre, JC., Pascutto, C. (2021). Ortac: Runtime Assertion Checking for OCaml (Tool Paper). In: Feng, L., Fisman, D. (eds) Runtime Verification. RV 2021. Lecture Notes in Computer Science(), vol 12974. Springer, Cham. https://doi.org/10.1007/978-3-030-88494-9_13
Download citation
DOI: https://doi.org/10.1007/978-3-030-88494-9_13
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-88493-2
Online ISBN: 978-3-030-88494-9
eBook Packages: Computer ScienceComputer Science (R0)