Test Driven Development
Kent Beck
11 people recommended it in 4 threads, 2011–2023.
What people on Hacker News said
Kent Beck's TDD is good book to start with. Even if you feel like you have got testing figured out, you should try TDD. It has more to do with discipline and getting things done, rather than writing code fast or smart or efficiently. Someone I follow on twitter once called it "thinking at sustainable pace", which is really what TDD is about.
The only value provided by TDD when writing new code is that you're forced to think from caller/user perspective, so it makes your API design better, that's it.
Listing out the tests you're going to write before you write the code (even mentally) can be considered a continuation of the requirements-gathering process. And thinking about how you're going to test your code before you write it will, in my experience, improve the design.
Split the process of development into small steps. One does not always have to design the complete solution beforehand. Periodic improvement/refactoring leads to better solutions than up-front/big design.
I encourage junior developers to learn and try to use TDD for a while because it can be useful sometimes and improve the way they write code.
Where it comes up
- Ask HN: Top 10 Timeless Software Books That ChangedLife as Software Engineer? 2023 · 8 recommendations
- Ask HN: Which books have made you a better thinker and problem solver? 2022 · 1 recommendation
- Ask HN: What language-agnostic programming books should I read? 2017 · 1 recommendation
- What is the single most influential book every programmer should read? 2011 · 1 recommendation