Reflective Metatesting. Protecting You from Yourself and Everybody Else.

November 16, 2016

Infrastructure projects often take user-defined configuration classes as input. I’ve worked on several during my tenure at Wealthfront. You cannot trust the validity of these configurations, even if you wrote them yourself. A pattern I’ve grown to love is writing JUnit tests that use reflection to gather all the input classes to run a suite… Read more

Protobufs backward and forward

March 02, 2011

Protobufs are designed to support forward and backward compatibility, but that doesn’t mean you can’t get it wrong. One issue we ran into recently involved adding a new value to an enum. The protobuf code “worked” in the sense that it did not blow up, but our code that used the data failed. Since at… Read more

Experience of serializing financial domain objects in database

October 25, 2010

I found myself often having to make serialization design choices to persist financial data in database. The kind of financial data I’m referring to are domain objects describing stocks, stock quotes, stock fundamentals, corporate actions and so on. For example, a typical stock object has about 20 ~ 30 fields describing its static information: country,… Read more