3 ms·
It depends. There are 4 situations I can think of where writing tests is essential: - mission critical code - before refactoring - people working on a
by ma2rten 13y ago
It depends. There are 4 situations I can think of where writing tests is essential:
- mission critical code
- before refactoring
- people working on a codebase they don't understand completely (changing X might break Y)
- implementing complicated algorithms
In other situations, it's a almost a matter of taste: There are people who claim that writing tests will actually make you develop faster because you'll spend less time debugging. Also writing unit tests sometimes can make you think more systematic about all the edge cases an api needs to support.