4 ms·
Books can be written on testing itself. One article does not cut it. You cannot provide easy and straight answer "how to write a good test", just as you cannot
by renegat0x0 3y ago
Books can be written on testing itself. One article does not cut it.
You cannot provide easy and straight answer "how to write a good test", just as you cannot provide easy simple answer to "how to create good code".
It requires knowledge, practice and experience. It also requires case-by-case study. Not every problem is a nail.
- having said that I have written some pure unit tests, but more often I wrote functional tests, even for "units"
- shifting towards integration tests, may make your tests grow bigger in scope, in initialization, in result checking. There are always trade-offs
- to have seat belts in a car you also need to design them, and produce them. It is really beneficial to have them though, and you should not take into account scenarios without them
- more often I tests API
- they produce sense of security, but they have never ever produced certainty. No one said to me "everything works because we have tests", therefore this argument seems to by more hypothetical then real
- without tests I would have troubles with writing stable software, and I think I am not the only one
Then I suppose we can agree
- writing some tests is a required
- writing tests for critical code parts is required
- updating them is required