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

Programmer Humor

32380 readers
1370 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] 7 points 9 months ago* (last edited 9 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.