this post was submitted on 19 Jan 2024
123 points (93.0% liked)

Programmer Humor

32495 readers
555 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 15 points 10 months ago (1 children)

100% code coverage is a bullshit metric that nobody should aim for.

[โ€“] [email protected] 7 points 10 months ago* (last edited 10 months ago)

We should strive for a wide range of test cases. Real testing is done when the software is tested against a wide range of user inputs. Code coverage is no indicator of response to cases.

Unit tests are a fantastic way of implementing test cases. I am of the opinion that most bug PRs should start with a unit test, if nothing else, a persistent reminder that: hey BTW, your user is going to input this garbage, so any logic you implement ALSO has to be resilient against that garbage.