Learning to write tests