Abstract
Deductive verifiers are used more and more in both academia and industry to prevent costly bugs. Their capabilities of verifying concurrent programs are getting better, but they are still lagging behind with regard to many major programming language features such as exceptions. To improve the situation, this work presents a semantics of Java exceptions which reduces the annotation burden on the user, while still allowing verification of exceptions. This is accomplished by ignoring sources of errors which are irrelevant to functional verification. Additionally, to deal with the complex control flow introduced by finally, a transformation is proposed that simplifies verification of exceptional postconditions and finally into postconditions and goto. We implement the approach and evaluate it against several common exception patterns.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Similar content being viewed by others
References
Ahrendt, W., Beckert, B., Bubel, R., Hähnle, R., Schmitt, P.H., Ulbrich, M.: Deductive Software Verification - The KeY Book. LNCS, vol. 10001. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-49812-6
Amighi, A., Blom, S., Huisman, M., Zaharieva-Stojanovski, M.: The VerCors project: setting up basecamp. In: Proceedings of the Sixth PLPV Workshop. ACM (2012). https://doi.org/10.1145/2103776.2103785
Bicalho de Pádua, G.: Studying and Assisting the Practice of Java and C# Exception Handling. Masters, Concordia University, February 2018
Black Duck Open Hub: The Apache Hadoop Open Source Project on Open Hub: Languages Page (2018). https://www.openhub.net/p/Hadoop/analyses/latest/languages_summary
Black Duck Open Hub: The Apache Tomcat Open Source Project on Open Hub: Languages Page (2018). https://www.openhub.net/p/tomcat/analyses/latest/languages_summary
Blom, S., Darabi, S., Huisman, M., Oortwijn, W.: The VerCors tool set: verification of parallel and concurrent software. In: iFM, vol. 10510, pp. 102–110 (2017). https://doi.org/10.1007/978-3-319-66845-1_7
Cok, D.R.: OpenJML: software verification for Java 7 using JML, OpenJDK, and Eclipse. EPTCS (2014). https://doi.org/10.4204/EPTCS.149.8
Distefano, D., Parkinson, M.J.: jStar: towards practical verification for Java. In: Proceedings of the 23rd ACM SIGPLAN OOPSLA Conference. ACM (2008). https://doi.org/10.1145/1449764.1449782
Dyer, R., Nguyen, H.A., Rajan, H., Nguyen, T.N.: Boa: a language and infrastructure for analyzing ultra-large-scale software repositories. In: 2013 35th ICSE. IEEE (2013). https://doi.org/10.1109/icse.2013.6606588
Eilers, M.: Shortened github link to code-level documentation of get\_finally\_var method (2021). https://edu.nl/8a9qe
Fragoso Santos, J., Maksimović, P., Naudžiünienė, D., Wood, T., Gardner, P.: JaVerT: JavaScript verification toolchain. In: Proceedings of the ACM Programming Language 2(POPL) (2017). https://doi.org/10.1145/3158138
Freund, S.N.: The costs and benefits of Java bytecode subroutines. In: Formal Underpinnings of Java Workshop at OOPSLA 98 (1998)
Gillian Team: Gillian - a multi-language platform for compositional symbolic analysis (2020). https://gillianplatform.github.io/
Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java language specification, Java SE 7th edn. (2000)
Gosling, J., et al.: The Java language specification, Java SE 16th edn. (2021)
Hähnle, R., Huisman, M.: Deductive Software Verification: From Pen-and-Paper Proofs to Industrial Tools. Springer (2019)
Hamilton, J., Danicic, S.: An evaluation of current java bytecode decompilers. In: Ninth IEEE SCAM (2009). DOI: 10.1109/SCAM.2009.24
Jacobs, B.: Verifast & Java’s “finally” clause (2020). https://groups.google.com/forum/#!topic/verifast/56uhVmdERwA
Jacobs, B., Smans, J., Piessens, F.: A Quick Tour of the VeriFast Program Verifier. In: Programming Languages and Systems, vol. 6461. Springer (2010). https://doi.org/10.1007/978-3-642-17164-2_21
Kery, M.B., Le Goues, C., Myers, B.A.: Examining programmer practices for locally handling exceptions. In: Proceedings of the 13th MSR Conference. ACM (2016). https://doi.org/10.1145/2901739.2903497
Leavens, G.T., et al.: JML reference manual (2008). https://www.cs.ucf.edu/~leavens/JML/jmlrefman/jmlrefman_toc.html
Marché, C., Paulin-Mohring, C., Urbain, X.: The Krakatoa tool for certification of Java/JavaCard programs annotated in JML. Journal of Logic and Algebraic Programming 58, 89-106 (2004). https://doi.org/10.1016/j.jlap.2003.07.006
de Moura, L., Bjørner, N.: Z3: an efficient smt solver. In: TACAS. Springer (2008)
Müller, P., Schwerhoff, M., Summers, A.J.: Viper: A verification infrastructure for permission-based reasoning. In: VMCAI. Springer (2016)
Nakshatri, S., Hegde, M., Thandra, S.: Analysis of exception handling patterns in java projects: an empirical study. In: Proceedings of the 13th MSR Conference (2016). https://doi.org/10.1145/2901739.2903499
O’Hearn, P.: Separation logic. Commun. ACM 62 (2019). https://doi.org/10.1145/3211968
Osman, H., Chiş, A., Schaerer, J., Ghafari, M., Nierstrasz, O.: On the evolution of exception usage in Java projects. In: 2017 IEEE 24th SANER Conference (2017). https://doi.org/10.1109/SANER.2017.7884646
Purohit, P., Tokekar, V.: An investigation of exception handling practices in.NET and Java environments. Int. J. Appl. Eng. Res. 13, 2130–2140 (2018)
Rubbens, R.: Improving support for Java exceptions and inheritance in VerCors. Master’s thesis, University of Twente (2020). https://essay.utwente.nl/81338/
Rubbens, R.: Modular Transformation of Java Exceptions Modulo Errors: accompanying package (2021). https://doi.org/10.4121/14905251
Sena, D., Coelho, R., Kulesza, U., Bonifácio, R.: Understanding the exception handling strategies of Java libraries: an empirical study. In: Proceedings of the 13th MSR Conference. ACM (2016). https://doi.org/10.1145/2901739.2901757
Steinhöfel, D., Wasser, N.: A New Invariant Rule for the Analysis of Loops with Non-standard Control Flows. In: IFM, vol. 10510. Springer (2017). https://doi.org/10.1007/978-3-319-66845-1_18
Vallée-Rai, R., Co, P., Gagnon, E., Hendren, L., Lam, P., Sundaresan, V.: Soot: a java bytecode optimization framework. CASCON First Decade High Impact Papers (2010). https://doi.org/10.1145/1925805.1925818
VerCors Team: VerCors homepage (2020). https://vercors.ewi.utwente.nl/
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
Rubbens, R., Lathouwers, S., Huisman, M. (2021). Modular Transformation of Java Exceptions Modulo Errors. In: Lluch Lafuente, A., Mavridou, A. (eds) Formal Methods for Industrial Critical Systems. FMICS 2021. Lecture Notes in Computer Science(), vol 12863. Springer, Cham. https://doi.org/10.1007/978-3-030-85248-1_5
Download citation
DOI: https://doi.org/10.1007/978-3-030-85248-1_5
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-030-85247-4
Online ISBN: 978-3-030-85248-1
eBook Packages: Computer ScienceComputer Science (R0)