KIT | KIT-Bibliothek | Impressum | Datenschutz

Serializing java objects in plain code

Wachter, Julian 1; Tiwari, Deepika ; Monperrus, Martin; Baudry, Benoit
1 Institut für Programmstrukturen und Datenorganisation (IPD), Karlsruher Institut für Technologie (KIT)

Abstract:

In managed languages, serialization of objects is typically done in bespoke binary formats such as Protobuf, or markup languages such as XML or JSON. The major limitation of these formats is readability. Human developers cannot read binary code, and in most cases, suffer from the syntax of XML or JSON. This is a major issue when objects are meant to be embedded and read in source code, such as in test cases.
To address this problem, we propose plain-code serialization. Our core idea is to serialize objects observed at runtime in the native syntax of a programming language. We realize this vision in the context of Java, and demonstrate a prototype which serializes Java objects to Java source code. The resulting source faithfully reconstructs the objects seen at runtime. Our prototype is called ProDJand is publicly available. We experiment with ProDJto successfully plain-code serialize 174,699 objects observed during the execution of 4 open-source Java applications. Our performance measurement shows that the performance impact is not noticeable. Through a user study, we demonstrate that developers prefer plain-code serialized objects within automatically generated tests over their representations as XML or JSON.


Verlagsausgabe §
DOI: 10.5445/IR/1000193828
Veröffentlicht am 03.06.2026
Originalveröffentlichung
DOI: 10.1016/j.jss.2025.112721
Cover der Publikation
Zugehörige Institution(en) am KIT Institut für Programmstrukturen und Datenorganisation (IPD)
Publikationstyp Zeitschriftenaufsatz
Publikationsmonat/-jahr 04.2026
Sprache Englisch
Identifikator ISSN: 0164-1212
KITopen-ID: 1000193828
Erschienen in Journal of Systems and Software
Verlag Elsevier
Band 234
Seiten Art.-Nr. 112721
Vorab online veröffentlicht am 04.12.2025
Nachgewiesen in Scopus
OpenAlex
KIT – Die Universität in der Helmholtz-Gemeinschaft
KITopen Landing Page