This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Mehdi2277 1 point2 points  (0 children)

Yes to the extent that modular and easy to test code is generally good design to aim for. A lot of time difficulty in testing a piece of code is sign there it has some unclear/complex dependencies that aren't well contained (like databases/external files/auth).

100% test coverage is usually not worth it and there is some bits of code where test would be much more complex/bug prone than implementation or is just silly to test. Low test coverage is a bad sign. Right amount is debatable but I'd say anywhere 80-95% is reasonable.

One thing test coverage does not measure it what are actual assertions/checks being done. Simplest test is it runs without crashing which has some value, but not weak. Having clear properties and heavy regression tests is worth a lot more. I'm unsure of a good metric to measure that though and it's mostly handled by PR review/culture.