The Behavioral Diversity of Java JSON Libraries

04/29/2021
by   Nicolas Harrand, et al.
0

JSON is a popular file and data format that is precisely specified by the IETF in RFC 8259. Yet, this specification implicitly and explicitly leaves room for many design choices when it comes to parsing and generating JSON. This yields the opportunity of diverse behavior among independent implementations of JSON libraries. A thorough analysis of this diversity can be used by developers to choose one implementation or to design a resilient multi-version architecture. We present the first systematic analysis and comparison of the input / output behavior of 20 JSON libraries, in Java. We analyze the diversity of architectural choices among libraries, and we execute each library with well-formed and ill-formed JSON files to assess their behavior. We first find that the data structure selected to represent JSON objects and the encoding of numbers are the main design differences, which influence the behavior of the libraries. Second, we observe that the libraries behave in a similar way with regular, well-formed JSON files. However, there is a remarkable behavioral diversity with ill-formed files, or corner cases such as large numbers or duplicate data.

READ FULL TEXT

Please sign up or login with your details

Forgot password? Click here to reset