This Diamond-Square Algorithm - Test-Driven Implementation would not be possible without tests (translated to Clojure) from the TDD Lesson - Terrain Generation blog post and a Wikipedia article.