Menu

Just-in-time Providers for Guice

May 31, 2010

Guice is widely recognised as the best dependency injection framework for the JVM world and specifically for Java. It has brought together ideas from numerous projects, including Spring and PicoContainer, and popularised type driven development. Dependency injection is one of the principal enablers for test driven development, and as such central to our software practices… Read more

Extreme Testing at kaChing

May 21, 2010

A few months ago, I was invited to give a tech talk at Google about our testing practices. I finally got around to posting the slides, see below! During the talk, I presented how we achieved our extreme iteration cycle of 5 minutes commit-to-production cycle. Starting at a high level, we looked the two fundamental… Read more

Use a Before Method in Your Tests

April 28, 2010

When writing unit tests using the JUnit like frameworks, the mantra is to avoid any work in the class and prefer putting initialisation logic in a dedicated before method. Imagine you’re testing JSON manipulation and you have sample fixture data to work on. public class WhyUseBeforeTest { static Json.Array fixture = (Json.Array) Json.fromString(“[5,6]”); @Test public… Read more

Findbugs, Hudson and Pizza Driven Development (PDD)

April 15, 2010

As you may know kaChing (now Wealthfront) is an test driven engineering organization. Test driven is not an option, its a must. We move fast and push code to production few dozens of times a day in a five minutes release cycle, so we must have high confidence in our code. In complex systems there… Read more

Testing with Hibernate

April 08, 2010

Some of the unit tests I wrote lately involved setting up a data setup in the DB and testing the code using and mutating it. To make it clear, the DB is an in memory DB so the setup is super fast without IO slowdowns. Its very easy to do the setup using hibernate but… Read more

Parallelizing JUnit test runs

February 20, 2010

Test runs should be as fast as possible in order to allow a lean development cycle. One of the applications is a Continuous Deployment (see Lean Startup). Using strong multi-core machines to run tests is not enough since most unit tests are using a single thread per test. Apart of reducing IO to minimum, having… Read more