Most mainstream object-oriented languages provide a notion of equality between objects which can be customized to be weaker than reference equality, and which is coupled with the customizable notion of object hash code. This feature is so pervasive in object-oriented code that incorrect redefinition or use of equality and hash code may have a serious impact on software reliability and safety. Despite redefinition of equality and hash code in mutable classes is unsafe, many widely used API libraries do that in Java and other similar languages. When objects of such classes are used as keys in hash tables, programs may exhibit unexpected and unpredictable behavior. In this paper we propose a runtime verification solution to avoid or at least mitigate this issue. Our proposal uses RML, a rewriting-based domain specific language for runtime verification which is independent from code instrumentation and the programming language used to develop the software to be verified.

Runtime Verification of Hash Code in Mutable Classes / Ancona, D.; Ferrando, A.; Mascardi, V.. - (2023), pp. 25-31. (Intervento presentato al convegno 25th ACM International Workshop on Formal Techniques for Java-like Programs, FTfJP 2023, co-located with ECOOP and ISSTA 2023 tenutosi a Seattle, USA nel 18/07/2023) [10.1145/3605156.3606452].

Runtime Verification of Hash Code in Mutable Classes

Ferrando A.;
2023

Abstract

Most mainstream object-oriented languages provide a notion of equality between objects which can be customized to be weaker than reference equality, and which is coupled with the customizable notion of object hash code. This feature is so pervasive in object-oriented code that incorrect redefinition or use of equality and hash code may have a serious impact on software reliability and safety. Despite redefinition of equality and hash code in mutable classes is unsafe, many widely used API libraries do that in Java and other similar languages. When objects of such classes are used as keys in hash tables, programs may exhibit unexpected and unpredictable behavior. In this paper we propose a runtime verification solution to avoid or at least mitigate this issue. Our proposal uses RML, a rewriting-based domain specific language for runtime verification which is independent from code instrumentation and the programming language used to develop the software to be verified.
2023
25th ACM International Workshop on Formal Techniques for Java-like Programs, FTfJP 2023, co-located with ECOOP and ISSTA 2023
Seattle, USA
18/07/2023
25
31
Ancona, D.; Ferrando, A.; Mascardi, V.
Runtime Verification of Hash Code in Mutable Classes / Ancona, D.; Ferrando, A.; Mascardi, V.. - (2023), pp. 25-31. (Intervento presentato al convegno 25th ACM International Workshop on Formal Techniques for Java-like Programs, FTfJP 2023, co-located with ECOOP and ISSTA 2023 tenutosi a Seattle, USA nel 18/07/2023) [10.1145/3605156.3606452].
File in questo prodotto:
File Dimensione Formato  
proceedings.pdf

Accesso riservato

Dimensione 604.54 kB
Formato Adobe PDF
604.54 kB Adobe PDF   Visualizza/Apri   Richiedi una copia
Pubblicazioni consigliate

Licenza Creative Commons
I metadati presenti in IRIS UNIMORE sono rilasciati con licenza Creative Commons CC0 1.0 Universal, mentre i file delle pubblicazioni sono rilasciati con licenza Attribuzione 4.0 Internazionale (CC BY 4.0), salvo diversa indicazione.
In caso di violazione di copyright, contattare Supporto Iris

Utilizza questo identificativo per citare o creare un link a questo documento: https://hdl.handle.net/11380/1331820
Citazioni
  • ???jsp.display-item.citation.pmc??? ND
  • Scopus 0
  • ???jsp.display-item.citation.isi??? 0
social impact