Serializing Java Objects in Plain Code
Julian Wachter, Deepika Tiwari, Martin Monperrus, and Benoit Baudry

TL;DR
This paper introduces a novel method for serializing Java objects directly into Java source code, enhancing readability and usability within source files, especially for testing and debugging purposes.
Contribution
The paper presents ProDJ, a prototype tool that serializes Java objects into Java code, enabling human-readable object representations embedded in source code.
Findings
Successfully serialized 174,699 objects during application runs
Performance impact of serialization is negligible
Developers prefer plain-code serialization over XML or JSON in tests
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 ProDJ and is publicly available. We experiment with ProDJ to successfully plain-code serialize…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsDistributed and Parallel Computing Systems · Parallel Computing and Optimization Techniques · Embedded Systems Design Techniques
