[MERGE] Shelf 1 / 5: TreeTransform serialization

Andrew Bennetts andrew.bennetts at canonical.com
Mon Oct 20 00:13:30 BST 2008


Aaron Bentley wrote:
> John Arbash Meinel wrote:
[...]
> > I think it would be good to test "serialize()" separately from
> > "deserialize()" to help ensure that things get written the same way over
> > time.
> 
> Yet I agree that some direct tests of serialize and deserialize make sense.
> 
> Rather than bytes on disk, they should be testing how the serialization
> API is used.  We already have plenty of tests to ensure that using the
> pack API produces the correct output.
> 
> So deserialize can be exercised by passing in a manually-constructed
> list of records.  serialize can be exercised with an implementation of
> Pack that simply creates a list of records.
> 
> Does that seem right to you?

I can't speak for John, but that approach makes sense to me.

The small risk with that approach is that the way Pack serialises might
change underneath the shelve code, and the shelve tests won't notice.
We can either decide this isn't likely to be a real problem, or you
could add a single “smoke test” that does exercise the full stack by
serialising to, and/or deserialising from, bytes.

-Andrew.




More information about the bazaar mailing list