Menu

Mocking Java enums with jMock is both trivial and impossible

October 02, 2013

I recently ran into a situation where I needed to test some code that used an enum to select between various strategies. As a toy example of this, we’ll use Accounts which have a list of investments and a Strategy which defines what investments are acceptable. View the code on Gist. Strategy is a Java… Read more

Continuous Deployment: API Compatibility Verification

March 19, 2013

We haven’t said much about our continuous deployment system recently. Mostly that’s because there hasn’t been much to say. We invest in systems and infrastructure through a process called proportional investment: we spend time on areas that cause us problems and our deployment infrastructure has performed well, requiring little incremental investment. However, recently we made… Read more

Get thee to a nullery: self-aware nulls for testing

April 11, 2012

Pryce and Freeman’s Growing object-oriented software is a good practical guide to test driven development, as you’d expect from the authors of jMock. It isn’t necessarily easy to adapt piecemeal — introducing end-to-end tests after the fact would require a lot of rewriting and probably introduce more problems than it would be worth assuming you… Read more

Pre-commit Tests

January 26, 2012

Keeping the trunk stable matters a lot at Wealthfront. We do continuous deployment, and when the build is broken our deployment chain stops. We have a flashing light in the office and a pre-commit hook which prevents any commit until the build is fixed. The best way to know if a commit would break the… Read more

Beyond Java’s Access Control: the Visibility Test

December 02, 2011

It is generally a good practice to use the most restrictive access level that makes sense. However, Java’s access control is not always as expressive as one would want. In this blog post, I am going to give two examples where an access level must be artificially relaxed. Then, I’ll describe Wealthfront’s recently open sourced… Read more

Watch my dev2ops video about Wealthfront’s engineering

April 14, 2011

Damon Edwards was kind enough to post his video of me giving my talk about Wealthfront at the dev2ops meetup at Box.net. Enjoy!