Test driven learning