Hacker News new | ask | show | jobs
Tests Are About Design (openmymind.net)
2 points by tapan_k 3478 days ago
1 comments

I find it much more helpful to think in terms of why and what we will test rather than how much will we test. This approach resolves a few of the frequently debated issues around testing, such as:

1. Should I test first, or test later?

2. What is the right amount of code coverage?

3. Should I write more unit tests or integration tests?

4. Should I use mocks or not?

and so on...

The above questions can have an arbitrary answer that makes sense in a certain context but may not yield the best cost / benefit ratio in other contexts. Hence, the guiding star needs to be: why are we writing a test.