Letting Tests Guide Development
Kent Beck introduced the idea to write the test before you write the implementation.[7] He called it “TestFirst” but now this technique is widely known by the more catchy term, Test Driven Development (TDD). It may seem counterintuitive at first. What’s the point of writing the test if we haven’t written the functionality yet? Surely you want to test something after you’ve created it. Yet, this practice is really effective. In this book, we’ll concentrate on the characteristics that functional programming brings to TDD.
Writing code in TDD means we start with a failing test, then we write the code to make it pass, and finally, we clean up our code until we’re happy enough to switch to a new test. Due to the fact ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access