That's a good question! We know that 100% code coverage should not be the goal.
We want to include the code paths that are not straightforward to understand, so
unit test would provide documentation. Also good if they are prone to mistakes,
when the code code is complex.
https://twitter.com/guna_lv/status/1582367410295750659
2 replies
We also want use unit tests to document to assumptions / limitations of the
solution that was developed.
I am mostly an outside-in-TDD fan, write code using wishful thinking, and
surround that with failing tests, then write the implementation. That way you
only write the tests you need to ensure your intentions are correctly
implemented.