Glossary

Round trip

Converting A to B and back to A, and checking you get the original.

A round trip converts data to another format and back, then compares the result with what you started with. It is the cheapest useful test of a conversion, because it needs no expected output, the input is the expected output.

A clean round trip tells you the conversion preserved the data. A failed one tells you where information was lost, which is often more interesting: it locates the exact thing the intermediate format could not hold.

Some round trips can never be clean, and knowing which is the point. JSON to YAML and back is usually faithful because YAML is a superset of JSON. YAML to JSON and back loses comments and anchors permanently. Converting a CSV of numbers to JSON and back can change 007 into 7 unless type inference is handled carefully.